Skip to content
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: HMMRATAC doesn't run if samtools index made with multithreading #84

Open
pratarora opened this issue Mar 30, 2021 · 2 comments
Open

Comments

@pratarora
Copy link

Hi

I was using HMMRATAC with the instructions provided, however, I found that the following error:

Exception in thread "main" java.lang.RuntimeException: Invalid file header in BAM index

This error has also been reported in issue #58. I eventually found out that I was making the index file by using multithreading in samtools. If I make the index without multithreading, HMMRATAC starts to work then.

Hope this helps.

Best Regards
Prateek

@EvanTarbell
Copy link
Collaborator

Thanks @pratarora !! Great catch!

@jitsedesmet
Copy link

jitsedesmet commented May 30, 2022

In the referenced issue it says that an index was created using: samtools index -@ 4 -m 2G /path/C1-F_sorted.bam /path/C1-F_sorted.bai > logs/C1-F_index.log

It should be noted 2 arguments are passed, one is the multi threading argument @ but also -m is passed. The help page says the following:

Usage: samtools index [-bc] [-m INT] <in.bam> [out.index]
Options:
  -b       Generate BAI-format index for BAM files [default]
  -c       Generate CSI-format index for BAM files
  -m INT   Set minimum interval size for CSI indices to 2^INT [14]
  -@ INT   Sets the number of threads [none]

Note that -m can only be used for CSI files. However the command used generates a bai file.

I tried to run the code by changing the above commend to generate a CSI file and everything worked perfectly. (after adding support to CSI files as mentioned in #96)

What this means:
The problem is not in using the multi-threading tool but in using the -m option. This means this issue can be closed since it talks about improper use of samtools instead of an issue in HMMRATAC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants