Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • priya
    Member
    • Apr 2013
    • 57

    #1

    Problems with htseq-count reading bam file created by STAR

    Hi,

    Based on the STAR aligned bam files, I tried to generate the counts of RNA-seq data using htseq-count (version 0.5.1) tool by giving following command

    htseq-count -m intersection-nonempty input_bam_file gtf_file > Sample1_count.txt

    I am getting the following error

    Error occured when reading first line of sam file.
    Error: ('SAM line does not contain at least 11 tab-delimited fields.', 'line 1 of file input_bam_file')
    [Exception type: ValueError, raised in _HTSeq.pyx:1220]

    I am not certain if the problem is with STAR generated bam file or with htseq-count ?
    Any help is appreciated

    P.S: this is the STAR command given to create the bam file

    STAR --genomeDir genome_Dir/genome_mm10 --runThreadN 8 --readFilesIn sample_file --outFilterIntronMotifs RemoveNoncanonical --outSAMmode Full --outStd SAM | samtools view -bS - > Sample1.bam
  • chadn737
    Senior Member
    • Jan 2009
    • 392

    #2
    htseq-count needs a SAM file, not a BAM file. Try it again with a SAM file. This can be generated with:

    Code:
    samtools view -h -o output.sam input.bam

    Comment

    • priya
      Member
      • Apr 2013
      • 57

      #3
      Originally posted by chadn737 View Post
      htseq-count needs a SAM file, not a BAM file. Try it again with a SAM file. This can be generated with:

      Code:
      samtools view -h -o output.sam input.bam
      Thanks it worked..

      Comment

      • sdriscoll
        I like code
        • Sep 2009
        • 436

        #4
        Also to save time you can pipe that samtools conversion into htseq-count

        Code:
        samtools view <bam file> | htseq-count [options] - <gtf> > countsfile
        I forget if you need to write 'stdin' instead of the '-' for piped input. One of the two will work.
        /* Shawn Driscoll, Gene Expression Laboratory, Pfaff
        Salk Institute for Biological Studies, La Jolla, CA, USA */

        Comment

        Latest Articles

        Collapse

        • SEQadmin2
          Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
          by SEQadmin2



          Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

          Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
          ...
          10-14-2026, 09:55 AM
        • SEQadmin2
          New Genomics Technologies Take Aim at Long-Standing Limits
          by SEQadmin2


          Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

          We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
          ...
          09-28-2026, 10:25 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by SEQadmin2, Yesterday, 11:13 AM
        0 responses
        16 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, Yesterday, 10:48 AM
        0 responses
        16 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-15-2026, 10:52 AM
        0 responses
        35 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-14-2026, 05:39 AM
        0 responses
        42 views
        0 reactions
        Last Post SEQadmin2  
        Working...