Error With Samtools
2
0
Entering edit mode
12.4 years ago
Sameet ▴ 300

I recently tried to use bowtie2 and samtools to process some paired end data. I used bowtie2-build to index my reference genome, and used this index to align the paired end data. Once the alignment was over, i got the following on my STDOUT:

7659592 reads; of these:
    7659592 (100.00%) were paired; of these:
    136410 (1.78%) aligned concordantly 0 times
    6927190 (90.44%) aligned concordantly exactly 1 time
    595992 (7.78%) aligned concordantly >1 times
98.22% overall alignment rate

With this message, i assumed that the alignment is complete. I had used the -S option to obtain sam output file. So i tried to use samtools to sort and index the output file, but every time i get EOF not found error.

Please advise. Sameet

samtools bowtie2 • 3.5k views
ADD COMMENT
3
Entering edit mode
12.4 years ago

samtools sort works on .bam files, not .sam files, that might be your problem.

ADD COMMENT
0
Entering edit mode

Actually, when i try to convert the sam file to a bam file, i still get the same error.

ADD REPLY
0
Entering edit mode

Have you used the -S flag on samtools, too? You have to tell samtools that you are using sam-files, too, like this:

samtools view -S bla.sam

or

samtools view -Sb in.sam out to convert to a bam-file called out.bam

ADD REPLY
0
Entering edit mode

Hi, thanks for the post. I figured it out. Its correct, the samtools requires a bam file!! I managed to get what i wanted. Thank you all for your help.

ADD REPLY
1
Entering edit mode
12.4 years ago
Bilby ▴ 20

If your sam file has no SQ header you'll need to create a reference index in samtools first with: samtools faidx <refgenome.fa>

ADD COMMENT

Login before adding your answer.

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