pub struct HgvsVariant {
pub reference: Option<ReferenceSpec>,
pub coordinate_system: CoordinateSystem,
pub description: VariantDescription,
}Expand description
A parsed HGVS variant.
This is the root model returned by crate::parse_hgvs. It keeps the
reference, coordinate system, and biological description together.
§Examples
use tinyhgvs::{CoordinateSystem, VariantDescription, parse_hgvs};
let variant = parse_hgvs("NM_007373.4:c.-1C>T").unwrap();
assert_eq!(variant.coordinate_system, CoordinateSystem::CodingDna);
match variant.description {
VariantDescription::Nucleotide(description) => {
assert_eq!(description.location.start.coordinate, -1);
}
VariantDescription::Protein(_) => unreachable!("expected nucleotide variant"),
}Fields§
§reference: Option<ReferenceSpec>Reference sequence metadata such as NM_004006.2. Optional for
shorthand protein variants such as p.Gly2_Met46del.
coordinate_system: CoordinateSystemHGVS coordinate type such as c, g, r, or p.
description: VariantDescriptionParsed variant description for nucleotide or protein syntax.
Trait Implementations§
Source§impl Clone for HgvsVariant
impl Clone for HgvsVariant
Source§fn clone(&self) -> HgvsVariant
fn clone(&self) -> HgvsVariant
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HgvsVariant
impl Debug for HgvsVariant
Source§impl PartialEq for HgvsVariant
impl PartialEq for HgvsVariant
impl Eq for HgvsVariant
impl StructuralPartialEq for HgvsVariant
Auto Trait Implementations§
impl Freeze for HgvsVariant
impl RefUnwindSafe for HgvsVariant
impl Send for HgvsVariant
impl Sync for HgvsVariant
impl Unpin for HgvsVariant
impl UnsafeUnpin for HgvsVariant
impl UnwindSafe for HgvsVariant
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more