Error with Bowtie 2
0
1
Entering edit mode
6.9 years ago
valerie ▴ 100

Hi guys,

I am working with exomes from TCGA which are bam files. I am converting bam to fastq using SamToFastq by Picard and then realign the reads back to reference genome using another reference, not like in original bam files. With one file I get an error from Bowtie2:

Error, fewer reads in file specified with -2 than in file specified with -1

However Bowtie2 doesn't fall, it goes on running forever. Does anybody know how to solve this issue? I do not get such an error for other files I worked with from TCGA. I suppose that these unpaired reads should be simply ignored by Bowtie2.

Thanks in advance!

bowtie2 alignment • 4.0k views
ADD COMMENT
1
Entering edit mode

It seems R1 and R2 fastq files have different number of reads. Run fastqc or wc -l or zcat | wc -l to get number of reads for each file.

How were your picard and bowtie commands lines?

ADD REPLY
0
Entering edit mode

That's true, I see that the files have slightly different sizes. My script:

~/data/samtools-1.3.1/samtools sort -@ 64 -n filename.bam -o ~/data/tcga_results/filename_sorted.bam
java -jar ~/data/picard.jar SamToFastq I=~/data/tcga_results/filename_sorted.bam F=~/data/tcga_results/filename_R1.fastq 
F2=~/data/tcga_results/filename_R2.fastq
bowtie2 -x ~/data/Homo_sapiens/UCSC/hg38/Sequence/Bowtie2Index/genome -p 64 -1 ~/data/tcga_results/filename_R1.fastq 
-2 ~/data/tcga_results/filename_R2.fastq -S ~/data/tcga_results/filename_reassembled.sam
ADD REPLY
3
Entering edit mode

Use repair.sh from BBMap suite to re-sync the files before remapping them.

ADD REPLY
0
Entering edit mode

This worked! Thank you again!

ADD REPLY
3
Entering edit mode

Try fixing your unpaired fastq files with BBTools:

repair.sh in1=r1.fq.gz in2=r2.fq.gz out1=fixed1.fq.gz out2=fixed2.fq.gz outsingle=singletons.fq.gz

I don't use much Picard, but there may be some magic flag to output properly paired fastq files.

ADD REPLY
0
Entering edit mode

This worked! Thank you!

ADD REPLY
0
Entering edit mode

It worked fine thank you. the reads were not matching that's the problem

ADD REPLY

Login before adding your answer.

Traffic: 2842 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