Question: Error With Samtools
0
gravatar for Sameet
7.0 years ago by
Sameet290
Sameet290 wrote:

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

bowtie2 samtools • 2.4k views
ADD COMMENTlink modified 5.8 years ago by Biostar ♦♦ 20 • written 7.0 years ago by Sameet290
3
gravatar for swbarnes2
7.0 years ago by
swbarnes26.0k
United States
swbarnes26.0k wrote:

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

ADD COMMENTlink written 7.0 years ago by swbarnes26.0k

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

ADD REPLYlink written 7.0 years ago by Sameet290

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 REPLYlink written 7.0 years ago by Philipp Bayer6.3k

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 REPLYlink written 7.0 years ago by Sameet290
1
gravatar for Bilby
7.0 years ago by
Bilby10
Austria
Bilby10 wrote:

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 COMMENTlink written 7.0 years ago by Bilby10
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: 601 users visited in the last hour