-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Mosdepth fails when run with less than 8GB RAM on ~50MB CRAM #245
Comments
It should require only ~ 1GB of memory, perhaps 2. Do you see the same memory use if you remove --by and --thresholds ? |
Hi @brentp, I did some tests and this is the median mosdepth physical memory usage:
So there is a difference, but both values are way outside the 1-2GB range. Any thoughts? I'm not familiar with Greetings, |
When running mosdepth on a ~280mb BAM file (hg38) using a ~2gb When running mosdepth, the "Max mem used" slowly builds up to that and then stops increasing (perhaps when being done with chromosome 1). Considering whether I should chunk the bed file to reduce the RAM usage? Might increase running time to have multiple calls though. Note that I am using a fork of mosdepth, but I don't think I've changed anything relevant to RAM usage in the standard usecase. |
that sounds excessive! can you verify that mosdepth from the releases here has the same memory usage? |
@brentp I just installed mosdepth via bioconda into a new environment. It uses the same amount of RAM, unfortunately. The files are available online as part of a preprint, so it should be easy for you to reproduce: The BED file is available here: https://zenodo.org/records/14215762 The test BAM file is available here: https://zenodo.org/records/13909979 Something like the following: $ mosdepth --by whole_genome.mappable.binned_10bp.bed.gz --threads 1 --mapq 20 --min-frag-len 100 --max-frag-len 220 --no-per-base <OUTPUT_PATH> IC38.hg38.downsampled.aligned.sorted.markdup.bam |
ok. just a quick point--does |
Something on that scale, yes! Would I need to be sure I always have the same 10bp intervals, as I use a lot of other reference information for the same bins. But if that behavior is stable, I could perhaps recompute everything to use the mosdepth bins. Would be a lot of work but if it heavily reduces memory usage, it could be the best approach. |
yes, |
Perfect, thanks! It spent 5min and < 4gb, compared to 15min and 42gb. That would probably be worth rerunning everything for! |
phew! glad to hear it! I am surprised that the bed file is so bad. I am looking into it. |
Great! I'm lucky all intervals are 10bp, but of course it would be great to have similar performance for bed files, if possible :-) |
Hi @brentp,
Mosdepth is using more memory than expected when ran with a .bed file on a ~50MB .cram file:
We are running mosdepth 0.3.8 using a singularity apptainer image build from
docker://quay.io/biocontainers/mosdepth:0.3.8--hd299d5a_0
I was expecting mosdepth to be able to run with much less memory based on the numbers reported in README and your comment in #161 (comment). Running with 16GB resolves the issue.
Data to reproduce the issue:
https://download.molgeniscloud.org/downloads/vip/_dev/github/mosdepth/
https://download.molgeniscloud.org/downloads/vip/resources/GRCh38/GCA_000001405.15_GRCh38_no_alt_analysis_set.fna.gz
https://download.molgeniscloud.org/downloads/vip/images/mosdepth-0.3.8.sif
Is this the behavior that you would expect?
Best regards,
@dennishendriksen
The text was updated successfully, but these errors were encountered: