however the resulting file is not a real alignment!
dear all,
it is possible to use bowtie2 to align fasta files rather than fastq? essentially I would like to use bowtie just like an aligner such as muscle, taking advantage of the greater computational speed of the former. In the handbooks I found that this is possible but there is no example.
I created a reference sequence ref_idx with bowties2-build; if input.fa is the file i want to align, what would be the syntax? I wrote:
bowtie2 -q -x ref_idx -U input.fa -S output_aln
but I got the error: Error: reads file does not look like a FASTQ file terminate called after throwing an instance of 'int' Aborted (core dumped) (ERR): bowtie2-align exited with value 134
If this is possible, would bowtie work also with multifasta files?
thank you
1 answer
Sorry, that was a silly question. the problem was in the input file: the option -q stands for fastq files; -f is for fasta and multifasta. Using
bowtie2 -f -x ref_idx -U input.fa -S output_aln
resulted in the alignment. Case closed.
Case back open.
Use bbmap.sh from BBMap suite.
bbmap.sh in=your.fa out=align.sam ref=ref.fa any_other_options
thank you! this was a fast alternative to bowtie. the problem is how to convert the sam file to an aligned fasta. I ran:
bbmap.sh in=your.fa out=align.sam ref=ref.fa
samtools view -Sb align.sam > align.bam
samtools sort align.bam align_srt
samtools index align_srt.bam
samtools bam2fq align_srt.bam | seqtk seq -A > align.fa
and I obtained an empty file. same thing when using align.bam and align.bam.bai. I am missing something...
Log in to answer this question.
First:
Then,
And finally load the bam final in IGV to visualize it (after load your fasta reference)
thank you! it is possible to convert the file back into fasta directly? I tried with
but i got: [bam_header_read] EOF marker is absent. The input is probably truncated. [bam_header_read] invalid BAM binary header (this is not a BAM file). and an empty file. With:
I also got and empty file.
how to I provide index file?