How to convert soap2 output to sam ?
2
0
Entering edit mode
5.9 years ago
pinn ▴ 210

Hi

how to convert soap2 output to SAM file. Their was perl script soap2sam.pl, is not working it generating a truncated SAM file. Is their a way to do it ?

Assembly genome • 1.9k views
ADD COMMENT
0
Entering edit mode

Share the exact commands

ADD REPLY
0
Entering edit mode

After generating the SRR2052405.soap I converted to sam using soap2sam.pl

1) soap2sam.pl SRR2052405.soap > SRR2052405.soap.sam

2) samtools view SRR2052405.soap.sam [E::sam_parse1] missing SAM header [W::sam_read1] Parse error at line 1 [main_samview] truncated file.

3) samtools view -u SRR2052405.soap.sam | samtools sort -@ 10 -T /tmp/SRR2052405.soap.sam.sort -o SRR2052405.soap.sort.bam [E::sam_parse1] missing SAM header [W::sam_read1] Parse error at line 1 [main_samview] truncated file.

ADD REPLY
1
Entering edit mode
5.9 years ago
goodez ▴ 640

It looks like soap2sam.pl is generating a SAM without the header. If you can obtain a reference fasta, then you can add the header using

samtools -bT reference.fa SRR2052405.soap.sam > SRR2052405.bam.

The -b option is what changes it to bam, so remove that if you need to stay in SAM for some reason.

If you can't use a reference fasta, then what do you need from this SAM file? Because you can still extract a lot of information from a headerless SAM file, without relying on samtools view.

ADD COMMENT
0
Entering edit mode
4.7 years ago
john.major • 0

The correct samtools command is: samtools view -b -T reference.fa SRR2052405.soap.sam > SRR2052405.bam.

ADD COMMENT

Login before adding your answer.

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