Skip to content
/ jean Public

Computational biology utility library for Rust featuring sequence alignment, genome annotation, and I/O of biological files

License

Notifications You must be signed in to change notification settings

dangreco/jean

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jean

jean is a computational biology library written in Rust. It offers computational biology primitives such as sequences (DNA, RNA, and Protein), bases, amino acids, and codons. Optional features extend the abilities of jean, such as io which allows for reading/writing from/to common biological file formats (e.g. FASTA, GFF3) and alignment which allows for aligning sequences.

Getting Started

Add jean and any needed features to your Rust project:

$ cargo add jean # --features io,...

Feature Matrix

Feature Use Links
io I/O of common biological file formats (e.g. FASTA, GFF3) (Documentation)
macros Macros for creating sequences (Documentation)
alignment Sequence alignment tools (Documentation)
blosum BLOSUM substitution matrices (Documentation)

Examples

DNA Sequence Alignment

#[macro_use]
extern crate jean;

use jean::{alignment::global::NeedlemanWunsch, blosum::NUC_4_2, dna::Dna};

fn main() -> Result<(), Box<dyn std::error::Error>> {
  let seq1: Dna = dna!("AGACTAGTTAC");
  let seq2: Dna = dna!("CGAGACGT");

  let alignment = NeedlemanWunsch::new()
    .matrix(&NUC_4_2)
    .gap_penalty(|k| -2 * k)
    .align(&seq1, &seq2)?;

  assert_eq!(alignment.score, 16);
  assert_eq!(alignment.a, dna!("--AGACTAGTTAC"));
  assert_eq!(alignment.b, dna!("CGAGAC--G-T--"));

  Ok(())
}

DNA -> RNA -> Protein

#[macro_use]
extern crate jean;

use jean::{cut::Cut, dna::Dna, prelude::*, protein::Protein, rna::Rna};

fn main() -> Result<(), Box<dyn std::error::Error>> {
  let cut = Cut::read_file("homo_sapien.cut")?;

  /* DNA -> RNA -> Protein */
  let d: Dna = dna!("AGGCTGGGCACC");
  let r: Rna = d.transcribe();
  let p: Protein = r.translate(&cut);

  assert_eq!(p, protein!("RLGT"));

  /* ...and back again */
  let r_ = p.rev_translate(&cut);
  let d_ = r_.rev_transcribe();

  assert_eq!(d, d_);

  Ok(())
}

About

Computational biology utility library for Rust featuring sequence alignment, genome annotation, and I/O of biological files

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published