comparison small_rna_maps.py @ 3:ed8b0142538d draft

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 7b2ceb05489c27ddb769c38fdec56274108a6fa1
author artbio
date Tue, 22 Aug 2017 12:05:47 -0400
parents 507383cce5a8
children a6b9a081064b
comparison
equal deleted inserted replaced
2:507383cce5a8 3:ed8b0142538d
53 else: 53 else:
54 map_dictionary[(chrom, positions[0]+1, 54 map_dictionary[(chrom, positions[0]+1,
55 'F')].append(read.query_alignment_length) 55 'F')].append(read.query_alignment_length)
56 return map_dictionary 56 return map_dictionary
57 57
58 def compute_map(self, map_dictionary, out): 58 def compute_readcount(self, map_dictionary, out):
59 ''' 59 '''
60 takes a map_dictionary as input and writes 60 takes a map_dictionary as input and writes
61 a readmap_dictionary {(chromosome,read_position,polarity): 61 a readmap_dictionary {(chromosome,read_position,polarity):
62 number_of_reads} 62 number_of_reads}
63 in an open file handler out 63 in an open file handler out
189 header = ["Dataset", "Chromosome", "Chrom_length", "Coordinate", 189 header = ["Dataset", "Chromosome", "Chrom_length", "Coordinate",
190 "Polarity", method] 190 "Polarity", method]
191 F.write('\t'.join(header) + '\n') 191 F.write('\t'.join(header) + '\n')
192 for input, sample in zip(inputs, samples): 192 for input, sample in zip(inputs, samples):
193 mapobj = Map(input, sample) 193 mapobj = Map(input, sample)
194 token = {"Counts": mapobj.compute_map, 194 token = {"Counts": mapobj.compute_readcount,
195 "Max": mapobj.compute_max, 195 "Max": mapobj.compute_max,
196 "Mean": mapobj.compute_mean, 196 "Mean": mapobj.compute_mean,
197 "Median": mapobj.compute_median, 197 "Median": mapobj.compute_median,
198 "Coverage": mapobj.compute_coverage, 198 "Coverage": mapobj.compute_coverage,
199 "Size": mapobj.compute_size} 199 "Size": mapobj.compute_size}