Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • HTSeq.BAM_Reader error: .bam-file has no index ...

    I'm running into a problem with HTSeq that I can't seem to solve on my own:

    As running through the entire bam file to find alignments corresponding to a genomic position (from a gtf file) works, but takes a long time, I'm trying to use the indexed random access approach. Code is identical (except filenames and window postitions) to the docs tutorial for HTSeq, and my input file is a coordinate-sorted bam file with index file of the same name (but with .bai extension of course) in same folder as sorted bam file. Bam file was sorted with Picard Tools if that matters. After attempting to run the code below, I get the following error:

    sortedbam = \
    HTSeq.BAM_Reader("729_GCCAAT_L007_R1_001_trimmed.sorted.bam")
    for alnmt in sortedbam[ window ]:
    print alnmt

    ERROR: ValueError: The .bam-file has no index, random-access is disabled!

    The index filename is 729_GCCAAT_L007_R1_001_trimmed.sorted.bai

    I'm stumped.

    For what it's worth, htseq_count and dexseq_count both work fine (obviously fewer chances to screw something up passing arguments to a script but I wanted to mention it).

  • #2
    Try renaming the index to 729_GCCAAT_L007_R1_001_trimmed.sorted.bam.bai

    Comment


    • #3
      Worked beautifully, thank you.

      Any idea why that filename format is assumed? Is there a standard for naming bam index files?

      Comment


      • #4
        Well, if you just
        Code:
        samtools index blah.bam
        then the index file will be automatically named "blah.bam.bai". Generally, whatever samtools does is the standard

        Comment


        • #5
          Fair enough. Thanks again for your help.

          Comment

          Latest Articles

          Collapse

          • seqadmin
            Recent Advances in Sequencing Technologies
            by seqadmin







            Innovations in next-generation sequencing technologies and techniques are driving more precise and comprehensive exploration of complex biological systems. Current advancements include improved accessibility for long-read sequencing and significant progress in single-cell and 3D genomics. This article explores some of the most impactful developments in the field over the past year.

            Long-Read Sequencing
            Long-read sequencing has...
            12-02-2024, 01:49 PM
          • seqadmin
            Genetic Variation in Immunogenetics and Antibody Diversity
            by seqadmin



            The field of immunogenetics explores how genetic variations influence immune responses and susceptibility to disease. In a recent SEQanswers webinar, Oscar Rodriguez, Ph.D., Postdoctoral Researcher at the University of Louisville, and Ruben Martínez Barricarte, Ph.D., Assistant Professor of Medicine at Vanderbilt University, shared recent advancements in immunogenetics. This article discusses their research on genetic variation in antibody loci, antibody production processes,...
            11-06-2024, 07:24 PM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by seqadmin, 12-02-2024, 09:29 AM
          0 responses
          138 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 12-02-2024, 09:06 AM
          0 responses
          48 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 12-02-2024, 08:03 AM
          0 responses
          38 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 11-22-2024, 07:36 AM
          0 responses
          69 views
          0 likes
          Last Post seqadmin  
          Working...
          X