This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Why does GATK thinks directory is BAM index file?

Hi, I'm writing a Galaxy wrapper for the GATK BaseRecalibrator tool and I'm running into this error where GATK thinks the directory of the BAM file is the index file for the BAM. I'm running gatk BuildBamIndex -I input.bam --OUTPUT input.bai before gatk BaseRecalibrator -I input.bam -R fasta.fa --known-sites known_sites.vcf.gz -O "$output1" but the terminal outputs the warning

WARNING: BAM index file /home/ubuntu/galaxy/database/jobs_directory/000/482/working is older than BAM /home/ubuntu/galaxy/database/jobs_directory/000/482/working/input.bam

What should I do?

gatk galaxy

Odd. Can you just try gatk BuildBamIndex -I input.bam. That is all you need. The output file name will be automatically made.

Oh this is galaxy so I guess you are not actually running this on command line?

I'm running it on a local galaxy server, so I have access to the command line. I've tried using gatk BuildBamIndex and samtools index index on the input.bam, but gatk seems to think the file's directory is the index file. Is there a way to specify where the index file is for gatk?

1 answer

Oh, I discovered the issue. I had included the --read-index command followed by a blank string which caused GATK to infer the working folder as the bam index file. Thanks for your help!

Log in to answer this question.