Struct noodles_gtf::record::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A GTF record builder.
Implementations§
source§impl Builder
impl Builder
sourcepub fn set_reference_sequence_name<N>(self, reference_sequence_name: N) -> Self
pub fn set_reference_sequence_name<N>(self, reference_sequence_name: N) -> Self
Sets the reference sequence name.
§Examples
use noodles_gtf as gtf;
let record = gtf::Record::builder().set_reference_sequence_name("sq0").build();
assert_eq!(record.reference_sequence_name(), "sq0");
sourcepub fn set_source<S>(self, source: S) -> Self
pub fn set_source<S>(self, source: S) -> Self
Sets the source.
§Examples
use noodles_gtf as gtf;
let record = gtf::Record::builder().set_source("NOODLES").build();
assert_eq!(record.source(), "NOODLES");
sourcepub fn set_type<T>(self, ty: T) -> Self
pub fn set_type<T>(self, ty: T) -> Self
Sets the feature type.
§Examples
use noodles_gtf as gtf;
let record = gtf::Record::builder().set_type("exon").build();
assert_eq!(record.ty(), "exon");
sourcepub fn set_start(self, start: Position) -> Self
pub fn set_start(self, start: Position) -> Self
Sets the start position.
§Examples
use noodles_core::Position;
use noodles_gtf as gtf;
let start = Position::MIN;
let record = gtf::Record::builder().set_start(start).build();
assert_eq!(record.start(), start);
sourcepub fn set_end(self, end: Position) -> Self
pub fn set_end(self, end: Position) -> Self
Sets the end position.
§Examples
use noodles_core::Position;
use noodles_gtf as gtf;
let end = Position::MIN;
let record = gtf::Record::builder().set_end(end).build();
assert_eq!(record.end(), end);
sourcepub fn set_score(self, score: f32) -> Self
pub fn set_score(self, score: f32) -> Self
Sets the score.
§Examples
use noodles_gtf as gtf;
let record = gtf::Record::builder().set_score(1.0).build();
assert_eq!(record.score(), Some(1.0));
sourcepub fn set_strand(self, strand: Strand) -> Self
pub fn set_strand(self, strand: Strand) -> Self
Sets the strand.
§Examples
use noodles_gtf::{self as gtf, record::Strand};
let record = gtf::Record::builder().set_strand(Strand::Forward).build();
assert_eq!(record.strand(), Some(Strand::Forward));
sourcepub fn set_frame(self, frame: Frame) -> Self
pub fn set_frame(self, frame: Frame) -> Self
Sets the frame.
§Examples
use noodles_gtf::{self as gtf, record::Frame};
let frame = Frame::try_from(0)?;
let record = gtf::Record::builder().set_frame(frame).build();
assert_eq!(record.frame(), Some(frame));
Ok::<_, gtf::record::frame::ParseError>(())
sourcepub fn set_attributes(self, attributes: Attributes) -> Self
pub fn set_attributes(self, attributes: Attributes) -> Self
Sets the attributes;
§Examples
use noodles_gtf::{self as gtf, record::{attributes::Entry, Attributes}};
let attributes = Attributes::from(vec![Entry::new("gene_id", "g0")]);
let record = gtf::Record::builder().set_attributes(attributes.clone()).build();
assert_eq!(record.attributes(), &attributes);
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Builder
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
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