Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
^codecov\.yml$
^\.github$
^www$
^_pkgdown\.yml$
^docs$
^pkgdown$
44 changes: 44 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
on:
push:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown

jobs:
pkgdown:
runs-on: ubuntu-latest
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website

- name: Build pkgdown site
run: |
pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy to borch.dev website repo
uses: JamesIves/github-pages-deploy-action@v4.7.3
with:
repository-name: ncborcherding/borcherding
branch: master
folder: docs
target-folder: static/uploads/bhive
token: ${{ secrets.WEBSITE_DEPLOY_TOKEN }}
clean: true
23 changes: 14 additions & 9 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,36 +1,41 @@
Package: bHIVE
Title: B-cell Hybrid Immune Variant Engine
Version: 0.99.0
Version: 0.99.1
Authors@R: c(
person(given = "Nick", family = "Borcherding", role = c("aut", "cre"), email = "ncborch@gmail.com"))
Description: The bHIVE package implements an Artificial Immune Network (AI-Net) algorithm for clustering, classification, and regression tasks. Inspired by biological immune systems, it employs clonal selection, mutation, and network suppression to analyze and model datasets. This package provides flexible functionality, including affinity metrics, mutation strategies, and hyperparameter tuning.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.2
biocViews: Software, Classification, Annotation, Regression, Classification
Depends:
R (>= 4.0.0)
Imports:
RoxygenNote: 7.3.3
biocViews: Software, Clustering, Classification, Regression, Network
Depends:
R (>= 4.5.0)
Imports:
BiocParallel,
cluster,
clusterCrit,
ggplot2,
R6,
Rcpp,
Rtsne,
stats,
umap,
viridis
LinkingTo:
Rcpp,
RcppArmadillo
Suggests:
BiocStyle,
caret,
caret,
devtools,
knitr,
MASS,
pkgdown,
rmarkdown,
spelling,
testthat (>= 3.0.0)
VignetteBuilder: knitr
Config/testthat/edition: 3
Language: en-US
URL: https://www.borch.dev/uploads/bHIVE/
URL: https://www.borch.dev/uploads/bhive/
BugReports: https://github.com/BorchLab/bHIVE/issues
16 changes: 16 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Generated by roxygen2: do not edit by hand

export(AINet)
export(ActivationGate)
export(ClassSwitcher)
export(ConvergentSelector)
export(GerminalCenter)
export(IdiotypicNetwork)
export(ImmuneAlgorithm)
export(ImmuneRepertoire)
export(MemoryPool)
export(Microenvironment)
export(SHMEngine)
export(VDJLibrary)
export(bHIVE)
export(bHIVEmodel)
export(honeycombHIVE)
Expand All @@ -12,10 +24,13 @@ importFrom(BiocParallel,BatchtoolsParam)
importFrom(BiocParallel,MulticoreParam)
importFrom(BiocParallel,SerialParam)
importFrom(BiocParallel,bplapply)
importFrom(R6,R6Class)
importFrom(Rcpp,sourceCpp)
importFrom(Rtsne,Rtsne)
importFrom(cluster,silhouette)
importFrom(clusterCrit,intCriteria)
importFrom(stats,dist)
importFrom(stats,kmeans)
importFrom(stats,median)
importFrom(stats,prcomp)
importFrom(stats,rnorm)
Expand All @@ -25,3 +40,4 @@ importFrom(stats,setNames)
importFrom(umap,umap)
importFrom(viridis,scale_color_viridis)
importFrom(viridis,scale_fill_viridis)
useDynLib(bHIVE, .registration = TRUE)
99 changes: 99 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# bHIVE 0.99.1

## C++ Backend
* Added RcppArmadillo backend for BLAS-optimized bulk affinity and distance
matrix computation, replacing per-element R loops
* Scalar affinity function for clone/mutate hot path avoids 1x1 matrix
allocation overhead
* C++ implementations for clonal selection iteration, network suppression,
kmeans++ initialization, final assignment, somatic hypermutation (5 methods),
and idiotypic network dynamics

## R6 Class Architecture
* New `ImmuneRepertoire` class for antibody collections with metadata tracking
(isotype, state, age, lineage)
* New `ImmuneAlgorithm` abstract base class with fit/predict/summary interface
* New `AINet` class wrapping core algorithm with composable module injection
* Both R6 composition and functional API equally supported

