Question: SAM line does not contain at least 11 tab-delimited fields
1
gravatar for Kritika
2.6 years ago by
Kritika250
India
Kritika250 wrote:

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 sam bam htseq • 2.8k views
ADD COMMENTlink modified 2.5 years ago • written 2.6 years ago by Kritika250
1

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

ADD REPLYlink written 2.6 years ago by Michael Dondrup44k

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

ADD REPLYlink written 2.6 years ago by Kritika250
1

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 REPLYlink modified 2.6 years ago by Istvan Albert ♦♦ 77k • written 2.6 years ago by Kritika250
1

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 REPLYlink modified 2.5 years ago • written 2.6 years ago by Matt Shirley8.6k

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

ADD REPLYlink written 2.6 years ago by Devon Ryan84k

How have you created 1A_sorted.bam?

ADD REPLYlink written 2.6 years ago by dschika290

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

ADD REPLYlink written 2.5 years ago by Kritika250

What mapping tool did you use?

ADD REPLYlink written 2.6 years ago by David Langenberger8.2k

i used Bowtie2........

ADD REPLYlink written 2.5 years ago by Kritika250
0
gravatar for Kritika
2.5 years ago by
Kritika250
India
Kritika250 wrote:

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 COMMENTlink written 2.5 years ago by Kritika250
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: 1539 users visited in the last hour