Crates.io | spdi |
lib.rs | spdi |
version | 0.1.3 |
source | src |
created_at | 2024-02-04 22:29:51.145901 |
updated_at | 2024-02-05 02:45:12.710932 |
description | SPDI is a format to describe a genomic variant. This crate provides a library to get an SPDI format representation of a variant and a command-line utility which adds SPDI format output to an input VCF file. |
homepage | https://github.com/rkimoakbioinformatics/spdi |
repository | https://github.com/rkimoakbioinformatics/spdi |
max_upload_size | |
id | 1126709 |
size | 69,795 |
SPDI is a Rust library and a command-line utility for getting the SPDI-format representation of genomic variants.
git clone git@github.com:rkimoakbioinformatics/spdi.git
cd spdi
cargo build --release
# Add SPDI representation as OV_SPDI_IDS field in INFO of a VCF file.
./target/release/spdi -t <2bit file path> -f <VCF file path> 1>out.vcf 2>err.txt
# Get SPDI representation of a single variant.
./target/release/spdi -t <2bit file path> -v chr1:99092:C:CT
To add:
cargo add spdi
cargo add anyhow
To use:
use anyhow::Result;
fn example() -> Result<String> {
let s = spdi::SPDI::new("path/to/2bit/file")?;
let spdi_string = s.get_spdi_string("chr1", 99092, "C", "CT")?;
println!("{}", spdi_string);
}