From 86f5ac57b2775e09c92f56e77ccf2c3304280a69 Mon Sep 17 00:00:00 2001 From: Gert Hulselmans Date: Tue, 12 Nov 2024 18:37:03 +0100 Subject: [PATCH] Trow error if `scatac_from_fragments split` can't write to fragments files. Trow error if `scatac_from_fragments split` can't write to fragments files, by updating rust_htslib as both `rust_htslib::bgzf:Reader` and `rust_htslib::bgzf:Writer` did not check if it could open a file successfully. https://github.com/rust-bio/rust-htslib/pull/444 This now print a traceback instead of silently failing: Processing contig "chr1" thread '' panicked at src/split_fragments.rs:56:37: Could not open file "/tmp/sample1/cellA.fragments.tsv.gz" for writing note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace Traceback (most recent call last): File "/software/anaconda3/envs/pycistopic/bin/scatac_fragment_tools", line 8, in sys.exit(main()) ^^^^^^ File "/software/scatac_fragment_tools/src/scatac_fragment_tools/cli/main.py", line 317, in main args.func(args) File "/software/scatac_fragment_tools/src/scatac_fragment_tools/cli/commands.py", line 186, in command_split_fragments_by_cell_type split_fragment_files_by_cell_type( File "/software/scatac_fragment_tools/src/scatac_fragment_tools/library/split/split_fragments_by_cell_type.py", line 79, in split_fragment_files_by_cell_type joblib.Parallel(n_jobs=n_cpu)( File "/software/anaconda3/envs/pycistopic/lib/python3.11/site-packages/joblib/parallel.py", line 1918, in __call__ return output if self.return_generator else list(output) ^^^^^^^^^^^^ File "/software/anaconda3/envs/pycistopic/lib/python3.11/site-packages/joblib/parallel.py", line 1847, in _get_sequential_output res = func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ pyo3_runtime.PanicException: Could not open file "/tmp/sample1/cellA.fragments.tsv.gz" for writing --- rust/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 8edd795..bfcc6d6 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "_rust_scatac_fragment_tools" -version = "0.1.2" +version = "0.1.3" authors = ["Seppe De Winter ", "Gert Hulselmans "] edition = "2021" @@ -15,6 +15,6 @@ itertools = "0.13.0" pyo3 = { version = "0.22.1", features = ["abi3-py38", "extension-module"] } [target.'cfg(not(all(target_os = "linux", target_arch = "powerpc64")))'.dependencies] -rust-htslib = { version = "0.47.0", default-features = false, features = ["libdeflate"] } +rust-htslib = { version = "0.48.0", default-features = false, features = ["libdeflate"] } [target.'cfg(all(target_os = "linux", target_arch = "powerpc64"))'.dependencies] -rust-htslib = { version = "0.47.0", default-features = false } +rust-htslib = { version = "0.48.0", default-features = false }