Clean file

parent 16a42095
#!/usr/bin/env python #!/usr/bin/env python
# Yannis Duffourd
# Anne-Sophie Denommé-Pichon
import sys import sys
import getopt import getopt
import pysam import pysam
...@@ -7,7 +10,6 @@ import logging ...@@ -7,7 +10,6 @@ import logging
import math import math
import threading import threading
import random import random
# ~ import matplotlib.pyplot as plt
currentThread = 0 currentThread = 0
nbThread = 1 nbThread = 1
...@@ -15,7 +17,6 @@ downSamplingRate = 0 ...@@ -15,7 +17,6 @@ downSamplingRate = 0
inputFile = "" inputFile = ""
logFile = "" logFile = ""
opts, args = getopt.getopt(sys.argv[1:], 'i:o:d:l:') opts, args = getopt.getopt(sys.argv[1:], 'i:o:d:l:')
for opt, arg in opts: for opt, arg in opts:
if opt in ("-i"): if opt in ("-i"):
...@@ -33,13 +34,12 @@ for opt, arg in opts: ...@@ -33,13 +34,12 @@ for opt, arg in opts:
sys.stderr.write( "Parsing bam file : %s ..." % ( inputFile ) ) sys.stderr.write( "Parsing bam file : %s ..." % ( inputFile ) )
bamIterRef = pysam.AlignmentFile( inputFile , "r" ) bamIterRef = pysam.AlignmentFile( inputFile , "r" )
bamCodonReference = {} bamCodonReference = {}
# samStream = open( samFile , "r" )
bamOutStream = pysam.AlignmentFile(outputFile, "wb" , template=bamIterRef ) bamOutStream = pysam.AlignmentFile(outputFile, "wb" , template=bamIterRef )
for line in bamIterRef: for line in bamIterRef:
#logging.info('########\nNew read to parse : ' + str(line) ) # logging.info('########\nNew read to parse : ' + str(line) )
# pass bad alignements # pass bad alignements
if (line.is_unmapped == True ) or (line.is_secondary == True ) or (line.is_supplementary == True) : if (line.is_unmapped == True ) or (line.is_secondary == True ) or (line.is_supplementary == True) :
#~ logging.info('Passing sequence : bad quality ' ) # logging.info('Passing sequence : bad quality ' )
continue continue
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment