-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BR: Invalid file header in BAM index #58
Comments
can you share the commands used to create the merged and sorted BAM file and the commands for the index file? |
Hi Evan I think I figured it out. If I rename my index file as "base.bam.bai" and run the command I mentioned earlier, it will provide the output. These are biological replicates and I wanted to run it individually so didn't merge. Here are the commands I was running to create sorted BAM file. Remove Duplicates: Samtools sort: Samtools index |
Sounds like ensuring the file is suffixed with .bam.bai is required for the BAM file reader i use. I'll add that to the user guide so other users don't run into the same problem. |
Hi Evan It looks like the bug is fixed for my local machine (ubuntu release 18.04, openjdk 11.0.7) but not that redhat server I mentioned in my first bug report. I'm testing the identical file with same command so I'm not sure what's going on. |
Hi @tahia and @EvanTarbell I also used Picard to remove the duplicated. and samtools to remove genes from the mitochondrial chromosome. I have tried creating fresh index, also again sorting the file. |
For others facing the same problem, if you are making the index file using multithreading, try making the index without multithreading. |
Check out #84 where @pratarora found that making the .bai index file with the multithreading option in samtools could cause this error |
Hi there
I'm running HMMRATAC_V1.2.10_exe.jar to call peak for ATAC data. I have 4 replicates so I merged, sorted and indexed bam file and then went to call peak by HMMRATAC.
This is a redhat-release-server-7.8-2.el7.x86_64 and I'm running openjdk version "11.0.7" 2020-04-14 LTS.
Here is the command I'm running:
java -Xmx12G -jar /path/to/HMMRATAC/HMMRATAC_V1.2.10_exe.jar -b /path/to/bam/file/C_F_sorted.bam -i /path/to/bam/file/C_F_sorted.bai -g path/to/genInfo/genome.info -o /path/to/output/C_F 1> logs/C_F.log
I'm getting the following error:
Exception in thread "main" java.lang.RuntimeException: Invalid file header in BAM index /home/taslima/Data/PH/ATACSEQ_EXP/ATACSEQ/REFHAL/RHAL_Merge/C_F_sorted.bai: ^_^D
at net.sf.samtools.AbstractBAMFileIndex.(AbstractBAMFileIndex.java:90)
at net.sf.samtools.DiskBasedBAMFileIndex.(DiskBasedBAMFileIndex.java:46)
at net.sf.samtools.BAMFileReader.getIndex(BAMFileReader.java:232)
at net.sf.samtools.BAMFileReader.createIndexIterator(BAMFileReader.java:592)
at net.sf.samtools.BAMFileReader.query(BAMFileReader.java:352)
at net.sf.samtools.SAMFileReader.query(SAMFileReader.java:363)
at HMMR_ATAC.pullLargeLengths.read(pullLargeLengths.java:112)
at HMMR_ATAC.pullLargeLengths.(pullLargeLengths.java:61)
at HMMR_ATAC.Main_HMMR_Driver.main(Main_HMMR_Driver.java:219)
Any idea why I'm getting this error?
Thanks!
The text was updated successfully, but these errors were encountered: