Struct noodles_fastq::record::Record
source · pub struct Record { /* private fields */ }
Expand description
A FASTQ record.
Implementations§
source§impl Record
impl Record
sourcepub fn new<S, Q>(definition: Definition, sequence: S, quality_scores: Q) -> Self
pub fn new<S, Q>(definition: Definition, sequence: S, quality_scores: Q) -> Self
Creates a FASTQ record.
§Examples
use noodles_fastq::{self as fastq, record::Definition};
let record = fastq::Record::new(Definition::new("r0", ""), "AGCT", "NDLS");
sourcepub fn definition(&self) -> &Definition
pub fn definition(&self) -> &Definition
Returns the record definition.
sourcepub fn definition_mut(&mut self) -> &mut Definition
pub fn definition_mut(&mut self) -> &mut Definition
Returns a mutable reference to the record definition.
sourcepub fn name(&self) -> &[u8] ⓘ
pub fn name(&self) -> &[u8] ⓘ
Returns the name of the record.
§Examples
use noodles_fastq::{self as fastq, record::Definition};
let record = fastq::Record::new(Definition::new("r0", ""), "AGCT", "NDLS");
assert_eq!(record.name(), b"r0");
sourcepub fn name_mut(&mut self) -> &mut Vec<u8> ⓘ
pub fn name_mut(&mut self) -> &mut Vec<u8> ⓘ
Returns a mutable reference to the name.
§Examples
use noodles_fastq::{self as fastq, record::Definition};
let mut record = fastq::Record::new(Definition::new("r0", ""), "AGCT", "NDLS");
*record.name_mut() = b"r1".to_vec();
assert_eq!(record.name(), b"r1");
sourcepub fn description(&self) -> &[u8] ⓘ
pub fn description(&self) -> &[u8] ⓘ
Returns the description of the record.
§Examples
use noodles_fastq::{self as fastq, record::Definition};
let record = fastq::Record::new(Definition::new("r0", ""), "AGCT", "NDLS");
assert!(record.description().is_empty());
sourcepub fn description_mut(&mut self) -> &mut Vec<u8> ⓘ
pub fn description_mut(&mut self) -> &mut Vec<u8> ⓘ
Returns a mutable reference to the description.
§Examples
use noodles_fastq::{self as fastq, record::Definition};
let mut record = fastq::Record::new(Definition::new("r0", ""), "AGCT", "NDLS");
*record.description_mut() = b"LN=4".to_vec();
assert_eq!(record.description(), b"LN=4");
sourcepub fn sequence(&self) -> &[u8] ⓘ
pub fn sequence(&self) -> &[u8] ⓘ
Returns the sequence of the record.
§Examples
use noodles_fastq::{self as fastq, record::Definition};
let record = fastq::Record::new(Definition::new("r0", ""), "AGCT", "NDLS");
assert_eq!(record.sequence(), b"AGCT");
sourcepub fn sequence_mut(&mut self) -> &mut Vec<u8> ⓘ
pub fn sequence_mut(&mut self) -> &mut Vec<u8> ⓘ
Returns a mutable reference to the sequence.
§Examples
use noodles_fastq::{self as fastq, record::Definition};
let mut record = fastq::Record::new(Definition::new("r0", ""), "AGCT", "NDLS");
record.sequence_mut()[0] = b'C';
assert_eq!(record.sequence(), b"CGCT");
sourcepub fn quality_scores(&self) -> &[u8] ⓘ
pub fn quality_scores(&self) -> &[u8] ⓘ
Returns the quality scores of the record.
§Examples
use noodles_fastq::{self as fastq, record::Definition};
let record = fastq::Record::new(Definition::new("r0", ""), "AGCT", "NDLS");
assert_eq!(record.quality_scores(), b"NDLS");
sourcepub fn quality_scores_mut(&mut self) -> &mut Vec<u8> ⓘ
pub fn quality_scores_mut(&mut self) -> &mut Vec<u8> ⓘ
Returns a mutable reference to the quality scores.
§Examples
use noodles_fastq::{self as fastq, record::Definition};
let mut record = fastq::Record::new(Definition::new("r0", ""), "AGCT", "NDLS");
*record.quality_scores_mut() = b"!!!!".to_vec();
assert_eq!(record.quality_scores(), b"!!!!");
Trait Implementations§
source§impl PartialEq for Record
impl PartialEq for Record
impl Eq for Record
impl StructuralPartialEq for Record
Auto Trait Implementations§
impl Freeze for Record
impl RefUnwindSafe for Record
impl Send for Record
impl Sync for Record
impl Unpin for Record
impl UnwindSafe for Record
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