pub struct Record { /* private fields */ }
Expand description

An instance of a Fastx Record. This is a two attribute object containing the sequence ID and the Sequence.

Implementations

Usage

Creates a new instance of a [Record]

let record = fxread::Record::new();
assert!(record.empty());
Usage

Creates a new instance of a [Record] from a preinitialized [Vec<u8>] with the id and seq endpoints calculated. These endpoints are inclusive of the ‘\n’ terminator and the data is expected to exclude the prefix ‘>’ marker.

let data = b"seq.0\nACGT\n".to_vec();
let id = 6;
let seq = 5;
let fasta = fxread::Record::new_fasta(data, id, seq);
assert_eq!(fasta.id(), b"seq.0");
assert_eq!(fasta.seq(), b"ACGT");
Usage

Creates a new instance of a [Record] from a preinitialized [Vec<u8>] with the id, seq, plus, and qual endpoints calculated. These endpoints are inclusive of the ‘\n’ terminator and the data is expected to exclude the prefix ‘@’ marker.

let data = b"seq.0\nACGT\n+\n1234\n".to_vec();
let id = 6;
let seq = 5;
let plus = 2;
let qual = 5;
let fasta = fxread::Record::new_fastq(data, id, seq, plus, qual);
assert_eq!(fasta.id(), b"seq.0");
assert_eq!(fasta.seq(), b"ACGT");
assert_eq!(fasta.plus().unwrap(), b"+");
assert_eq!(fasta.qual().unwrap(), b"1234");

Checks if [Record] is empty

Returns a reference of the sequence ID

Returns a reference of the sequence

Returns a reference of the ‘+’ region of a fastq

Returns a reference of the sequence

Returns a reference to the raw data underlying the record

Validates that the record is not partially constructed or composed of unexpected nucleotides

Converts the sequence to uppercase

Reverse Complements the sequence

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.