kaizhang / SnapATAC2

Single-cell epigenomics analysis tools
https://kzhang.org/SnapATAC2/
217 stars 23 forks source link

macs3 function not works with multiple dataset #332

Open uqnsarke opened 2 weeks ago

uqnsarke commented 2 weeks ago

data = snap.read_dataset("combined.h5ads") data

AnnDataSet object with n_obs x n_vars = 277377 x 526765 backed at 'combined.h5ads'

obs: 'sample', 'leiden' var: 'count', 'selected' uns: 'spectral_eigenvalue', 'AnnDataSet', 'reference_sequences' obsm: 'X_spectral_mnn', 'X_spectral', 'X_spectral_harmony', 'X_umap' obsp: 'distances'

%%time snap.tl.macs3(data, groupby='leiden', replicate='sample')

2024-09-01 21:26:50 - INFO - Exporting fragments... thread 'thread 'thread '' panicked at src/call_peaks.rs:384' panicked at :src/call_peaks.rs73: :called Result::unwrap() on an Err value: Custom { kind: Other, error: "Allocation error : not enough memory" }384 :' panicked at note: run with RUST_BACKTRACE=1 environment variable to display a backtrace 73: src/call_peaks.rscalled Result::unwrap() on an Err value: Custom { kind: Other, error: "Allocation error : not enough memory" }: 384:73:

uqnsarke commented 1 week ago

2024-09-02 15:41:03 - INFO - Exporting fragments... thread '' panicked at src/call_peaks.rs:384:73: called Result::unwrap() on an Err value: Custom { kind: Other, error: "Allocation error : not enough memory" } note: run with RUST_BACKTRACE=1 environment variable to display a backtrace thread '' panicked at src/call_peaks.rs:384:73: called Result::unwrap() on an Err value: Custom { kind: Other, error: "Allocation error : not enough memory" } thread '' panicked at src/call_peaks.rs:384:73: called Result::unwrap() on an Err value: Custom { kind: Other, error: "Allocation error : not enough memory" } thread '' panicked at src/call_peaks.rs:384:73: called Result::unwrap() on an Err value: Custom { kind: Other, error: "Allocation error : not enough memory" } thread '' panicked at src/call_peaks.rs:384:73: called Result::unwrap() on an Err value: Custom { kind: Other, error: "Allocation error : not enough memory" } thread '' panicked at src/call_peaks.rs:384:73: thread 'called Result::unwrap() on an Err value: Custom { kind: Other, error: "Allocation error : not enough memory" } ' panicked at src/call_peaks.rs:384:73: called Result::unwrap() on an Err value: Custom { kind: Other, error: "Allocation error : not enough memory" } Traceback (most recent call last): File "/data/sarkern2/multiome_liver/scanpy/snapatac/complete2/processed_data/sbatch_02/complete.py", line 11, in snap.tl.macs3(data, groupby='leiden', replicate='sample') File "/data/sarkern2/conda/envs/snap2/lib/python3.10/site-packages/snapatac2/tools/_call_peaks.py", line 138, in macs3 fragments = _snapatac2.export_tags(adata, tmpdirname, groupby, replicate, max_frag_size, selections) pyo3_runtime.PanicException: called Result::unwrap() on an Err value: Custom { kind: Other, error: "Allocation error : not enough memory" }

kaizhang commented 1 week ago

Try to find a computer with more memory OR set n_jobs=1 to reduce memory usage.