@@ -5,30 +5,30 @@ import os
55
66
77# Parameters
8- synteny_blocks = config ["blocks" ] if "blocks" in config else None
9- name_conversion = config ["name_conversion" ] if "name_conversion" in config else None
10- name_conversion = None if name_conversion == "None" else name_conversion
11- prefix = config ["prefix" ] if "prefix" in config else "ntSynt_gggenomes"
12- indel_threshold = config ["indel_threshold" ] if "indel_threshold" in config else 50000
13- min_len = config ["min_length" ] if "min_length" in config else 50000
14- fais = config ["fai" ] if "fai" in config else None
15- ribbon_ratio = config ["ribbon_ratio" ] if "ribbon_ratio" in config else 0.1
16- cladogram_ratio = config ["cladogram_adjust" ] if "cladogram_adjust" in config else 0.1
17- scale = config ["scale" ] if "scale" in config else 1e9
18- centromeres = config ["centromeres" ] if "centromeres" in config else None
19- normalize = config ["normalize" ] if "normalize" in config else False
8+ synteny_blocks = config .get ("blocks" , None )
9+ name_conversion = config .get ("name_conversion" , None )
10+ prefix = config .get ("prefix" , "ntSynt_gggenomes" )
11+ indel_threshold = config .get ("indel_threshold" , 50000 )
12+ min_len = config .get ("min_length" , 50000 )
13+ fais = config .get ("fai" , None )
14+ ribbon_ratio = config .get ("ribbon_ratio" , 0.1 )
15+ cladogram_ratio = config .get ("cladogram_adjust" , 0.1 )
16+ scale = config .get ("scale" , 1e9 )
17+ centromeres = config .get ("centromeres" , None )
18+ normalize = config .get ("normalize" , False )
2019blocks_no_suffix = os .path .basename (synteny_blocks ).removesuffix (".tsv" )
21- tree = config [ "tree" ] if "tree" in config else None
22- format_img = config [ "format" ] if "format" in config else " png"
23- plot_height = config [ "height" ] if "height" in config else 20
24- plot_width = config [ "width" ] if "width" in config else 50
25- no_arrow = config [ "no_arrow" ] if "no_arrow" in config else False
26- target_genome = config [ "target_genome" ] if "target_genome" in config else False
27- haplotypes = config [ "haplotypes" ] if "haplotypes" in config else []
28- keep = " " .join (config [ "keep" ]) if "keep" in config else []
29- min_seq_length = config [ "min_seq_length" ] if "min_seq_length" in config else 500000
30- res = config [ "dpi" ] if "dpi" in config else 300
20+ tree = config . get ( "tree" , None )
21+ format_img = config . get ( "format" , " png")
22+ plot_height = config . get ( "height" , 20 )
23+ plot_width = config . get ( "width" , 50 )
24+ no_arrow = config . get ( "no_arrow" , False )
25+ target_genome = config . get ( "target_genome" , False )
26+ haplotypes = config . get ( "haplotypes" , [])
27+ keep = " " .join (config . get ( "keep" , []))
28+ min_seq_length = config . get ( "min_seq_length" , 500000 )
29+ res = config . get ( "dpi" , 300 )
3130orders = config .get ("order" , [])
31+ annotate_genome_info = config .get ("annotate_genome_info" , False )
3232
3333def sort_fais (fai_list , name_conversion , orders ):
3434 "Based on the name conversion TSV, sort the FAIs based on orders"
@@ -271,10 +271,11 @@ rule ribbon_plot:
271271 arrow = "--no-arrow" if no_arrow else "" ,
272272 haplotypes = f"--haplotypes { rules .nudges .output .nudges } " if haplotypes else "" ,
273273 resolution = f"--dpi { res } " if format_img == "png" else "" ,
274+ annotate_genome_info = "--annotate-genome-info" if annotate_genome_info else "" ,
274275 shell :
275276 "ntsynt_viz_plot_synteny_blocks_ribbon_plot.R -s {input.sequences} -l {input.links} -p {params.prefix} --ratio {params.ratio}"
276277 " --scale {params.scale} -c {input.colour_feats} --format {params.out_img_format} --height {params.height} --width {params.width}"
277- " {params.centromeres} {params.arrow} {params.haplotypes} --colour_indices {input.colour_seqs} {params.resolution}"
278+ " {params.centromeres} {params.arrow} {params.haplotypes} --colour_indices {input.colour_seqs} {params.resolution} {params.annotate_genome_info} "
278279
279280rule ribbon_plot_tree :
280281 input :
@@ -297,7 +298,8 @@ rule ribbon_plot_tree:
297298 arrow = "--no-arrow" if no_arrow else "" ,
298299 haplotypes = f"--haplotypes { rules .nudges .output .nudges } " if haplotypes else "" ,
299300 resolution = f"--dpi { res } " if format_img == "png" else "" ,
301+ annotate_genome_info = "--annotate-genome-info" if annotate_genome_info else "" ,
300302 shell :
301303 "ntsynt_viz_plot_synteny_blocks_ribbon_plot.R -s {input.sequences} -l {input.links} -p {params.prefix} --tree {input.tree}"
302304 " --ratio {params.ratio} --scale {params.scale} -c {input.colour_feats} --format {params.out_img_format} --height {params.height} --width {params.width}"
303- " --order {input.orders} {params.centromeres} {params.arrow} {params.haplotypes} --colour_indices {input.colour_seqs} {params.resolution}"
305+ " --order {input.orders} {params.centromeres} {params.arrow} {params.haplotypes} --colour_indices {input.colour_seqs} {params.resolution} {params.annotate_genome_info} "
0 commit comments