diff --git a/scripts/plotCustomAllelePlot.py b/scripts/plotCustomAllelePlot.py index 0025706e..f5ec2431 100644 --- a/scripts/plotCustomAllelePlot.py +++ b/scripts/plotCustomAllelePlot.py @@ -28,7 +28,7 @@ def main(): parser.add_argument("--plot_left",help="Number of bases to plot to the left of the cut site",type=int,default=20) parser.add_argument("--plot_right",help="Number of bases to plot to the right of the cut site",type=int,default=20) parser.add_argument("--plot_center",help="Center of plot. If set, plots for guide RNAs will not be generated -- only a plot centered at this position will be plotted.",type=int,default=None) - + # CRISPRessoPro params parser.add_argument('--use_matplotlib', action='store_true', help='Use matplotlib for plotting instead of plotly/d3 when CRISPRessoPro is installed') @@ -132,14 +132,14 @@ def plot_alleles_tables_from_folder(crispresso_output_folder,fig_filename_root,p for (int_start, int_end) in refs[ref_name]['sgRNA_intervals']: new_sgRNA_intervals += [(int_start - new_sel_cols_start - 1,int_end - new_sel_cols_start - 1)] + fig_filename_root = fig_filename_root+"_"+ref_name+"_"+sgRNA_label + df_alleles_prep = CRISPRessoPlot.prep_alleles_table(df_alleles_around_cut, ref_seq_around_cut, MAX_N_ROWS, MIN_FREQUENCY) CRISPRessoPlot.plot_alleles_table(ref_seq_around_cut, - df_alleles=df_alleles_around_cut, + df_alleles_prep=df_alleles_prep, fig_filename_root=fig_filename_root, cut_point_ind=cut_point-new_sel_cols_start, custom_colors=custom_colors, - MIN_FREQUENCY=MIN_FREQUENCY, - MAX_N_ROWS=MAX_N_ROWS, SAVE_ALSO_PNG=SAVE_ALSO_PNG, plot_cut_point=plot_cut_point, sgRNA_intervals=new_sgRNA_intervals, @@ -174,13 +174,12 @@ def plot_alleles_tables_from_folder(crispresso_output_folder,fig_filename_root,p new_sgRNA_intervals += [(int_start - new_sel_cols_start - 1,int_end - new_sel_cols_start - 1)] fig_filename_root = fig_filename_root+"_"+ref_name+"_"+sgRNA_label + df_alleles_prep = CRISPRessoPlot.prep_alleles_table(df_alleles_around_cut, ref_seq_around_cut, MAX_N_ROWS, MIN_FREQUENCY) CRISPRessoPlot.plot_alleles_table(ref_seq_around_cut, - df_alleles=df_alleles_around_cut, + df_alleles_prep=df_alleles_prep, fig_filename_root=fig_filename_root, cut_point_ind=cut_point-new_sel_cols_start, custom_colors=custom_colors, - MIN_FREQUENCY=MIN_FREQUENCY, - MAX_N_ROWS=MAX_N_ROWS, SAVE_ALSO_PNG=SAVE_ALSO_PNG, plot_cut_point=plot_cut_point, sgRNA_intervals=new_sgRNA_intervals, @@ -194,4 +193,3 @@ def plot_alleles_tables_from_folder(crispresso_output_folder,fig_filename_root,p if __name__ == "__main__": # execute only if run as a script main() -