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
            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
          • seqadmin
            Strategies for Sequencing Challenging Samples
            by seqadmin


            Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
            03-22-2024, 06:39 AM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by seqadmin, 04-11-2024, 12:08 PM
          0 responses
          31 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 04-10-2024, 10:19 PM
          0 responses
          32 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 04-10-2024, 09:21 AM
          0 responses
          28 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 04-04-2024, 09:00 AM
          0 responses
          53 views
          0 likes
          Last Post seqadmin  
          Working...
          X