diff overlapping_reads.py @ 7:07771982ef9b draft

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_signatures commit 7276b6b73aef7af4058ad2c1e34c4557e9cccbe0
author artbio
date Sun, 10 Sep 2017 13:50:40 -0400
parents 4da23f009c9e
children 8d3ca9652a5b
line wrap: on
line diff
--- a/overlapping_reads.py	Sun Sep 10 10:27:19 2017 -0400
+++ b/overlapping_reads.py	Sun Sep 10 13:50:40 2017 -0400
@@ -88,13 +88,17 @@
     def countpairs(self, uppers, lowers):
         query_range = self.query_range
         target_range = self.target_range
-        uppers = [seq for seq in uppers if (len(seq) in query_range or len(seq) in target_range)]
+        uppers = [seq for seq in uppers if (len(seq) in query_range or len(seq)
+                  in target_range)]
+        print(uppers)
         uppers_expanded = []
         for seq in uppers:
             expand = [seq for i in range(self.readdic[seq])]
             uppers_expanded.extend(expand)
+        print(uppers_expanded)
         uppers = uppers_expanded
-        lowers = [seq for seq in lowers if (len(seq) in query_range or len(seq) in target_range)]
+        lowers = [seq for seq in lowers if (len(seq) in query_range or len(seq)
+                  in target_range)]
         lowers_expanded = []
         for seq in lowers:
             expand = [seq for i in range(self.readdic[seq])]
@@ -119,7 +123,7 @@
         stringresult = []
         header_template = '>%s|coord=%s|strand %s|size=%s|nreads=%s\n%s\n'
         total_pairs = 0
-        print ('Chromosome\tNbre of pairs')
+        print('Chromosome\tNbre of pairs')
         for chrom in sorted(self.chromosomes):
             number_pairs = 0
             for pos in self.all_query_positions[chrom]:
@@ -146,7 +150,8 @@
                                      self.revcomp(downread)))
                 stringresult.extend(sorted(set(stringbuffer)))
             print('%s\t%s' % (chrom, number_pairs))
-        print('Total nbre of pairs that can be simultaneously formed\t%s' % total_pairs)
+        print('Total nbre of pairs that can be simultaneously formed\t%s'
+              % total_pairs)
         F.write(''.join(stringresult))
 
     def revcomp(self, sequence):