spdi

Crates.iospdi
lib.rsspdi
version0.1.3
sourcesrc
created_at2024-02-04 22:29:51.145901
updated_at2024-02-05 02:45:12.710932
descriptionSPDI 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.
homepagehttps://github.com/rkimoakbioinformatics/spdi
repositoryhttps://github.com/rkimoakbioinformatics/spdi
max_upload_size
id1126709
size69,795
Ryangguk Kim (rkimoakbioinformatics)

documentation

README

SPDI is a Rust library and a command-line utility for getting the SPDI-format representation of genomic variants.

As a command-line utility

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

As a library

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);
}
Commit count: 0

cargo fmt