#[non_exhaustive]pub struct Contig {
pub name: String,
pub length: u64,
pub md5: Option<String>,
pub sha512t24u: Option<String>,
pub assembly: Option<String>,
pub uri: Option<String>,
pub species: Option<String>,
pub aliases: Vec<String>,
pub sequence_role: SequenceRole,
}Expand description
A single contig/sequence in a reference genome
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringSequence name (SN tag in SAM)
length: u64Sequence length (LN tag in SAM)
md5: Option<String>MD5 checksum of the sequence (M5 tag in SAM) Lowercase hex, 32 characters
sha512t24u: Option<String>GA4GH sha512t24u digest (SHA-512, truncate to 24 bytes, base64url no-pad) 32-character string, used for refget/seqcol compatibility
assembly: Option<String>Assembly identifier (AS tag in SAM)
uri: Option<String>URI where sequence can be retrieved (UR tag in SAM)
species: Option<String>Species (SP tag in SAM)
aliases: Vec<String>Known alternative names for this contig
sequence_role: SequenceRoleSequence role from NCBI assembly report
Implementations§
Source§impl Contig
impl Contig
pub fn new(name: impl Into<String>, length: u64) -> Self
Sourcepub fn is_primary_chromosome(&self) -> bool
pub fn is_primary_chromosome(&self) -> bool
Check if this contig is a primary chromosome (1-22, X, Y) Matches both UCSC (chr1) and NCBI (1) naming conventions exactly
Sourcepub fn is_mitochondrial(&self) -> bool
pub fn is_mitochondrial(&self) -> bool
Check if this is a mitochondrial contig Matches common mitochondrial names from various reference builds
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Contig
impl<'de> Deserialize<'de> for Contig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Contig
impl StructuralPartialEq for Contig
Auto Trait Implementations§
impl Freeze for Contig
impl RefUnwindSafe for Contig
impl Send for Contig
impl Sync for Contig
impl Unpin for Contig
impl UnsafeUnpin for Contig
impl UnwindSafe for Contig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.