Open lbergelson opened 4 years ago
@orodeh I've opened this issue to track the issue you brought up. We will need to make a change to htsjdk first and then propagate it to picard/GATK. It might be tricky to expose it universally for picard tools since they don't all share a standard mechanism for opening bam files. It shouldn't be hard to wire itin GATK though.
@lbergelson Maybe this is a case where a system property / Defaults
value makes more sense?
Yeah, it might be. I always prefer to configure in code rather than using the system properties though, and since the other memory mapping options are options to the reader rather than system properties I thought it would make sense there.
In all seriousness, I think the best way is to have a Default
that configures the default behavior of the SamReadFactory
, but then also have API access to override that default. So for folks who are writing code it's easy to configure via API, and others who are e.g. just trying to run picard/gatk/whatever still have a way to control the behavior.
I think you're right.
If you don't actually need the mapping to be shared between several processes, then, it would be nice to make it PRIVATE by default.
We almost certainly don't need it shared between several processes.
Users who are using FUSE to access remote file systems are having trouble with the bam index memory mapping. I've been told that exposing the ability to specify the PRIVATE option when opening a memory mapped file will fix the problem:
This seems pretty easy to do in htsjdk. Wiring it all the the way to users might be a pain in some places though.