Skip to content

refactor: rewrite in Rust for performance#20

Open
adthrasher wants to merge 11 commits into
stjude:masterfrom
adthrasher:refactor/rust
Open

refactor: rewrite in Rust for performance#20
adthrasher wants to merge 11 commits into
stjude:masterfrom
adthrasher:refactor/rust

Conversation

@adthrasher

Copy link
Copy Markdown
Member

This is an initial implementation in Rust. When running a sample through, I get a perfect match for the downstream subset of GFF features.

% diff samplematrix-downstream.txt test/samplematrix-downstream.txt && echo $?
0

When looking at the genebody, there are some differences, but at least some are due to the original Python implementation being flawed (See #83 and #84 for examples).

Ultimately, there are some ugly Rust pieces in this, trying to perfectly match the output formatting from Python. These can be improved. We can also drop any of the non-matrix functionality, since that isn't used in SEAseq/PEAseq. The biggest takeaway is that this runs in less than 10 minutes for each feature type, whereas the corresponding Python implementation took 2-20 hours depending on the feature type.

I have included the outputs from the bamtogff_plot task using the Python matrices and the Rust matrices for comparison.

python.tar.gz
rust.tar.gz

@adthrasher adthrasher self-assigned this Nov 7, 2025
@adthrasher adthrasher requested a review from abrahamb2 November 7, 2025 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant