diff small_rna_maps.py @ 29:8b5695592784 draft

"planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit c3d728b98db4987821feae40952d9797c97eaf5a"
author artbio
date Fri, 04 Oct 2019 04:33:53 -0400
parents 14adf24603b6
children 183bf49fe77c
line wrap: on
line diff
--- a/small_rna_maps.py	Thu Apr 25 12:49:05 2019 -0400
+++ b/small_rna_maps.py	Fri Oct 04 04:33:53 2019 -0400
@@ -243,9 +243,9 @@
                         map_dictionary[(chrom, pos+1, 'F')] = []
         for key in map_dictionary:
             coverage = self.bam_object.count_coverage(
-                                                reference=key[0],
+                                                contig=key[0],
                                                 start=key[1]-1,
-                                                end=key[1],
+                                                stop=key[1],
                                                 quality_threshold=quality)
             """ Add the 4 coverage values """
             coverage = [sum(x) for x in zip(*coverage)]
@@ -298,7 +298,7 @@
                     sizeness[size] += sizedic[chrom][polarity][size]
             Strandbias = strandness['F'] + strandness['R']
             if Strandbias:
-                Strandbias = strandness['F'] / float(Strandbias)
+                Strandbias = round(strandness['F'] / float(Strandbias), 2)
             else:
                 Strandbias = 2
             Mean = numpy.mean(sizeness.values())
@@ -313,10 +313,10 @@
                     try:
                         line = [self.sample_name, chrom, polarity, size,
                                 sizedic[chrom][polarity][size],
-                                Strandbias, sizeness[size]]
+                                Strandbias, round(sizeness[size], 3)]
                     except KeyError:
                         line = [self.sample_name, chrom, polarity, size, 0,
-                                Strandbias, sizeness[size]]
+                                Strandbias, round(sizeness[size], 3)]
                     line = [str(i) for i in line]
                     out.write('\t'.join(line) + '\n')