I'm running this command with Bowtie2:
bowtie2 --threads 20 --no-unal -x /Path/to/Indexed/Genome/file.fna -q -k 1 --al file.fastq -U -b --align-paired-reads input.bam | samtools view -b -o output.bam
I'm getting this error message:
Error: Encountered internal Bowtie 2 exception (#1) Command: ALL My COMAND --passthrough -U -b (ERR): bowtie2-align exited with value 1
I think, the problem is that I need to use a unique input file (with paired reads inside from a previous alignment). This file is in BAM format. Reading Bowtie2 manual I found :
Reads are unaligned BAM records sorted by read name
Bowtie 2 will, by default, attempt to align unpaired BAM reads. Use this option to align paired-end reads instead.
I've read about this problem, it's related to my bowtie version? Mine is bowtie2-2.2.5.
Maybe I should try with another alignment tool? STAR ?
Thank you in advance.
PS: I've tried to run it with .SAM file (as the input) by doing:
bowtie2 --threads 20 --no-unal -x //Path/to/Indexed/Genome/file.fna -q -k 1 --al file.fastq -S no_aligned_COLL4_parasite.sam | samtools view -b -o outfile.bam
I think the problem is that you are using both -b and -U. Also, file should be next to the parameter, just like:
Also, take into account that bowtie should only be used for genomic reads and not from RNA-seq. For RNA, use either STAR or HISAT2.
Thank you so much.
I have been reading STAR manual but I donde find any function where you can use an input with an aligned read BAM file.
Maybe STAR does not have that option?
Also make a note of what you wrote above. BAM file needs to contain "unaligned" reads. You have an aligned BAM file.
Best option may be to recover fastq reads from your aligned BAM and then use them for alignment.
Thanks. I didn't know that we can recover fastq reads from an aligned BAM file. Is there any specific program for that?
samtools collate(to name sort the BAM).
samtools fastq(can be done in one pipe).
reformat.shfrom BBMap suite. (check in-line help)
Look for threads here about conversion of BAM to fastq.
Could you please explain me what's the point of using
I've read it is used for any file format conversion but , in in my case,
samtoolscreate a fastq file as an output and
bamtofastqfrom BEDtools uses this format.
I'm missing something, sor sure.
Could you please indicate why I need to use
You don't need to use
reformat.sh. It was one of the three options for doing the conversion.
I've tried with
samtools collatebut it stars to create files as name.bam.001.bam (until number 63) and then stop printing a lot of random numbers and letter.
I used then
and after that tried to run BEDtools:
Although the output files (fastq) star to being created I get thousand of error messages as :
I understand the file is not sorted by name properly, so if I used those .fastq files there won't be all the reads I should have , right?
If you were able to sort the file using
samtoolsthen you could have used
samtools fastqto do the conversion.
I mentioned three ways of doing the conversion.
refotmat.shfrom BBMap and
bedtools. They are all independent.
A potential way of using
reformat.shwith name sorted BAM would be
reformat.sh -Xmx10g in=name.sort.bam out1=R1.fq.gz out2=R2.fq.gz pairedonly=t primaryonly=t.
samtools collate | samtools fastqshould have worked as well.