Question: Error with Bowtie 2
1
gravatar for valerie
23 months ago by
valerie60
valerie60 wrote:

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!

alignment bowtie2 • 1.1k views
ADD COMMENTlink written 23 months ago by valerie60
1

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 REPLYlink written 23 months ago by h.mon25k

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 REPLYlink written 23 months ago by valerie60
2

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

ADD REPLYlink written 23 months ago by genomax67k

This worked! Thank you again!

ADD REPLYlink written 23 months ago by valerie60
2

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 REPLYlink written 23 months ago by h.mon25k

This worked! Thank you!

ADD REPLYlink written 23 months ago by valerie60
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1808 users visited in the last hour