Crate grumpy

source ·
Expand description

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};
 
let reference = Genome::new("some/path/to/a/genbank/file.gb");
let vcf = VCFFile::new("some/path/to/a/vcf/file.vcf", false, 3);
let sample = mutate(&reference, vcf);
 
let genome_diff = GenomeDifference::new(reference, sample);
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()));
  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

Modules§

  • Module of common structs and enums used throughout the program
  • Module for handling differences between genomes and genes
  • Module for handling gene data
  • Module for handling genome data
  • Module for handling VCF files