pub struct FastaImporter { /* private fields */ }Expand description
Imports FASTA records and emits SBOL 3 Documents.
FastaImporter::new takes the namespace IRI that the resulting
SBOL 3 top-level objects will be rooted under — typically the
owning lab or repository (e.g. https://example.org/lab).
Component identities are derived as {namespace}/{record-id}.
By default, the alphabet of each record is detected automatically
from the sequence text. Call FastaImporter::with_alphabet to
override that detection when the data is ambiguous.
Implementations§
Source§impl FastaImporter
impl FastaImporter
Sourcepub fn new(namespace: impl AsRef<str>) -> Result<Self, ImportError>
pub fn new(namespace: impl AsRef<str>) -> Result<Self, ImportError>
Builds a new importer scoped to the supplied namespace IRI.
Sourcepub fn with_alphabet(self, alphabet: Alphabet) -> Self
pub fn with_alphabet(self, alphabet: Alphabet) -> Self
Skips alphabet detection and forces every record to be
imported as the supplied Alphabet.
Sourcepub fn read<R: Read>(
&self,
reader: R,
) -> Result<(Document, ImportReport), ImportError>
pub fn read<R: Read>( &self, reader: R, ) -> Result<(Document, ImportReport), ImportError>
Reads every record from the supplied reader and returns one
SBOL 3 Document containing the emitted Components +
Sequences plus an ImportReport tallying what was produced.
Sourcepub fn read_str(
&self,
input: &str,
) -> Result<(Document, ImportReport), ImportError>
pub fn read_str( &self, input: &str, ) -> Result<(Document, ImportReport), ImportError>
Reads from a string slice.
Sourcepub fn read_path(
&self,
path: impl AsRef<Path>,
) -> Result<(Document, ImportReport), ImportError>
pub fn read_path( &self, path: impl AsRef<Path>, ) -> Result<(Document, ImportReport), ImportError>
Reads from a file on disk (.fasta / .fa / .fna / .faa
— the importer doesn’t actually care about the extension).
Trait Implementations§
Source§impl Clone for FastaImporter
impl Clone for FastaImporter
Source§fn clone(&self) -> FastaImporter
fn clone(&self) -> FastaImporter
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more