Question: SAM line does not contain at least 11 tab-delimited fields
1
gravatar for GirKir1424
22 months ago by
GirKir142480
India
GirKir142480 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.0k views
ADD COMMENTlink modified 22 months ago • written 22 months ago by GirKir142480
1

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

ADD REPLYlink written 22 months ago by Michael Dondrup43k

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

ADD REPLYlink written 22 months ago by GirKir142480
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 22 months ago by Istvan Albert ♦♦ 75k • written 22 months ago by GirKir142480
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 22 months ago • written 22 months ago by Matt Shirley8.1k

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

ADD REPLYlink written 22 months ago by Devon Ryan74k

How have you created 1A_sorted.bam?

ADD REPLYlink written 22 months ago by dschika280

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

ADD REPLYlink written 22 months ago by GirKir142480

What mapping tool did you use?

ADD REPLYlink written 22 months ago by David Langenberger8.0k

i used Bowtie2........

ADD REPLYlink written 22 months ago by GirKir142480
0
gravatar for GirKir1424
22 months ago by
GirKir142480
India
GirKir142480 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 22 months ago by GirKir142480
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: 1402 users visited in the last hour