Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def call(min_quality, exclude_flags, flag_as_sorted):
input_file = pysam.Samfile("-", "r")
header = input_file.header
if flag_as_sorted:
set_in(header, ("HD", "SO"), "coordinate")
set_in(header, ("HD", "GO"), "none")
set_in(header, ("HD", "VN"), "1.0")
output_file = pysam.Samfile("-", "wb", header = header)
for read in input_file:
if read.flag & exclude_flags:
continue
elif read.mapq < min_quality:
continue
output_file.write(read)
output_file.close()
input_file.close()
def call(min_quality, exclude_flags, flag_as_sorted):
input_file = pysam.Samfile("-", "r")
header = input_file.header
if flag_as_sorted:
set_in(header, ("HD", "SO"), "coordinate")
set_in(header, ("HD", "GO"), "none")
set_in(header, ("HD", "VN"), "1.0")
output_file = pysam.Samfile("-", "wb", header = header)
for read in input_file:
if read.flag & exclude_flags:
continue
elif read.mapq < min_quality:
continue
output_file.write(read)
output_file.close()
input_file.close()
def call(min_quality, exclude_flags, flag_as_sorted):
input_file = pysam.Samfile("-", "r")
header = input_file.header
if flag_as_sorted:
set_in(header, ("HD", "SO"), "coordinate")
set_in(header, ("HD", "GO"), "none")
set_in(header, ("HD", "VN"), "1.0")
output_file = pysam.Samfile("-", "wb", header = header)
for read in input_file:
if read.flag & exclude_flags:
continue
elif read.mapq < min_quality:
continue
output_file.write(read)
output_file.close()
input_file.close()