Clean file

parent 16a42095
#!/usr/bin/env python
# Yannis Duffourd
# Anne-Sophie Denommé-Pichon
import sys
import getopt
import pysam
......@@ -7,7 +10,6 @@ import logging
import math
import threading
import random
# ~ import matplotlib.pyplot as plt
currentThread = 0
nbThread = 1
......@@ -15,7 +17,6 @@ downSamplingRate = 0
inputFile = ""
logFile = ""
opts, args = getopt.getopt(sys.argv[1:], 'i:o:d:l:')
for opt, arg in opts:
if opt in ("-i"):
......@@ -33,13 +34,12 @@ for opt, arg in opts:
sys.stderr.write( "Parsing bam file : %s ..." % ( inputFile ) )
bamIterRef = pysam.AlignmentFile( inputFile , "r" )
bamCodonReference = {}
# samStream = open( samFile , "r" )
bamOutStream = pysam.AlignmentFile(outputFile, "wb" , template=bamIterRef )
for line in bamIterRef:
#logging.info('########\nNew read to parse : ' + str(line) )
# logging.info('########\nNew read to parse : ' + str(line) )
# pass bad alignements
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
......
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