pub struct ReferenceBuilder { /* private fields */ }Expand description
Builder that collates metadata from multiple input sources
Implementations§
Source§impl ReferenceBuilder
impl ReferenceBuilder
Sourcepub fn new(id: impl Into<String>, display_name: impl Into<String>) -> Self
pub fn new(id: impl Into<String>, display_name: impl Into<String>) -> Self
Create a new builder with required fields
Sourcepub fn generate_ucsc_names(self, generate: bool) -> Self
pub fn generate_ucsc_names(self, generate: bool) -> Self
Configure whether to generate UCSC-style names for patches.
When true (default), for fix-patches and novel-patches that have “na” in the
UCSC-style-name column of NCBI assembly reports, a UCSC-style name will be
generated using the convention: chr{chromosome}_{accession}v{version}_{suffix}
where suffix is _fix for fix-patches or _alt for novel-patches.
Set to false to disable this behavior (opt-out) and only use names explicitly
present in the assembly report.
§Example
use ref_solver::catalog::builder::ReferenceBuilder;
// Opt-out of UCSC name generation
let builder = ReferenceBuilder::new("my_ref", "My Reference")
.generate_ucsc_names(false);pub fn assembly(self, assembly: Assembly) -> Self
pub fn source(self, source: ReferenceSource) -> Self
pub fn description(self, description: impl Into<String>) -> Self
pub fn download_url(self, url: impl Into<String>) -> Self
pub fn assembly_report_url(self, url: impl Into<String>) -> Self
Sourcepub fn add_input(&mut self, path: &Path) -> Result<(), BuilderError>
pub fn add_input(&mut self, path: &Path) -> Result<(), BuilderError>
Add an input file (auto-detect format)
§Errors
Returns BuilderError::Parse if format cannot be detected, or other
errors from parsing the specific format.
Sourcepub fn add_input_with_format(
&mut self,
path: &Path,
format: InputFormat,
) -> Result<(), BuilderError>
pub fn add_input_with_format( &mut self, path: &Path, format: InputFormat, ) -> Result<(), BuilderError>
Add an input file with explicit format
§Errors
Returns BuilderError::Io if the file cannot be read, BuilderError::Parse
if parsing fails, or BuilderError::Conflict if contig data conflicts.
Sourcepub fn build(self) -> Result<KnownReference, BuilderError>
pub fn build(self) -> Result<KnownReference, BuilderError>
Build the final KnownReference
§Errors
Returns BuilderError::MissingField if no contigs were added or required
fields are missing.
Sourcepub fn summary(&self) -> BuildSummary
pub fn summary(&self) -> BuildSummary
Get summary of build