Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • umnklang
    Member
    • Oct 2011
    • 16

    Bacterial RNA-Seq - Problem Counting Reads with htseq

    I'm having problems utilizing htseq.

    I have a sam file of paired end illumina reads. These have been sorted by the read name (1st column). Here are the first few lines of data:


    HWI-ST261:3960D48ABXX:4:1101:10002:96209 147 gi|237809907|ref|NC_012692.1| 30581 255 79M = 30446 -214 AGGCCCCCAGCGTCATGCAGGCGCTCTCCGCCTACCGCGATGGCGCGCGCATCCATGCCGGCACGCGACCGGGCGCACC #####################################?C<562'93>>6BFHBA<@B=A7(:A@@@IIGHFDHHDDD XA:i:0 MD:Z:1T4G4T3G9G0C0T51 NM:i:7
    HWI-ST261:3960D48ABXX:4:1101:10002:96209 99 gi|237809907|ref|NC_012692.1| 30446 255 79M = 30581 214 AGCAGCCGGCGCTTTACTGGCACTTCAGGAACAAGCGGGCGCTGCTCGACGCACTGGCCGAAGCCATGCTGGGGGAGAA FFHGHHHHGHHJJHIIIIIJJJIIIJJIFIIIGIJ@@EHF?8=@85:<0:<BD@59AADB################### XA:i:0 MD:Z:72C6 NM:i:1
    HWI-ST261:3960D48ABXX:4:1101:10007:167767 163 gi|237809907|ref|NC_012692.1| 115957 255 79M = 116090 212 ACTGGTCCAGAACCTTGACCGAACGCAGCGGTGGTAACGGCGCAGTGGCGGTTTTCATGGCTTTTTTTTTTCTGTTTTT FFHHHHHJJJGIJJJJIGIIIJJJJJGJJJJFHGHGGHHHFDDDDDCDDDD00;B######################## XA:i:0 MD:Z:63G2A1G0A0C0T0G0T5 NM:i:8
    HWI-ST261:3960D48ABXX:4:1101:10007:167767 83 gi|237809907|ref|NC_012692.1| 116090 255 79M = 115957 -212 ATGTTTGATGTTATGGAGCAGCAACGATGTTACGCAGCAGGGCAGTCGCCCTAAAACAAAGTTAGACATCATGAGGGTA DDDDDDDDDDDDDDDDDDDDDEDDFFFFFHHHJJJJJJJJJJJJJJJJJIJJJJJJJJJIHJJJHIGJJJJIHHHHHFF XA:i:0 MD:Z:79 NM:i:0
    HWI-ST261:3960D48ABXX:4:1101:10013:104772 163 gi|237809907|ref|NC_012692.1| 119786 255 79M = 119940 233 TCGAAGACGCCCTGCATGCCACCCGTGCGGCGGTCGAGGAAGGCATCGTCCCGGGCGGCGGGGCCGCCCCGGTCCGTGC FFHGHFHGIIIIIGIADFHHJJJJIAGIIIHDD?B6-9:&8<@??9?@DA@D&077;@##################### XA:i:0 MD:Z:61C1T5T1A7 NM:i:4
    HWI-ST261:3960D48ABXX:4:1101:10013:104772 83 gi|237809907|ref|NC_012692.1| 119940 255 79M = 119786 -233 GAAAGCCCCGCGCCGCGAGTTCGCCCCCAACGCCGGCGACGAGCCGAGCGTGGTGCTGAACCGCGTCGCCGAAGGCACC ########################################B<@@;>;BCCDDB?@@BEA<IHBEHHHGIGJIFHFADFF XA:i:0 MD:Z:1G9T0G6A3T1A53 NM:i:6

    Next I have a GTF file. Here the first few lines:

    ##gff-version 3
    #!gff-spec-version 1.20
    #!processor NCBI annotwriter
    ##sequence-region NC_012692.1 1 166530
    ##species http://www.ncbi.nlm.nih.gov/Taxonomy...tax.cgi?id=562
    NC_012692.1 RefSeq region 1 166530 . + . ID=id0;Dbxref=taxon:562;Is_circular=true;gbkey=Src;genome=plasmid;mol_type=genomic DNA;plasmid-name=pAR060302;strain=AR060302
    NC_012692.1 RefSeq gene 323 862 . + . ID=gene0;Name=pAR060302_0001;Dbxref=GeneID:7872685;gbkey=Gene;locus_tag=pAR060302_0001
    NC_012692.1 RefSeq CDS 323 862 . + 0 ID=cds0;Name=YP_002894347.1;Parent=gene0;Note=identified by Glimmer 2%3B sequence similarity to pSN254_0002%3B blastp_match %3D ZP_01176338.1;Dbxref=Genbank:YP_002894347.1,GeneID:7872685;gbkey=CDS;product=hypothetical protein;protein_id=YP_002894347.1;transl_table=11
    NC_012692.1 RefSeq gene 867 1154 . + . ID=gene1;Name=pAR060302_0002;Dbxref=GeneID:7872573;gbkey=Gene;locus_tag=pAR060302_0002
    NC_012692.1 RefSeq CDS 867 1154 . + 0 ID=cds1;Name=YP_002894348.1;Parent=gene1;Note=identified by Glimmer 2%3B sequence similarity to pSN254_0002%3B blastp_match %3D ZP_01176339.1;Dbxref=Genbank:YP_002894348.1,GeneID:7872573;gbkey=CDS;product=hypothetical protein;protein_id=YP_002894348.1;transl_table=11
    NC_012692.1 RefSeq gene 1139 2239 . + . ID=gene2;Name=repA;Dbxref=GeneID:7872574;gbkey=Gene;gene=repA;locus_tag=pAR060302_0003
    NC_012692.1 RefSeq CDS 1139 2239 . + 0 ID=cds2;Name=YP_002894349.1;Parent=gene2;Note=identified by Glimmer 2%3B sequence similarity to pSN254_0003%3B blastp_match %3D ZP_01176340.1;Dbxref=Genbank:YP_002894349.1,GeneID:7872574;gbkey=CDS;product=plasmid replication protein RepA;protein_id=YP_002894349.1;transl_table=11

    What I want to do is count the reads that align to the CDS and return a file with the GeneID and the number of reads that align to it so that I can use these in subsequent edgeR analyses.

    The command I run is

    -m HTSeq.scripts.count -m intersection-nonempty -t CDS -s no -i Dbxref pAR_sorted.sam NC_012692.gff > test.txt

    in my output I get no reads aligning to any CDS

    no_feature 49397
    ambiguous 0
    too_low_aQual 0
    not_aligned 0
    alignment_not_unique 0


    However I know that this cannot be true - I have viewed this data on IGV and there are many many reads aligned to the CDS

    Any thoughts?
  • kopi-o
    Senior Member
    • Feb 2008
    • 319

    #2
    I have run HTSeq successfully on similar GFF files with the options

    -i locus_tag -t Gene

    I wonder if it is the Dbxref that is messing up things for you, but I am not sure. You could try to use "Gene" and "locus_tag" or "Name" instead.

    Comment

    • umnklang
      Member
      • Oct 2011
      • 16

      #3
      I've found the answer.

      In my sam file the reference (3 column) the accession was given as gi|237809907|ref|NC_012692.1|.

      But my gff file it was simply NC_012692.1. A simple find (NC_012692.1) replace (gi|237809907|ref|NC_012692.1|) in my gff file is all I needed.

      Comment

      • JUANPABLOROSAS5
        Junior Member
        • Oct 2013
        • 1

        #4
        Thanks!!!! great detail

        Comment

        Latest Articles

        Collapse

        • SEQadmin2
          Nine Things a Sample Prep Scientist Thinks About Before Sequencing
          by SEQadmin2


          I’m not a sequencing expert. I’m a purification scientist who uses NGS to evaluate workflows my group develops. With this perspective, we think about the sample first and the NGS workflow second. The sequencer is an exceptionally honest reporter, but it can only report on what you give it, so whether you get clean, interpretable data from an NGS workflow is largely determined before you begin.


          Here are nine questions we think about, in roughly the order they matter, before...
          06-18-2026, 07:11 AM
        • SEQadmin2
          From Collection to Sequencing: Why Sample Preparation and Preservation Define Sequencing Data
          by SEQadmin2


          Data variability is still an issue in sequencing technologies despite the advances in reproducibility and accuracy of these platforms. But the problem does not originate in the sequencing itself, but in the previous steps, before the sample reaches the sequencer.


          The first step is collection, followed by preservation and sample preparation for analysis. Most scientists overlook those steps, but not being careful might just be skewing the experiment’s results.
          ...
          06-02-2026, 10:05 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by SEQadmin2, 06-17-2026, 06:09 AM
        0 responses
        30 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 06-09-2026, 11:58 AM
        0 responses
        44 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 06-05-2026, 10:09 AM
        0 responses
        50 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 06-04-2026, 08:59 AM
        0 responses
        51 views
        0 reactions
        Last Post SEQadmin2  
        Working...