19 releases

new 0.2.4 Dec 12, 2024
0.2.3 Dec 12, 2024
0.2.2 Oct 9, 2024
0.2.0 Aug 27, 2024
0.1.10 Jul 25, 2024

#161 in Biology

Download history 206/week @ 2024-08-21 53/week @ 2024-08-28 15/week @ 2024-09-11 3/week @ 2024-09-18 25/week @ 2024-09-25 152/week @ 2024-10-02 181/week @ 2024-10-09 7/week @ 2024-10-16 1/week @ 2024-10-30 3/week @ 2024-11-06 19/week @ 2024-11-27 190/week @ 2024-12-04

209 downloads per month

Custom license

3MB
7.5K SLoC

Tests

grumpy

Re-implementation of gumpy in Rust for speed

Installation

Rust crate

cargo add grumpy

Python package

pip install bio-grumpy

Tests

Running Rust unit tests

cargo test

Coverage

Test coverage can be found with the use of tarpaulin.

# Install tarpaulin on first run
cargo install cargo-tarpaulin

# Generate an HTML coverage report
cargo tarpaulin --no-dead-code --engine llvm --out html

lib.rs:

Grumpy, genetic analysis in Rust.

This library provides a set of tools for genetic analysis, including:

  • Genome representation
  • Gene representation
  • VCF file parsing
  • Finding effects of a given VCF file at both genome and gene levels

Example

use grumpy::genome::{Genome, mutate};
use grumpy::vcf::VCFFile;
use grumpy::difference::{GenomeDifference, GeneDifference};
use grumpy::common::MinorType;

let mut reference = Genome::new("reference/MN908947.3.gb");
let vcf = VCFFile::new("test/dummy.vcf".to_string(), false, 3);
let mut sample = mutate(&reference, vcf);

let genome_diff = GenomeDifference::new(reference.clone(), sample.clone(), MinorType::COV);
for variant in genome_diff.variants.iter(){
   println!("{}", variant.variant);
}

for gene_name in sample.genes_with_mutations.clone().iter(){
  let gene_diff = GeneDifference::new(reference.get_gene(gene_name.clone()), sample.get_gene(gene_name.clone()), MinorType::COV);
  for mutation in gene_diff.mutations.iter(){
    println!("{}", mutation.mutation);
  }
}

Also provides an interface to this library as a Python module using PyO3. pip install bio-grumpy

Dependencies

~6–12MB
~151K SLoC