I am trying to align a bacterial genome with a reference genome using bowtie2 in ubuntu OS.
The bacterial genome is sequenced using Ion torrent. The paired-end sequenced data of the bacterial genome is in fastq format in a single file (bacterial_genome.fastq).
And the commands I used to align the sequence with the reference genome (genome.fasta) using bowtie2 are
bowtie2 -x genome_index -U bacterial_genome.fastq
bowtie2 -x genome_index --interleaved bacterial_genome.fastq
But none of the commands give me a proper alignment output in bam format. Please suggest a way for the alignment of ion torrent data using bowtie2.
Update:
When I used bowtie2 to build the genome_index, it build the genome_index with the following mentioned line
Total time for backward call to driver() for mirror index: 00:00:02
When I used bowtie2 -x genome_index --interleaved bacterial_genome.fastq
It give this error:
Command: /usr/bin/bowtie2-align-s --wrapper basic-0 -x genome_index --interleaved bacterial_genome.fastq
(ERR): bowtie2-align exited with value 1
When I used bowtie2 -x genome_index -U bacterial_genome.fastq
It generates a bam file and when I process the bam file to sort it using samtools, it shows the following error
[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).
Segmentation fault (core dumped)
The command I used for samtools is samtools sort bacterial_genome.bam sorted_bacterial_genome
I'm just thinking about it and your update helps me.
You used
bowtie2 -x genome_index -U bacterial_genome.fastq
The default output of bowtie2 is not a .BAM file it's a .SAM file
Try to
samtools view -bS bacterial_genome.sam > bacterial_genome.bam
Then
samtools sort bacterial_genome.bam sorted_bacterial_genome
It's not very commun to use Ion Torrent technology to generate paired-end data, did you do a mate-pair sequencing ?
Could you share the command you used to generate the index please ?
To generate index i used, bowtie2-build genome.fasta genome_index. Yes, I think its a mate pair sequencing data.
What was the output of the
bowtie2-build genome.fasta genome_index
? Did it end successfully ?What was the output (in your terminal) of your command
bowtie2 -x genome_index --interleaved bacterial_genome.fastq
?What do you mean by :
You mean that you don't have a bam file or the bam file seems weird to you ?
@Bastein, I have updated the post now, to make it more clear, Do i need specific ion torrent mapper to map this genome?
You didn't specify the output :
Can you post output of
head -12 your_sequence_file
?This is bacterial_genome.fastq
That looks like normal ion sequence to me. Are you sure it is paired-end? There is only one file, correct?
Yes, but I am not sure if the data is paired end. But if its a normal ion torrent sequence, how do i use bowtie2 to map it with my reference genome?
I would just treat it as single end if you are not sure.
Instead of bowtie2 you could try minimap2. This data is bound to have indels etc and you should use an aligner that can tolerate errors.
Thanks this is helpful...