diff --git a/snipit/command.py b/snipit/command.py index c31eff0..6b0fa5a 100644 --- a/snipit/command.py +++ b/snipit/command.py @@ -57,6 +57,7 @@ def main(sysargs = sys.argv[1:]): f_group.add_argument("--high-to-low", action='store_false', help="If sorted by mutation number is selected, show the sequences with the fewest SNPs closest to the reference. Default: False", dest="high_to_low") + f_group.add_argument("--remove-site-text",action='store_true',help="Do not annotate text on the individual columns in the figure.",dest="remove_site_text") s_group = parser.add_argument_group('SNP options') s_group.add_argument("--show-indels",action='store_true',help="Include insertion and deletion mutations in snipit plot.",dest="show_indels") @@ -120,6 +121,7 @@ def main(sysargs = sys.argv[1:]): args.height, args.size_option, args.solid_background, + args.remove_site_text, args.flip_vertical, args.included_positions, args.excluded_positions, diff --git a/snipit/scripts/snp_functions.py b/snipit/scripts/snp_functions.py index 889241d..675c8d9 100644 --- a/snipit/scripts/snp_functions.py +++ b/snipit/scripts/snp_functions.py @@ -358,6 +358,8 @@ def make_graph(num_seqs, height, size_option, solid_background, + ambig_mode, + remove_site_text, flip_vertical=False, included_positions=None, excluded_positions=None, @@ -552,7 +554,8 @@ def make_graph(num_seqs, # write text adjacent to the SNPs shown with the numeric position # the text alignment is toggled right/left (top/bottom considering 90-deg rotation) if the plot is flipped - ax.text(position, y_level+(0.55*y_inc), snp, size=9, ha="center", va="bottom" if not flip_vertical else "top", rotation=90) + if not remove_site_text: + ax.text(position, y_level+(0.55*y_inc), snp, size=9, ha="center", va="bottom" if not flip_vertical else "top", rotation=90) # snp position labels left_of_box = position-(0.4*spacing) @@ -576,11 +579,12 @@ def make_graph(num_seqs, ax.add_patch(rect) # sequence variant text - ax.text(position, y_pos*y_inc, var, size=9, ha="center", va="center") + if not remove_site_text: + ax.text(position, y_pos*y_inc, var, size=9, ha="center", va="center") # reference variant text - - ax.text(position, y_inc * -0.2, ref, size=9, ha="center", va="center") + if not remove_site_text: + ax.text(position, y_inc * -0.2, ref, size=9, ha="center", va="center") #polygon showing mapping from genome to spaced out snps x = [snp-0.5,snp+0.5,right_of_box,left_of_box,snp-0.5]