diff mut2read.py @ 11:84a1a3f70407 draft

planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
author mheinzl
date Mon, 15 Feb 2021 21:53:24 +0000
parents e18c5293aac7
children d21960b45a6b
line wrap: on
line diff
--- a/mut2read.py	Thu Feb 04 09:01:43 2021 +0000
+++ b/mut2read.py	Mon Feb 15 21:53:24 2021 +0000
@@ -11,7 +11,7 @@
 
 =======  ==========  =================  ================================
 Version  Date        Author             Description
-0.2.1    2019-10-27  Gundula Povysil    -
+2.0.0    2020-10-30  Gundula Povysil    -
 =======  ==========  =================  ================================
 
 USAGE: python mut2read.py DCS_Mutations.tabular DCS.bam Aligned_Families.tabular Interesting_Reads.fastq tag_count_dict.json
@@ -62,7 +62,6 @@
         sys.exit("Error: Could not find '{}'".format(file3))
 
     # read dcs bam file
-#    pysam.index(file2)
     bam = pysam.AlignmentFile(file2, "rb")
 
     # get tags
@@ -74,14 +73,8 @@
         stop_pos = variant.start
         #chrom_stop_pos = str(chrom) + "#" + str(stop_pos)
         ref = variant.REF
-        if len(variant.ALT) == 0:
-            continue
-        else:
-            alt = variant.ALT[0]
-        print(alt)
+        alt = variant.ALT[0]
         chrom_stop_pos = str(chrom) + "#" + str(stop_pos) + "#" + ref + "#" + alt
-
-
         dcs_len = []
         if len(ref) == len(alt):
             for pileupcolumn in bam.pileup(chrom, stop_pos - 1, stop_pos + 1, max_depth=100000000):
@@ -152,4 +145,3 @@
 
 if __name__ == '__main__':
     sys.exit(mut2read(sys.argv))
-