## New Modules
* `SHMEngine` — Five somatic hypermutation strategies: uniform (original
behavior), airs (affinity-proportional), hotspot (feature-gradient-weighted),
energy (budget-constrained), and adaptive (per-feature Adam-like moment
tracking)
* `IdiotypicNetwork` — Antibody-antibody network dynamics with bell-shaped
activation function replacing epsilon-threshold suppression
* `GerminalCenter` — T-follicular helper mediated selection with task-aware
quality scoring and resource competition
* `Microenvironment` — Density-dependent zone classification
(stable/explore/boundary) with chemokine-like gradient computation
* `VDJLibrary` — Combinatorial V(D)J gene library initialization via PCA,
k-means clustering, or random partition of feature space
* `ActivationGate` — Two-signal activation gate requiring both antigen
recognition and costimulatory context (density, danger, or entropy)
* `MemoryPool` — Archive high-affinity antibodies as long-lived memory cells
with threshold-based recall
* `ClassSwitcher` — Isotype class switching (IgM broad, IgG specific, IgA
boundary) modulating effective kernel width
* `ConvergentSelector` — Cross-repertoire consensus identification of public
antibodies for ensemble methods

## Documentation
* Complete README rewrite covering functional API, R6 API, module reference
table, and architecture overview
* New pkgdown website with Bootstrap 5 Flatly theme, organized reference groups,
and tutorial navigation
* New article: "Composing Immune Modules" — R6 composition patterns for all 9
modules with worked examples
* New article: "Advanced Tuning & Workflows" — swarmbHIVE grid search,
honeycombHIVE multilayer refinement, refineB optimizer comparison, caret
integration, and visualizeHIVE plot types
* New article: "Algorithm & Biological Foundations" — comprehensive mathematical
reference covering all affinity kernels, distance functions, SHM strategies,
idiotypic ODE system, germinal center selection, and parameter guidance
* Added roxygen @examples to refineB, bHIVEmodel, and ImmuneAlgorithm (now 90%
example coverage)
* GitHub Actions workflow for automated pkgdown deployment to borch.dev

## Package Infrastructure
* Created `R/bHIVE-package.R` with roxygen-managed `@useDynLib` and
`@importFrom Rcpp sourceCpp` directives
* Added `%||%` operator `@name null-coalesce` to avoid illegal characters in Rd
`\name` field
* Moved tutorial vignettes to `vignettes/articles/` (pkgdown-only, not installed
with package) to reduce installed size
* Added pkgdown configuration (`_pkgdown.yml`) with 7 reference groups and
structured article hierarchy

## BiocCheck Compliance
* Replaced all `sapply()` calls with `vapply()` in bHiVE.R and visualizeHIVE.R
* Replaced all `1:n` patterns with `seq_len()` / `seq_along()`
* Removed `install.packages()` calls from vignettes
* Removed `LazyData: true` from DESCRIPTION
* Updated R dependency to >= 4.5.0
* Updated biocViews to `Software, Clustering, Classification, Regression,
Network`
* Added class-level `@param` documentation for all R6 initialize() arguments
across 11 module classes
* Added `@param ... Not used.` to all R6 `print()` methods

## Bug Fixes
* Fixed kmeans++ sampling: corrected cumulative sum fallback index and
runif-to-integer cast
* Fixed cosine similarity epsilon (1e-12) for numerical stability
* Fixed division-by-zero guard in idiotypic dynamics when theta_low equals
theta_high
* Fixed VDJLibrary NaN in kmeans for single-allele edge cases
* Fixed VDJLibrary NA subscript when feature dimensions not divisible by 3
* Removed duplicate `Classification` from biocViews, added `Clustering`
* Fixed vignette YAML parsing error from bare `---` horizontal rule

# bHIVE 0.99.0

* Initial submission version with core AIS functionality
* Clonal selection, network suppression, and mutation for clustering,
classification, and regression
* honeycombHIVE multilayer architecture
* swarmbHIVE hyperparameter tuning via BiocParallel
* caret model integration (bHIVEmodel, honeycombHIVEmodel)
* Visualization utilities via ggplot2
Loading
Loading