pub struct NcbiContigEntry {
pub sequence_name: String,
pub length: u64,
pub genbank_accn: Option<String>,
pub refseq_accn: Option<String>,
pub ucsc_name: Option<String>,
pub role: Option<String>,
pub assigned_molecule: Option<String>,
pub patch_type: Option<PatchType>,
}Expand description
A parsed contig from an NCBI assembly report with all naming variants
Fields§
§sequence_name: StringPrimary sequence name (from Sequence-Name column)
length: u64Sequence length
genbank_accn: Option<String>GenBank accession
refseq_accn: Option<String>RefSeq accession
ucsc_name: Option<String>UCSC-style name
role: Option<String>Sequence role (e.g., “assembled-molecule”, “unlocalized-scaffold”)
assigned_molecule: Option<String>Assigned molecule (chromosome number, e.g., “1”, “X”, “Y”, “MT”)
patch_type: Option<PatchType>Patch type if this is a patch contig
Implementations§
Source§impl NcbiContigEntry
impl NcbiContigEntry
Sourcepub fn all_names_with_options(&self, generate_ucsc_names: bool) -> Vec<String>
pub fn all_names_with_options(&self, generate_ucsc_names: bool) -> Vec<String>
Get all unique, non-empty names for this contig as aliases.
§Arguments
generate_ucsc_names- Iftrueand this is a patch contig without a UCSC-style name in the assembly report, generate one using the UCSC naming convention. This is useful for assembly reports prior to p13 where patch UCSC names were not included.
§UCSC Name Generation
When generate_ucsc_names is true and:
- This contig is a fix-patch or novel-patch (determined from sequence role)
- The UCSC-style-name column is “na” or missing
- The
GenBankaccession and assigned molecule are available
Then a UCSC-style name will be generated following the convention:
chr{chromosome}_{accession}v{version}_{suffix}
Where suffix is _fix for fix-patches and _alt for novel-patches.
§Sources
- UCSC FAQ: https://genome.ucsc.edu/FAQ/FAQdownloads.html
- UCSC Patches blog: https://genome-blog.soe.ucsc.edu/blog/2019/02/22/patches/
- Verified against: https://hgdownload.soe.ucsc.edu/goldenPath/hg38/bigZips/p12/
Sourcepub fn to_contig(&self) -> Contig
pub fn to_contig(&self) -> Contig
Convert to a Contig with aliases populated.
This is equivalent to calling to_contig_with_options(true) - UCSC name
generation is enabled by default.
Sourcepub fn to_contig_with_options(&self, generate_ucsc_names: bool) -> Contig
pub fn to_contig_with_options(&self, generate_ucsc_names: bool) -> Contig
Convert to a Contig with aliases populated.
§Arguments
generate_ucsc_names- Iftrue, generate UCSC-style names for patches that don’t have them in the assembly report. SeeSelf::all_names_with_optionsfor details on the naming convention.
Trait Implementations§
Source§impl Clone for NcbiContigEntry
impl Clone for NcbiContigEntry
Source§fn clone(&self) -> NcbiContigEntry
fn clone(&self) -> NcbiContigEntry
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more