Expand description
Sequence utilities that operate on raw &[u8] slices.
Everything here is case-preserving and allocation-free unless the return type says otherwise, so these helpers can be used inside hot loops.
Structs§
- Base
Counts - Per-base counts of a nucleotide sequence, case-insensitive.
Enums§
- Alphabet
- A residue alphabet used for validation.
Functions§
- canonical_
kmer - Canonical k-mer: the lexicographically smaller of a k-mer and its reverse complement, so that both strands hash to the same value.
- complement
- Complement a single nucleotide as DNA, preserving case.
- complement_
rna - Complement a single nucleotide as RNA:
AbecomesU, notT. - gc_
content - GC fraction of a sequence, ignoring ambiguity codes.
- hamming_
distance - Hamming distance between two equal-length sequences, case-insensitive.
- kmers
- Iterator over the overlapping k-mers of a sequence.
- make_
uppercase - Uppercase a sequence in place (soft-masked genomes use lowercase for repeats).
- n50
- N50 of a set of lengths: the length
Lsuch that contigs of at leastLcover half of the total assembly length. - nx
- Generalised N-statistic:
nx(lengths, 0.9)is the N90. - reverse_
complement - Reverse complement of a nucleotide sequence, as DNA.
- reverse_
complement_ in_ place - Reverse complement a sequence in place.
- reverse_
complement_ into - Reverse complement into an existing buffer, which is cleared first.
- reverse_
complement_ rna - Reverse complement of a nucleotide sequence, as RNA.
- rna_
to_ dna - Replace
U/uwithT/t, turning RNA into DNA in place. - translate
- Translate a nucleotide sequence into a protein sequence.
- translate_
codon - Translate a single codon using the standard genetic code.