Skip to content

Commit

Permalink
Update plotCustomAllelePlot.py with API change to plot_alleles_table
Browse files Browse the repository at this point in the history
  • Loading branch information
Colelyman committed Aug 9, 2024
1 parent 0402f25 commit 769e5f3
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions scripts/plotCustomAllelePlot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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()

0 comments on commit 769e5f3

Please sign in to comment.