extern crate jean_core; extern crate jean_io; use anyhow::Result; use jean_core::sequence::protein::Protein; use std::path::PathBuf; use jean_core::prelude::Transcribe; use jean_cut::cut::Cut; use jean_cut::prelude::*; #[test] pub fn test_1() -> Result<()> { let path = PathBuf::from("tests/homo_sapiens.cut"); let cut = Cut::read_file(&path)?; /* Protein -> RNA -> DNA */ let p = Protein::try_from("MRDTKQWDFIQAMLSVMRAMNLARILRKAIQAESEKEVGAHVNSLDFIEK").unwrap(); let r = p.rev_translate(&cut); let d = r.rev_transcribe(); assert_eq!(p.len() * 3, d.len()); /* DNA -> RNA -> Protein */ let r_ = d.transcribe(); let p_ = r_.translate(&cut); assert_eq!(p, p_); Ok(()) }