SAM line does not contain at least 11 tab-delimited fields
1
1
Entering edit mode
8.7 years ago
Kritika ▴ 270

I am not understanding what this error means i tried this command too but its showing me same error

samtools view -bf 1 1A_sorted.bam > 1A_Sorted.bam

Error occured when reading beginning of SAM/BAM file. ('SAM line does not contain at least 11 tab-delimited fields.', 'line 1 of file 1A_Sorted.bam') [Exception type: ValueError, raised in _HTSeq.pyx:1276]

samtools view 1A_sorted.bam | head

HWI-D00574:89:C6ABRANXX:2:1101:7450:50398   133 gi|448814763|ref|NC_000962.3|   1   0   *   =   1   0   CAACAACGGTTGTAGCTCGACCCGGAACCAAGACCCGGAACTAACGAGAACCAGGCAGATACGTCGTTGACCGATGACCCCGGTTCAGGCTTCACCACAGT   B3A?AGB//=/CFDFG11=/E/E9///<CFB:FGGB///<B<1DDGB//91:1000>/0<::0<CB/E00@C9/:C#########################   YT:Z:UP
HWI-D00574:89:C6ABRANXX:2:1102:3006:26295   133 gi|448814763|ref|NC_000962.3|   1   0   *   =   1   0   GGAACCAAGACCCGGAACTAACGAGAACCAGGGAGATACGTCGTTGACCGATGACCCCGGTTCAGGCTTCACCACAGTGTGGAACGCGGTCGTCTCCGAAC   BBBBBGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGBGGGGGG   YT:Z:UP
HWI-D00574:89:C6ABRANXX:2:1102:12755:32164  163 gi|448814763|ref|NC_000962.3|   1   0   2M13I86M    =   1   -97 GGGAGATACGTCGTTGACCGATGACCCCGGTTCAGGCTTCACCACAGTGTGGAACGCGGTCGTCTCCGAACTTAACGGCGACCCTAAGGTTGACGACGGAC   CCCCCGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGCGGGGGGGGGGGBCCCGG   AS:i:-54    XN:i:0  XM:i:2  XO:i:1  XG:i:13 NM:i:15 MD:Z:0T0T86 YS:i:-32YT:Z:CP
HWI-D00574:89:C6ABRANXX:2:1102:1302:32973   163 gi|448814763|ref|NC_000962.3|   1   23  2M13I86M    =   19  119 GGGAGATACGTCGTTGACCGATGACCCCGGTTCAGGCTTCACCACAGTGTGGAACGCGGTCGTCTCCGAACTTAACGGCGACCCTAAGGTTGACGACGGAC   B@BBB>G>DGDGGGGGFGGD<EGGGGG9CGGGGGGGGGGGGGGGGGGGGGGGD>GGGGG>CGGGGGGEDG<FGECGGGGGG;CGGGEDGGGB=ED68CDC:   AS:i:-54    XN:i:0  XM:i:2  XO:i:1  XG:i:13 NM:i:15 MD:Z:0T0T86 YS:i:-3YT:Z:CP
HWI-D00574:89:C6ABRANXX:2:1102:6812:34459   133 gi|448814763|ref|NC_000962.3|   1   0   *   =   1   0   CAACGGTTGTAGCTCGACCCGGAACCAAGACCCGGAACTAACGAGAACCAGGGAGATACGTCGTTGACCGATGACCCCGGTTCAGGCTTCACCACAGTGTG   ABBBCGGGGGGGGGGGGGGGGGGGGFGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGDGBGGGGGGGGGGGGGGGGGGGGGGGGGGGG   YT:Z:UP
HWI-D00574:89:C6ABRANXX:2:1102:16322:88949  133 gi|448814763|ref|NC_000962.3|   1   0   *   =   1   0   CAACAACGGTTGTAGCTCGACCCGGAACCAAGACCCGGAACTAACGAGAACCAGGGAGATACGTCGTTGACCGATGACCCCGGTTCAGGCTTCACCACAGT   BBCCCGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGC   YT:Z:UP
RNA-Seq HTseq bam sam • 6.3k views
ADD COMMENT
1
Entering edit mode

This doesn't look like SAM/BAM format to me.

ADD REPLY
0
Entering edit mode

this is what i got after sorting and indexing the .bam file

ADD REPLY
1
Entering edit mode

this error solved:

Error occured when reading beginning of SAM/BAM file. ('SAM line does not contain at least 11 tab-delimited fields.', 'line 1 of file 1A_Sorted.bam') [Exception type: ValueError, raised in _HTSeq.pyx:1276]

i tried installing

sudo apt-get install python python-setuptools python-pip python-matplotlib cython zlib1g-dev  
sudo pip install biopython
sudo pip install pysam

Then

htseq-count -f bam -t exon -i transcript_id   -o  1A_htseq.sam  1A_sorted.bam Mycobacterium_tuberculosis_h37rv.GCA_000195955.2.29.gtf > htseq_1_file

however still there is some problem because my htseq_1_file is of 0 byte. Nothing reported inside that file. It is full blank.

ADD REPLY
1
Entering edit mode

I'm also going to chime in and say this is a SAM format file that has been corrupted in a deeply confusing way. How was this file generated?

EDIT It looks like you've changed your example and now this looks like a SAM file. Glad you got this AHEM: ...sorted out :)

ADD REPLY
0
Entering edit mode

At some point thing got corrupted, you might have to remake 1A_sorted.bam.

ADD REPLY
0
Entering edit mode

How have you created 1A_sorted.bam?

ADD REPLY
0
Entering edit mode

using command samtools sort 1A.bam 1A_sorted.bam

ADD REPLY
0
Entering edit mode

What mapping tool did you use?

ADD REPLY
0
Entering edit mode

i used Bowtie2........

ADD REPLY
0
Entering edit mode
8.7 years ago
Kritika ▴ 270

actually my htseq file was showing 0 from above htseq-count command.. but then i changed my chromosome name in GTF file and kept it same which is reported in sam file so now i got correct count in htseq file

ADD COMMENT

Login before adding your answer.

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