bowtie2 unaligned option not writing to file
1
0
Entering edit mode
2.9 years ago
daewowo ▴ 80

I am using the following command to align with bowtie2

cmd = f"bowtie2 -x {BOWTIE_REF} -1 {fastq_1} -2 {fastq_2} -S {out_file} --threads {NUM_THREADS} --local --score-min G,298,0 --un {un_path}"

The file at un_path is created but nothing is written to it. I have tested this on multiple alignments. Every time, un_path file is created but is always empty. Any ideas

bowtie2 • 898 views
ADD COMMENT
2
Entering edit mode
2.9 years ago
seidel 11k

--un means: "Write unpaired reads that fail to align to file at <path>. These reads correspond to the SAM records with the FLAGS 0x4 bit set and neither the 0x40 nor 0x80 bits set." Have you tried a toy alignment you can construct that meets these exact conditions? (do you have unpaired reads that fail to align?) Have you tried eliminating the score-min parameter?

ADD COMMENT
0
Entering edit mode

I tried without the --score-min parameter and without both --local and --score-min, but still no reads are written to the unaligned file. The dataset is metagenomic and only a fraction of these correspond to the reference genome I am aligning to. Bowtie2 version 2.4.2

ADD REPLY
1
Entering edit mode

The --un parameter writes unpaired reads, but you're giving it paired reads. If instead of -1 R1.fq -2 R2.fq, you try -U R1.fq,R2.fq (mimicking unpaired reads) I bet you'll get reads in your un file (you can try this on a small sample of reads). In fact, just try a single end alignment example, and see if your command works. I would try it on the command line (not as a python command), and once you get a result, see if you can reproduce it as a python command.

ADD REPLY
0
Entering edit mode

Thanks, worked

ADD REPLY

Login before adding your answer.

Traffic: 1508 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6