sequenceEncoder() and sequenceDecoder() property mode silently mismatching amino-acid identity to property values for crucianiProperties, MSWHIM, and ProtFP. These property sets' column order in Peptides::AAdata is not already canonical (MSWHIM/ProtFP are stored alphabetically; crucianiProperties has an isolated E/Q swap), and .aa.property.matrix() was returning that raw storage order instead of reordering to match the canonical amino-acid order its callers assume positionally. For example, encoding "R" under MSWHIM silently returned Cysteine's values. .aa.property.matrix() now always returns canonical-AA-ordered columns, matching calculateProperty()'s existing contract and the documented sequenceEncoder()/sequenceDecoder() interface. Verified against Peptides' own independent public scoring functions (mswhimScores(), crucianiProperties(), protFP()).sequenceEncoder() and sequenceDecoder() pairing residues with the wrong property values when property.set was combined with a non-default sequence.dictionary. Both aligned the property matrix to the canonical 20 amino acids regardless of the dictionary actually in use, and neither checked the two agreed. .aa.property.matrix() now takes the sequence.dictionary and aligns columns to it by name, which also supports restricted alphabets. Requesting a residue a scale has no values for is now an error naming that residue, rather than a silently wrong matrix (this also covers "pK", which exists in Peptides::AAdata but only defines 9 residues).sequenceDecoder()'s property.matrix documentation, which described the matrix as 20 x P. It is P x 20, the transpose of sequenceEncoder()'s property.matrix argument.amino.acids was defined twice, in R/utils.R and again in R/calculateProperty.R. Consolidated to a single definition in R/aaa-constants.R, which collates before both.test-buildNetwork-star.R comparing igraph's arbitrary component ID labels rather than the component partition itself. The IDs depend on edge row order, which is not stable between expand = "clique" and expand = "star", so the test failed intermittently depending on merge order.buildNetwork() now scales to large, clonally expanded repertoires. The C++ engine was rewritten around candidate generation instead of all-pairs comparison, with no new dependencies and identical edge output for the default settings:
2k. Hamming uses pigeonhole segment indexing. Both fall back to length-blocked comparison outside their range.Speedups range from roughly 2x on mixed repertoires with many V genes to about 70x when one block holds many unique sequences at a tight threshold.
expand argument to buildNetwork(). "clique" (default) materializes every pairwise edge and reproduces the exact edge multiplicity that community-detection clustering expects. "star" links identical sequences through a single hub and connects related groups hub to hub. "star" produces far fewer edges and preserves connected components exactly, so it is a large memory win when the downstream step depends on connectivity.inferCDR() reference validation checkgetIMGT() now uses immReferent as a backend for downloading and caching IMGT reference sequencesframe, max.retries, and verbose parameters from getIMGT()refresh parameter to getIMGT() for controlling cache behaviorhash, httr, and rvest package dependencies (now handled by immReferent).parseSpecies() with .mapSpecies() for immReferent species name compatibilitypropertyEncoder() function when the suggested Peptides package is not installed.The buildNetwork() function has been significantly enhanced to include:
Multiple distance metrics: Added support for five distance metrics via the dist_type parameter:
"levenshtein" (default): Standard edit distance"hamming": Substitutions only (requires equal-length sequences)"damerau": Levenshtein with transpositions"nw": Needleman-Wunsch global alignment"sw": Smith-Waterman local alignmentFlexible normalization: New normalize parameter supports three modes:
"none" (default): Raw distance values (backward compatible)"maxlen": Normalize by max(length(seq1), length(seq2))"length": Normalize by mean sequence lengthbuildNetwork() returns a symmetric distance matrix and drops nonstructural zerospropertyEncoder() and onehotEncoder() to use C++ backend with encodeSequences.cppbuildNetwork() via C++ integration (fastEditEdges.cpp)calculateMotif() use C++ (calculateMotif.cpp)generateSequences(), mutateSequences(), adjacencyMatrix(), tokenizeSequences(), geometricEncodergetIR()variationalSequences()getIMGT() for website functioningcalculateEntropy() added to calculate the positional entropy along a biological sequencecalculateEntropy()calculateFrequency() added to calculate the positional frequency along a biological sequencecalculateMotif() added to get motif quantification of sequencescalculateGeneUsage() added for single/paired gene enumerationscaleMatrix() for comprehensive scale/transformation functionssummaryMatrix() for fast summarization of matrix valuesinferCDR()generateSequence() range issue for single-length sequencespositionalEncoder()buildNetwork() for relative thresholding returns relative valuegetIMGT() checks for availability of IMGT websitevariationalSequences() evaluate presence of KerasvariationalSequences() examplevariationalSequences()propertyEncoder()variationalSequences()variationalSequences()getIMGT()getIMGT()getIMGT() to mention IMGT license on first usepositionalEncoder()formatGenes() and inferCDR() for new example data