Crates.io | hgvs |
lib.rs | hgvs |
version | 0.16.1 |
source | src |
created_at | 2023-03-03 10:55:40.546014 |
updated_at | 2024-06-10 14:53:32.751558 |
description | Port of biocommons/hgvs to Rust |
homepage | https://github.com/varfish-org/hgvs-rs |
repository | |
max_upload_size | |
id | 799668 |
size | 6,062,209 |
This is a port of biocommons/hgvs to the Rust programming language.
The data::cdot::*
code is based on a port of SACGF/cdot to Rust.
The tests need an instance of UTA to run.
Either you setup a local copy (with minimal dataset in tests/data/data/*.pgd.gz
) or use the public one.
You will have to set the environment variables TEST_UTA_DATABASE_URL
and TEST_UTA_DATABASE_SCHEMA
appropriately.
To use the public database:
export TEST_UTA_DATABASE_URL=postgres://anonymous:anonymous@uta.biocommons.org:/uta
export TEST_UTA_DATABASE_SCHEMA=uta_20210129
Note that seqrepo-rs is used for access to the genome contig sequence.
It is inconvenient to provide sub sets of sequences in SeqRepo format.
Instead, we use a build-cache/read-cache approach that is also used by biocommons/hgvs
.
To build the cache, you will first need a download of the seqrepo as described in biocommons/biocommons.seqrepo Quickstart.
Then, you configure the running of tests for hgvs-rs
as follows:
export TEST_SEQREPO_CACHE_MODE=write
export TEST_SEQREPO_PATH=path/to/seqrepo/instance
export TEST_SEQREPO_CACHE_PATH=tests/data/seqrepo_cache.fasta
When running the tests with cargo test
, the cache file will be (re-)written.
Note that you have to use cargo test --release -- --test-threads 1 --include-ignored
when writing the cache for enforcing a single test writing to the cache at any time.
If you don't want to regenerate the cache then you can use the following settings.
With these settings, the cache will only be read.
export TEST_SEQREPO_CACHE_MODE=read
export TEST_SEQREPO_CACHE_PATH=tests/data/seqrepo_cache.fasta
After either this, you can run the tests.
cargo test
The script tests/data/data/bootstrap.sh
allows to easily build a reduced set of the UTA database given a list of genes.
The process is as follows:
bootstrap.sh
to include the HGNC gene symbols of the transcripts that you want to use.$ bootstrap.sh http://dl.biocommons.org/uta uta_20210129
The *.pgd.gz
file is added to the Git repository via git-lfs
and in CI, this minimal database will be used.
(I don't want to call it "benchmarks" yet.)
Host:
Single Running Time Results (no repetitions/warm start etc.)
This includes loading and deserialization of the records only.