Struct noodles_fastq::Record
source · [−]pub struct Record { /* private fields */ }
Expand description
A FASTQ record.
Implementations
sourceimpl Record
impl Record
sourcepub fn new<S, T, U>(name: S, sequence: T, quality_scores: U) -> Self where
S: Into<Vec<u8>>,
T: Into<Vec<u8>>,
U: Into<Vec<u8>>,
pub fn new<S, T, U>(name: S, sequence: T, quality_scores: U) -> Self where
S: Into<Vec<u8>>,
T: Into<Vec<u8>>,
U: Into<Vec<u8>>,
Creates a FASTQ record.
Examples
use noodles_fastq::Record;
let record = Record::new("r0", "AGCT", "NDLS");
sourcepub fn read_name(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl Read for &'_ [u8]impl Write for &'_ mut [u8]
👎 Deprecated since 0.2.0: Use Record::name
instead.
pub fn read_name(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl Read for &'_ [u8]impl Write for &'_ mut [u8]
👎 Deprecated since 0.2.0:
Use Record::name
instead.
Returns the name of the record.
Examples
use noodles_fastq::Record;
let record = Record::new("r0", "AGCT", "NDLS");
assert_eq!(record.read_name(), b"r0");
sourcepub fn name(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl Read for &'_ [u8]impl Write for &'_ mut [u8]
pub fn name(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl Read for &'_ [u8]impl Write for &'_ mut [u8]
Returns the name of the record.
Examples
use noodles_fastq::Record;
let record = Record::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::Record;
let mut record = Record::new("r0", "AGCT", "NDLS");
*record.name_mut() = b"r1".to_vec();
assert_eq!(record.name(), b"r1");
sourcepub fn sequence(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl Read for &'_ [u8]impl Write for &'_ mut [u8]
pub fn sequence(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl Read for &'_ [u8]impl Write for &'_ mut [u8]
Returns the sequence of the record.
Examples
use noodles_fastq::Record;
let record = Record::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::Record;
let mut record = Record::new("r0", "AGCT", "NDLS");
record.sequence_mut()[0] = b'C';
assert_eq!(record.sequence(), b"CGCT");
sourcepub fn description(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl Read for &'_ [u8]impl Write for &'_ mut [u8]
pub fn description(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl Read for &'_ [u8]impl Write for &'_ mut [u8]
Returns the description of the record.
Examples
use noodles_fastq::Record;
let record = Record::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::Record;
let mut record = Record::new("r0", "AGCT", "NDLS");
*record.description_mut() = b"LN=4".to_vec();
assert_eq!(record.description(), b"LN=4");
sourcepub fn quality_scores(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl Read for &'_ [u8]impl Write for &'_ mut [u8]
pub fn quality_scores(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl Read for &'_ [u8]impl Write for &'_ mut [u8]
Returns the quality scores of the record.
Examples
use noodles_fastq::Record;
let record = Record::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::Record;
let mut record = Record::new("r0", "AGCT", "NDLS");
*record.quality_scores_mut() = b"!!!!".to_vec();
assert_eq!(record.quality_scores(), b"!!!!");
Trait Implementations
impl Eq for Record
impl StructuralEq for Record
impl StructuralPartialEq for Record
Auto Trait Implementations
impl RefUnwindSafe for Record
impl Send for Record
impl Sync for Record
impl Unpin for Record
impl UnwindSafe for Record
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more