Struct noodles_gff::record::Builder [−][src]
pub struct Builder { /* fields omitted */ }
Expand description
A GFF record builder.
Implementations
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();
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");
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");
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");
Sets a GFF record start position.
Examples
use noodles_gff as gff;
let record = gff::Record::builder().set_start(8).build();
assert_eq!(record.start(), 8);
Sets a GFF record end position.
Examples
use noodles_gff as gff;
let record = gff::Record::builder().set_end(13).build();
assert_eq!(record.end(), 13);
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));
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);
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));
Sets GFF record attributes.
Examples
use noodles_gff::{
self as gff,
record::{attributes::Entry, Attributes},
};
let attributes = Attributes::from(vec![Entry::new("gene_id", "ndls0")]);
let record = gff::Record::builder()
.set_attributes(attributes.clone())
.build();
assert_eq!(record.attributes(), &attributes);