Struct noodles_gff::record::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A GFF record builder.
Implementations§
source§impl Builder
impl Builder
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a GFF record builder.
Typically, Record::builder
is used instead of calling this.
§Examples
use noodles_gff as gff;
let builder = gff::Record::builder();
sourcepub fn set_reference_sequence_name(
self,
reference_sequence_name: String
) -> Self
pub fn set_reference_sequence_name( self, reference_sequence_name: String ) -> Self
Sets a GFF record reference sequence name.
§Examples
use noodles_gff as gff;
let record = gff::Record::builder()
.set_reference_sequence_name(String::from("sq0"))
.build();
assert_eq!(record.reference_sequence_name(), "sq0");
sourcepub fn set_source(self, source: String) -> Self
pub fn set_source(self, source: String) -> Self
Sets a GFF record source.
§Examples
use noodles_gff as gff;
let record = gff::Record::builder()
.set_source(String::from("NOODLES"))
.build();
assert_eq!(record.source(), "NOODLES");
sourcepub fn set_type(self, ty: String) -> Self
pub fn set_type(self, ty: String) -> Self
Sets a GFF record feature type.
§Examples
use noodles_gff as gff;
let record = gff::Record::builder()
.set_type(String::from("gene"))
.build();
assert_eq!(record.ty(), "gene");
sourcepub fn set_start(self, start: Position) -> Self
pub fn set_start(self, start: Position) -> Self
Sets a GFF record start position.
§Examples
use noodles_core::Position;
use noodles_gff as gff;
let start = Position::MIN;
let record = gff::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 a GFF record end position.
§Examples
use noodles_core::Position;
use noodles_gff as gff;
let end = Position::MIN;
let record = gff::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 a GFF record score.
§Examples
use noodles_gff as gff;
let record = gff::Record::builder().set_score(21.0).build();
assert_eq!(record.score(), Some(21.0));
sourcepub fn set_strand(self, strand: Strand) -> Self
pub fn set_strand(self, strand: Strand) -> Self
Sets a GFF record strand.
§Examples
use noodles_gff::{self as gff, record::Strand};
let record = gff::Record::builder()
.set_strand(Strand::Forward)
.build();
assert_eq!(record.strand(), Strand::Forward);
sourcepub fn set_phase(self, phase: Phase) -> Self
pub fn set_phase(self, phase: Phase) -> Self
Sets a GFF record phase.
§Examples
use noodles_gff::{self as gff, record::Phase};
let record = gff::Record::builder().set_phase(Phase::Zero).build();
assert_eq!(record.phase(), Some(Phase::Zero));
sourcepub fn set_attributes(self, attributes: Attributes) -> Self
pub fn set_attributes(self, attributes: Attributes) -> Self
Sets GFF record attributes.
§Examples
use noodles_gff::{
self as gff,
record::{
attributes::field::{Tag, Value},
Attributes,
},
};
let attributes: Attributes = [(Tag::from("gene_id"), Value::from("ndls0"))]
.into_iter()
.collect();
let record = gff::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