-
Notifications
You must be signed in to change notification settings - Fork 79
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
fix: return error when bgzf_open fails to open a file #444
Merged
johanneskoester
merged 2 commits into
rust-bio:master
from
ghuls:handle_bgzf_open_failure
Nov 12, 2024
Merged
fix: return error when bgzf_open fails to open a file #444
johanneskoester
merged 2 commits into
rust-bio:master
from
ghuls:handle_bgzf_open_failure
Nov 12, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Before `rust_htslib::bgzf:Reader` and `rust_htslib::bgzf:Writer` would never fail when opening a file that could not be opened and it would allow writing to `rust_htslib::bgzf:Writer` without returning any error messages.
johanneskoester
approved these changes
Nov 12, 2024
Pull Request Test Coverage Report for Build 11799735471Details
💛 - Coveralls |
ghuls
added a commit
to aertslab/scatac_fragment_tools
that referenced
this pull request
Nov 12, 2024
…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. rust-bio/rust-htslib#444 This now print a traceback instead of silently failing: Processing contig "chr1" thread '<unnamed>' 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 <module> 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
ghuls
added a commit
to aertslab/scatac_fragment_tools
that referenced
this pull request
Nov 12, 2024
… files. Throw 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. rust-bio/rust-htslib#444 This now print a traceback instead of silently failing: Processing contig "chr1" thread '<unnamed>' 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 <module> 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
rust_htslib::bgzf:Reader
andrust_htslib::bgzf:Writer
would never fail when opening a file that could not be opened and it would allow writing torust_htslib::bgzf:Writer
without returning any error messages.