Can't convert multiple SAMs from SRA to BAMs
0
0
Entering edit mode
21 months ago
gernophil ▴ 80

Hey everyone, I am trying to download some SAM files from SRA and pipe them into samtools view. However, with three files I get an error:

sam-dump was killed (signal 9 SIGKILL)
[E::sam_parse1] SEQ and QUAL are of different length
[W::sam_read1_sam] Parse error at line 9647365
samtools view: error reading file "-": Inappropriate ioctl for device

Is there something wrong with the files or is my command wrong?

(sam-dump [Accession] | samtools view -b -o [Accession].bam) &> [Accession].log
samtools sam-dump SRA • 1.4k views
ADD COMMENT
1
Entering edit mode

seems like a problem with the data file itself. if you provide the accession number others could try to verify your issue

ADD REPLY
0
Entering edit mode

Hey there, one accession number would be: SRR5134861

ADD REPLY
1
Entering edit mode
$ sam-dump SRR5134861 | samtools view -o test.bam -

Make sure you are using a reasonably latest version of samtools.

ADD REPLY
0
Entering edit mode

I am using samtools 1.15.1. Still running into this error.

@GenoMax: Did you execute the command above? What's the - at the end of your command? You left out the -b flag. Is that automatically detected when defining a bam output file?

ADD REPLY
0
Entering edit mode

Yes the output format is automatically detected by samtools based on file name extension. - at the end of the command is for input coming from the piped output of sam-dump. I used the same version of samtools.

ADD REPLY
0
Entering edit mode

That's weird. I am gonna try your syntax next week, when I'm back. Even though I don't see, why it should make a difference. Didn't know the - syntax for piping, so thanks for that :). The weird thing is, that it works with most files, but it consistently fails on three files. I am running this on a slurm cluster. Maybe this is the problem here.

ADD REPLY

Login before adding your answer.

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