comparison small_rna_maps.py @ 15:82fedc576024 draft

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c1d96f7f028512aa4d8fcae3dd5f967cd445708e
author artbio
date Sat, 06 Oct 2018 05:24:15 -0400
parents 3ea75c573429
children 600e2498bd21
comparison
equal deleted inserted replaced
14:cd75c72e1d75 15:82fedc576024
52 for chrom in self.chromosomes: 52 for chrom in self.chromosomes:
53 # get empty value for start and end of each chromosome 53 # get empty value for start and end of each chromosome
54 map_dictionary[(chrom, 1, 'F')] = [] 54 map_dictionary[(chrom, 1, 'F')] = []
55 map_dictionary[(chrom, self.chromosomes[chrom], 'F')] = [] 55 map_dictionary[(chrom, self.chromosomes[chrom], 'F')] = []
56 for read in bam_object.fetch(chrom): 56 for read in bam_object.fetch(chrom):
57 if (read.query_alignment_length >= minsize and 57 positions = read.positions # a list of covered positions
58 read.query_alignment_length <= maxsize): 58 if read.is_reverse:
59 positions = read.positions # a list of covered positions 59 map_dictionary[(chrom, positions[-1]+1, 'R')].append(
60 if read.is_reverse: 60 read.query_alignment_length)
61 map_dictionary[(chrom, positions[-1]+1, 'R')].append( 61 else:
62 read.query_alignment_length) 62 map_dictionary[(chrom, positions[0]+1, 'F')].append(
63 else: 63 read.query_alignment_length)
64 map_dictionary[(chrom, positions[0]+1, 'F')].append(
65 read.query_alignment_length)
66 return map_dictionary 64 return map_dictionary
67 65
68 def grouper(self, iterable, clust_distance): 66 def grouper(self, iterable, clust_distance):
69 prev = None 67 prev = None
70 group = [] 68 group = []