Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e5cb943
Optimized evaluate_fitness.cpp
danymukesha Jun 30, 2025
a6adcad
Increment version number to 0.99.7
danymukesha Jun 30, 2025
5eac2a4
Optimized crossover.cpp
danymukesha Jun 30, 2025
5be0ba3
Increment version number to 0.99.8
danymukesha Jun 30, 2025
6f7d602
Optimized selection.cpp
danymukesha Jun 30, 2025
ddb9fd7
Increment version number to 0.99.9
danymukesha Jul 1, 2025
c5c82d4
Optimized mutation.cpp
danymukesha Jul 1, 2025
5c301b6
Increment version number to 0.99.10
danymukesha Jul 1, 2025
98aaa28
Optimized replacement.cpp
danymukesha Jul 1, 2025
d1c0194
Increment version number to 0.99.11
danymukesha Jul 1, 2025
59f9576
Repaired-Optimized replacement.cpp
danymukesha Jul 1, 2025
caed468
Increment version number to 0.99.12
danymukesha Jul 1, 2025
275230b
Optimized initialize_population.cpp
danymukesha Jul 1, 2025
675c95c
Increment version number to 0.99.13
danymukesha Jul 1, 2025
1b4aad8
New Feature - Main GA Loop
danymukesha Jul 1, 2025
0532015
Increment version number to 0.99.14
danymukesha Jul 1, 2025
6866aa3
update bioga_main example, update test_evaluate_fitness_cpp
danymukesha Jul 1, 2025
54946a9
Increment version number to 0.99.15
danymukesha Jul 1, 2025
5e5bc0b
update test_crossover_cpp
danymukesha Jul 1, 2025
ce9034a
update more tests
danymukesha Jul 1, 2025
2a08cce
add test the overall package
danymukesha Jul 1, 2025
d14515d
add provisional test for bioga_main
danymukesha Jul 1, 2025
447d2fb
Increment version number to 0.99.16
danymukesha Jul 1, 2025
74ce199
add demo, math, and update BioGA vignettes, update selection_cpp also
danymukesha Jul 2, 2025
8b9ace5
Increment version number to 0.99.17
danymukesha Jul 2, 2025
de00c07
add missing pkgs in DESCRIPTION
danymukesha Jul 2, 2025
eaef256
updated the vignettes and tests
danymukesha Jul 2, 2025
e9e17ff
some updates
danymukesha Jul 2, 2025
ac5806b
clean the indents, add 4 spaces indents
danymukesha Jul 3, 2025
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
24 changes: 21 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: BioGA
Title: Bioinformatics Genetic Algorithm (BioGA)
Version: 0.99.6
Version: 0.99.17
Authors@R:
person("Dany", "Mukesha", , "danymukesha@gmail.com",
role = c("aut", "cre"),
Expand All @@ -20,20 +20,38 @@ Imports:
ggplot2,
graphics,
Rcpp,
RcppParallel,
SummarizedExperiment,
animation,
rlang,
biocViews,
sessioninfo,
BiocStyle
BiocStyle,
BiocParallel,
GEOquery,
caret,
caretEnsemble,
doParallel,
dplyr,
iml,
lattice,
lime,
pROC,
pheatmap,
randomForest,
survival,
survminer,
timeROC,
xgboost
Depends:
R (>= 4.4)
Suggests:
knitr,
rmarkdown,
testthat (>= 3.0.0)
LinkingTo:
Rcpp
Rcpp,
RcppParallel
VignetteBuilder:
knitr
biocViews: ExperimentalDesign, Technology
Expand Down
43 changes: 43 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by roxygen2: do not edit by hand

export(bioga_main_cpp)
export(crossover_cpp)
export(evaluate_fitness_cpp)
export(initialize_population_cpp)
Expand All @@ -9,19 +10,61 @@ export(plot_fitness_history)
export(plot_population)
export(replacement_cpp)
export(selection_cpp)
import(RcppParallel)
importFrom(BiocParallel,bplapply)
importFrom(BiocParallel,bpmapply)
importFrom(BiocParallel,register)
importFrom(BiocStyle,html_document)
importFrom(GEOquery,getGEO)
importFrom(Rcpp,evalCpp)
importFrom(Rcpp,sourceCpp)
importFrom(SummarizedExperiment,SummarizedExperiment)
importFrom(animation,saveGIF)
importFrom(biocViews,getBiocViews)
importFrom(caret,createDataPartition)
importFrom(caret,train)
importFrom(caret,trainControl)
importFrom(caretEnsemble,caretEnsemble)
importFrom(caretEnsemble,caretList)
importFrom(doParallel,registerDoParallel)
importFrom(doParallel,stopImplicitCluster)
importFrom(dplyr,arrange)
importFrom(dplyr,distinct)
importFrom(dplyr,filter)
importFrom(dplyr,mutate)
importFrom(dplyr,rename)
importFrom(dplyr,select)
importFrom(dplyr,summarise)
importFrom(ggplot2,geom_line)
importFrom(ggplot2,ggplot)
importFrom(ggplot2,ggtitle)
importFrom(ggplot2,labs)
importFrom(graphics,boxplot)
importFrom(graphics,hist)
importFrom(graphics,par)
importFrom(iml,FeatureImp)
importFrom(iml,Predictor)
importFrom(lattice,bwplot)
importFrom(lattice,histogram)
importFrom(lattice,xyplot)
importFrom(lime,explain)
importFrom(pROC,ci.auc)
importFrom(pROC,plot.roc)
importFrom(pROC,roc)
importFrom(parallel,detectCores)
importFrom(parallel,makeCluster)
importFrom(pheatmap,pheatmap)
importFrom(randomForest,combine)
importFrom(randomForest,randomForest)
importFrom(rlang,local_options)
importFrom(sessioninfo,session_info)
importFrom(survival,Surv)
importFrom(survival,cluster)
importFrom(survival,coxph)
importFrom(survival,survfit)
importFrom(survminer,ggsurvplot)
importFrom(timeROC,timeROC)
importFrom(xgboost,slice)
importFrom(xgboost,xgb.DMatrix)
importFrom(xgboost,xgb.train)
useDynLib(BioGA, .registration = TRUE)
202 changes: 202 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,205 @@
# BioGA 0.99.17

Added:
- Demo vignette for BioGA.
- Mathematical background vignette for BioGA.

Updated:
- BioGA vignettes with new examples and explanations.
- `selection_cpp` function for improved performance and bug fixes.

# BioGA 0.99.16

*UPDATE: test_crossover_cpp*

The test verifies dimensions, value ranges, and new parameters.

Changes:
- Added tests for new parameters (`crossover_rate`, `eta_c`).
- Verified that offspring values lie within parent ranges (due to SBX).
- Included edge case test for single parent and zero crossover rate.
- Simplified error/warning checks.

*UPDATE: test_selection_cpp*
The test checks dimensions, parent selection, and compatibility with multi-objective fitness.

Changes:
- Updated to handle multi-objective fitness matrix.
- Verified that selected parents are exact copies of population rows.
- Added edge case test for single individual and single objective.
- Removed redundant fitness evaluation test (already covered in `evaluate_fitness_cpp`).

*UPDATE: test_mutation_cpp*
The test checks dimensions, mutation effects, and new parameters.

Changes:
- Added tests for new parameters (`iteration`, `max_iterations`, `network`).
- Verified that zero mutation rate preserves offspring.
- Tested network constraints with extreme cases (zero and full constraints).
- Simplified error/warning checks.

*UPDATE/ADDED: test_replacement_cpp*

The test checks dimensions, elite preservation, and diversity.

Changes:
- Added test for new function signature (requires fitness matrices).
- Verified elite preservation based on first objective.
- Included edge case test for zero replacements.
- Added checks for dimensions and error-free execution.

*UPDATE: test_initialize_population_cpp*

The test checks dimensions, value validity, and new parameters.

Changes:
- Added test for `seed` parameter to ensure reproducibility.
- Included test for `clusters` parameter to verify correct initialization.
- Maintained tests for dimensions and value validity.
- Added edge case test for minimal input.

*UPDATE: test_bioga_main_cpp* {PROVISIONAL}

New test file is created to verify the main GA loop.

Feature:
- Tests the output structure (list with population and fitness).
- Verifies dimensions of population and fitness matrices.
- Checks optional parameters (`clusters`, `network`).
- Includes edge case test for minimal input.

*Test for Package (test-BioGA-package.R)*

Created a new version to test the overall package integrity and ensure all functions are exported correctly.

Feature:
- Tests package loading and function exports.
- Verifies a complete GA workflow without errors.
- Ensures compatibility with the optimized functions.

# BioGA 0.99.15

*UPDATE: test_evaluate_fitness_cpp*
The test checks dimensions, values, and error-free execution.

Changes:

* Updated to test the new matrix output (multiple objectives).
* Added checks for non-negative fitness values (appropriate for expression difference and sparsity).
* Included edge case test for minimal input.
* Removed redundant `tryCatch` and simplified error/warning checks.

# BioGA 0.99.14

*Commit -m "New Feature - Main GA Loop"*

adding a main GA loop function that integrates all components
and supports multi-objective optimization and parallelization.

Features:

* Integrates all optimized components into a cohesive GA loop.
* Supports multi-objective optimization, gene networks, and clustering.
* Returns both final population and fitness scores for analysis.

# BioGA 0.99.13

*Commit -m "Optimized initialize_population.cpp"*

Improvements:

* Add option for biologically informed initialization using gene clusters.
* Improve random seed handling for reproducibility.

Changes:

* Added optional random seed for reproducibility.
* Included support for gene clustering to initialize biologically relevant populations.
* Improved code readability and documentation.

# BioGA 0.99.12

*Commit -m "Optimized replacement.cpp"*

indentation adjustments

# BioGA 0.99.11

*Commit -m "Optimized replacement.cpp"*

Improvements:

* Implement elitism to preserve best individuals.
* Add diversity-based replacement to avoid premature convergence.

Changes:

* Added elitism to preserve the best individual.
* Included diversity-based replacement to maintain population diversity.
* Updated to use multi-objective fitness matrix.

# BioGA 0.99.10

*Commit -m "Optimized mutation.cpp"*

Improvements:

* Add adaptive mutation rate based on iteration or fitness stagnation.
* Incorporate gene network constraints (placeholder for user-provided network).

Changes:

* Added adaptive mutation rate based on iteration progress.
* Included optional gene network constraints to ensure biologically relevant mutations.
* Maintained compatibility with existing functionality.

# BioGA 0.99.9

*Commit -m "Optimized selection.cpp"*

Improvements:

* Implement NSGA-II non-dominated sorting for multi-objective optimization.
* Add tournament selection for better diversity.

Changes:

* Implemented NSGA-II non-dominated sorting for multi-objective selection.
* Added tournament selection to maintain diversity.
* Updated to handle multi-objective fitness matrix.

# BioGA 0.99.8

*Commit -m "Optimized crossover.cpp"*
"
Improvements:

* Implement simulated binary crossover (SBX) for better exploration.
* Add adaptive crossover rate based on population diversity.

Changes:

* Replaced simple averaging with SBX crossover for better exploration.
* Added adaptive crossover rate based on population diversity.
* Included parameters for crossover rate and distribution index.

# BioGA 0.99.7

*Commit -m "Optimized evaluate_fitness.cpp"*

Improvements:

* Add multi-objective fitness evaluation (e.g., minimize expression difference and maximize gene sparsity).
* Use vectorized operations for faster computation.
* Add parallelization with RcppParallel for large datasets.

Changes:

* Added multi-objective support (expression difference and sparsity).
* Used `RcppParallel` for parallel computation.
* Returned a matrix of fitness scores for each objective.
* Added weights parameter for flexible objective prioritization.

# BioGA 0.99.6

* add the authors and date in the vignettes?
Expand Down
18 changes: 18 additions & 0 deletions R/BioGA-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,24 @@
#' @importFrom animation saveGIF
#' @importFrom rlang local_options
#' @importFrom BiocStyle html_document
#' @import RcppParallel
#' @importFrom GEOquery getGEO
#' @importFrom caret train trainControl createDataPartition
#' @importFrom lattice xyplot bwplot histogram
#' @importFrom BiocParallel bplapply bpmapply register
#' @importFrom caretEnsemble caretList caretEnsemble
#' @importFrom parallel detectCores makeCluster
#' @importFrom doParallel registerDoParallel stopImplicitCluster
#' @importFrom dplyr filter select mutate arrange summarise rename distinct
#' @importFrom iml Predictor FeatureImp
#' @importFrom lime explain
#' @importFrom pROC roc ci.auc plot.roc
#' @importFrom pheatmap pheatmap
#' @importFrom randomForest combine randomForest
#' @importFrom survival cluster Surv coxph survfit
#' @importFrom survminer ggsurvplot
#' @importFrom timeROC timeROC
#' @importFrom xgboost slice xgb.DMatrix xgb.train
#' @useDynLib BioGA, .registration = TRUE
## usethis namespace: end
NULL
Loading