Expand description
SIMD-Accelerated Bioinformatics Engine.
Production-quality sequence alignment with hardware dispatch:
- Smith-Waterman local alignment (affine gap penalties)
- Needleman-Wunsch global alignment
- BLOSUM62 / nucleotide substitution matrices
- K-mer frequency analysis + MinHash sketching
- FASTA record validation
- Tanimoto metabolite fingerprint similarity
qualia:alignNucleotideSequence → align_nucleotide()
qualia:alignProteinSequence → align_protein()
qualia:computeKmerFrequency → kmer_frequencies()
qualia:validateFastaRecord → validate_fasta_record()
qualia:computeMetaboliteSimilarity → tanimoto_similarity()
Structs§
- Alignment
Result - Full alignment result with traceback and statistics.
- Alignment
Score - Lightweight backward-compatible score wrapper.
- Fasta
Record - GapPenalty
- Affine gap penalty model (BLAST defaults: open=-11, extend=-1).
- Nucleotide
Matrix - Nucleotide substitution scores.
- Phylo
Merge - One agglomeration event in a UPGMA tree: the two child cluster ids merged, the
node height, and the id assigned to the new (parent) cluster. Leaves are
0..n; internal nodes are numberedn..2n-1in merge order, so the last record’smerged_idis the root.
Enums§
Constants§
- MAX_
PHYLO_ TAXA - Maximum number of taxa (leaves) a single bounded UPGMA build admits. Bounding the taxon count keeps the working distance matrix on the stack — zero heap.
Functions§
- align_
nucleotide - DNA/RNA Smith-Waterman with BLAST nucleotide defaults.
- align_
protein - Protein Smith-Waterman with BLOSUM62.
- align_
sequences - Backward-compatible entry point returning the legacy
AlignmentScore. - blosum62_
score - BLOSUM62 score for two amino acid bytes. Unknown residues → -4.
- build_
upgma_ tree - Build a UPGMA (Unweighted Pair Group Method with Arithmetic Mean) phylogenetic
tree from a flattened
n×nsymmetric distance matrix (distances[i*n + j]). - calculate_
isoelectric_ point - Estimates the Isoelectric Point (pI) of a protein sequence using the Henderson-Hasselbalch equation and basic pKa values.
- dice_
similarity - Dice coefficient between two binary fingerprints.
- jaccard_
similarity - Jaccard similarity (0.0–1.0) between two MinHash sketches.
- kmer_
frequencies - Counts all k-mer occurrences; returns (kmer_fnv1a_hash, count) sorted by hash.
- minhash_
sketch - MinHash sketch: the
sketch_sizesmallest k-mer hashes. - needleman_
wunsch - Needleman-Wunsch global alignment with linear gap penalty.
- predict_
peptide_ cleavage - Predicts cleavage sites for Trypsin (cleaves after K or R, unless followed by P).
Writes the indices of cleavage into the caller-provided
out_indicesbuffer. Returns the number of cleavage sites found. - smith_
waterman - Smith-Waterman local alignment with affine gap penalties. Allocates O(m×n) DP tables — caller should respect MAX_SEQ_LEN.
- tanimoto_
similarity - Tanimoto (Jaccard) coefficient between two Morgan fingerprints encoded as u64 bitmasks. Multiple words can represent a full extended fingerprint.
- translate_
dna_ to_ protein - Translates a DNA sequence into an amino acid sequence using the standard genetic code.
Writes directly into the caller-provided
outbuffer to avoid allocation. Returns the number of amino acids written. - validate_
fasta_ record - Validates and classifies a FASTA record.