Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • efoss
    Member
    • Jul 2011
    • 98

    #1

    GATK complains that my bam file isn't indexed

    I am running GATK's RealignerTargetCreator with this command:

    java -Xmx36g -jar GenomeAnalysisTK.jar -S LENIENT -T RealignerTargetCreator -R human_g1k_v37.fasta -o SRR098359.interval_list -I SRR098359.bam -B:snps,VCF 00-All.vcf

    The process quits with an error that includes this:

    Cannot process the provided BAM file(s) because they were not indexed.

    However, the bam file WAS indexed. I see the .bai file there. I recreated the index with the following command (in case something had gone wrong creating it):

    samtools index SRR098359_sorted.bam

    It created an identical .bai file and I ran RealignerTargetCreator again, and the same thing happened. Does anyone know what I'm doing wrong?

    Thank you.

    Eric
  • cedance
    Senior Member
    • Feb 2011
    • 108

    #2
    With a quick glance of what they require, it seems you may require your bam file to be coordinate sorted (before .bai file creation). You should have a look at picard tools.

    Comment

    • efoss
      Member
      • Jul 2011
      • 98

      #3
      Originally posted by cedance View Post
      With a quick glance of what they require, it seems you may require your bam file to be coordinate sorted (before .bai file creation). You should have a look at picard tools.
      Hi cedance,

      Thanks for the suggestion, but I don't think this is my problem. My previous command coordinate-sorted them:

      java -jar /home/efoss/sequencing/picard-tools-1.52/SortSam.jar VALIDATION_STRINGENCY=LENIENT INPUT=SRR098359.bam OUTPUT=SRR098359_sorted.bam SORT_ORDER=coordinate

      Eric

      Comment

      • cedance
        Senior Member
        • Feb 2011
        • 108

        #4
        One last thing I could think of (the documentation says 1 or more aligned bam files as input). After you mapped with the software of your choice (the reads to your reference), did you obtain aligned reads alone? Maybe you should try using picard tools "ViewSam" with ALIGNMENT_STATUS=aligned to obtain the aligned reads from the bam file and then sort and index it. I would use picard tools for every operation instead of samtools. Sorry, I couldn't be of more help, but I guess this is worth a try.

        Comment

        • maubp
          Peter (Biopython etc)
          • Jul 2009
          • 1544

          #5
          Maybe a typo, but why are you not using the SRR098359_sorted.bam file when you call GATK? Your command says you are using the unsorted BAM file.

          Comment

          • efoss
            Member
            • Jul 2011
            • 98

            #6
            Hi maubp,

            THANK YOU, THANK YOU, THANK YOU!!!!!!!!! I stared at that so long without seeing my mistake. I feel very stupid, but also very grateful that you caught it.

            Best wishes,

            Eric

            Comment

            • maubp
              Peter (Biopython etc)
              • Jul 2009
              • 1544

              #7


              Happy to help.

              Comment

              • carolW
                Senior Member
                • Apr 2013
                • 103

                #8
                I get 2 different error messages when I run gatk

                If I use the output of picard markedduplicate, I get error message on unindexed bam file whereas the bam file is already indexed as it is already generated by picard samsort before invoking picard markedduplicate. bai file exist too.

                And if I use the output of picard sortsam directly, I get
                ERROR MESSAGE: Bad input: We encountered a non-standard non-IUPAC base in the provided reference: '10'

                What would you advise?

                Thanks,

                Carol
                -----------------------------------
                java -jar SortSam.jar SO=coordinate INPUT=~/NGS/data/SRR062641.filt.sam OUTPUT=~/NGS/data/SRR062641.filt.bam VALIDATION_STRINGENCY=LENIENT CREATE_INDEX=true

                - no error is generated

                ~/NGS/pgm/GenomeAnalysisTK-2.4-9-g532efad$ java -jar GenomeAnalysisTK.jar -T RealignerTargetCreator -R /home/carolw/NGS/hg19/Homo_sapiens/UCSC/hg19/Sequence/WholeGenomeFasta/genome.fa -o ~/NGS/data/SRR062641.filt.bam.list -I ~/NGS/data/SRR062641.filt.bam

                ERROR MESSAGE: Bad input: We encountered a non-standard non-IUPAC base in the provided reference: '10'

                -----------------------------------------------------------
                java -jar MarkDuplicates.jar INPUT=~/NGS/data/SRR062641.filt.bam OUTPUT=~/NGS/data/SRR062641.filt.marked.bam METRICS_FILE=metrics VALIDATION_STRINGENCY=LENIENT CREATE_INDEX=true

                - no error is generated

                java -jar GenomeAnalysisTK.jar -T RealignerTargetCreator -R /home/carolw/NGS/hg19/Homo_sapiens/UCSC/hg19/Sequence/WholeGenomeFasta/genome.fa -o ~/NGS/data/SRR062641.filt.bam.list -I ~/NGS/data/SRR062641.filt.marked.bam

                ERROR MESSAGE: Invalid command line: Cannot process the provided BAM file(s) because they were not indexed. The GATK does offer limited processing of unindexed BAMs in --unsafe mode, but this GATK feature is currently unsupported.

                Comment

                • efoss
                  Member
                  • Jul 2011
                  • 98

                  #9
                  Hi CarolW,

                  Sorry - I don't know what to suggest other than to look very carefully at the name of the index file compared to the name of the bam file.

                  Good luck.

                  Eric

                  Comment

                  • 1520191
                    Junior Member
                    • Apr 2014
                    • 3

                    #10
                    I used "samtools index bamfile" created a bam.bai file, then i ran again.it was successful. thanks a lot.

                    Comment

                    Latest Articles

                    Collapse

                    • SEQadmin2
                      Beyond CRISPR/Cas9: Understand, Choose, and Use the Right Genome Editing Tool
                      by SEQadmin2






                      CRISPR/Cas9 sparked the gene editing revolution for both research and therapeutics.1 But this system still showed severe issues that limited its applications. The most prominent were the heavy reliance on PAM sequences, delivery limitations, double-stranded breaks that prompt unintended edits and cell death, and editing inefficiency (both in targeting and in knock-in reliability).

                      Despite this, “CRISPR helped turn genome editing from a specialized
                      ...
                      07-31-2026, 11:01 AM
                    • SEQadmin2
                      Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
                      by SEQadmin2


                      Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

                      The systematic characterization of the human proteome has
                      ...
                      07-20-2026, 11:48 AM
                    • SEQadmin2
                      Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
                      by SEQadmin2



                      Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
                      ...
                      07-09-2026, 11:10 AM

                    ad_right_rmr

                    Collapse

                    News

                    Collapse

                    Topics Statistics Last Post
                    Started by SEQadmin2, 07-31-2026, 02:55 AM
                    0 responses
                    20 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 07-24-2026, 12:17 PM
                    0 responses
                    16 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 07-23-2026, 11:41 AM
                    0 responses
                    16 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 07-20-2026, 11:10 AM
                    0 responses
                    26 views
                    0 reactions
                    Last Post SEQadmin2  
                    Working...