-0 Write reads where the READ1 and READ2 FLAG bits set are either both set or both unset to FILE instead of outputting them.
http://www.htslib.org/doc/samtools-fasta.html
I just don't understand what it's saying. It looks like my output is the same regardless.
I'm trying to pipe the mapped reads from bwa mem
to samtools fastq
getting only the mapped reads and then repairing the reads using bbmap's repair.sh
input_filepaths = [reference_index, reads_1.fastq, reads_2.fastq]
output_filepaths = [mapped_1.fastq, mapped_2.fastq]
cmd = [
"(",
os.environ["bwa"],
"mem",
"-t {}".format(opts.n_jobs),
opts.bwa_options,
input_filepaths[0],
input_filepaths[1],
input_filepaths[2],
"|",
# os.environ["reformat.sh"],
# "in=stdin.sam",
# "fastawrap=1000",
# "mappedonly=t",
# "overwrite=t",
# # "ref={}".format(input_filepaths[0]),
# "out1={}".format(output_filepaths[0]),
# "out2={}".format(output_filepaths[1]),
"|",
os.environ["samtools"],
"fastq",
"-F 4",
"--threads {}".format(opts.n_jobs),
"-0 /dev/null",
"-s /dev/null",
"-N -",
"|",
os.environ["repair.sh"],
"in=stdin.fastq",
"out1={}".format(output_filepaths[0]),
"out2={}".format(output_filepaths[1]),
"fastawrap=1000",
"interleaved=t",
"overwrite=t",
")",
]