comparison readmap.py @ 3:9b62e6b0d219 draft

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/msp_sr_readmap_and_size_histograms commit 032b3f084f3b2a6d42ba476ef55f4de593b58606-dirty
author mvdbeek
date Wed, 03 Feb 2016 11:07:25 -0500
parents ebfc73c72652
children 4efe210c91f3
comparison
equal deleted inserted replaced
2:ebfc73c72652 3:9b62e6b0d219
87 first_line = plottable[0] 87 first_line = plottable[0]
88 last_line = plottable[-1] 88 last_line = plottable[-1]
89 gene, coordinate, count, orientation = listify_plottable_item(first_line) 89 gene, coordinate, count, orientation = listify_plottable_item(first_line)
90 if not coordinate == "0": 90 if not coordinate == "0":
91 new_line = "\t".join([gene, "0", "0", "F"]) 91 new_line = "\t".join([gene, "0", "0", "F"])
92 plottable = new_line + plottable 92 plottable = [new_line] + plottable
93 gene_length = str(lookup_gene_length(gene, readDict)) 93 gene_length = str(lookup_gene_length(gene, readDict))
94 if not coordinate == gene_length: 94 if not coordinate == gene_length:
95 last_line = "\t".join([gene, gene_length, "0", "F"]) 95 last_line = "\t".join([gene, gene_length, "0", "F"])
96 plottable = plottable + last_line 96 plottable = plottable + [last_line]
97 97
98 def write_readplot_dataframe(readDict, readmap_file): 98 def write_readplot_dataframe(readDict, readmap_file):
99 listoflines = [] 99 listoflines = []
100 with open(readmap_file, 'w') as readmap: 100 with open(readmap_file, 'w') as readmap:
101 print >>readmap, "gene\tcoord\tcount\tpolarity\tsample" 101 print >>readmap, "gene\tcoord\tcount\tpolarity\tsample"