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
            Essential Discoveries and Tools in Epitranscriptomics
            by seqadmin


            The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist on Modified Bases...
            Yesterday, 07:01 AM
          • seqadmin
            Current Approaches to Protein Sequencing
            by seqadmin


            Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
            04-04-2024, 04:25 PM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by seqadmin, 04-11-2024, 12:08 PM
          0 responses
          39 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 04-10-2024, 10:19 PM
          0 responses
          41 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 04-10-2024, 09:21 AM
          0 responses
          35 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 04-04-2024, 09:00 AM
          0 responses
          55 views
          0 likes
          Last Post seqadmin  
          Working...
          X