-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
139 additions
and
217 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
Type: Package | ||
Package: BioGA | ||
Title: Bioinformatics Genetic Algorithm (BioGA) | ||
Version: 0.99.0 | ||
Authors@R: | ||
person("Dany", "Mukesha", , "danymukesha@gmail.com", | ||
role = c("aut", "cre"), | ||
comment = c(ORCID = "0009-0001-9514-751X")) | ||
Description: Genetic algorithm are a class of optimization algorithms | ||
inspired by the process of natural selection and genetics. This | ||
package allows users to analyze and optimize high throughput genomic | ||
data using genetic algorithms. The functions provided are implemented | ||
in C++ for improved speed and efficiency, with an easy-to-use | ||
interface for use within R. | ||
License: MIT + file LICENSE | ||
URL: https://danymukesha.github.io/BioGA/ | ||
BugReports: https://github.com/danymukesha/BioGA/issues | ||
Imports: | ||
ggplot2, | ||
graphics, | ||
Rcpp, | ||
sessioninfo, | ||
SummarizedExperiment, | ||
animation, | ||
rlang, | ||
biocViews | ||
Suggests: | ||
knitr, | ||
rmarkdown, | ||
testthat (>= 3.0.0) | ||
LinkingTo: | ||
Rcpp | ||
VignetteBuilder: | ||
knitr | ||
biocViews: ExperimentalDesign, Technology | ||
Encoding: UTF-8 | ||
LazyData: false | ||
Roxygen: list(markdown = TRUE) | ||
RoxygenNote: 7.3.1 | ||
Config/testthat/edition: 3 | ||
Type: Package | ||
Package: BioGA | ||
Title: Bioinformatics Genetic Algorithm (BioGA) | ||
Version: 0.99.2 | ||
Authors@R: | ||
person("Dany", "Mukesha", , "danymukesha@gmail.com", | ||
role = c("aut", "cre"), | ||
comment = c(ORCID = "0009-0001-9514-751X")) | ||
Description: Genetic algorithm are a class of optimization algorithms | ||
inspired by the process of natural selection and genetics. This | ||
package allows users to analyze and optimize high throughput genomic | ||
data using genetic algorithms. The functions provided are implemented | ||
in C++ for improved speed and efficiency, with an easy-to-use | ||
interface for use within R. | ||
License: MIT + file LICENSE | ||
URL: https://danymukesha.github.io/BioGA/ | ||
BugReports: https://github.com/danymukesha/BioGA/issues | ||
Imports: | ||
ggplot2, | ||
graphics, | ||
Rcpp, | ||
sessioninfo, | ||
SummarizedExperiment, | ||
animation, | ||
rlang, | ||
biocViews | ||
Suggests: | ||
knitr, | ||
rmarkdown, | ||
testthat (>= 3.0.0) | ||
LinkingTo: | ||
Rcpp | ||
VignetteBuilder: | ||
knitr | ||
biocViews: ExperimentalDesign, Technology | ||
Encoding: UTF-8 | ||
LazyData: false | ||
Roxygen: list(markdown = TRUE) | ||
RoxygenNote: 7.3.1 | ||
Config/testthat/edition: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# BioGA 0.99.0 | ||
|
||
* Added a `NEWS.md` file to track changes to the package. | ||
# BioGA 0.99.2 | ||
|
||
# BioGA 0.99.1 | ||
|
||
# BioGA 0.99.0 | ||
|
||
* Added a `NEWS.md` file to track changes to the package. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#' Plot Fitness Change Over Generations | ||
#' | ||
#' Plot the change in fitness values over generations. | ||
#' | ||
#' @param fitness_history A list containing fitness values for | ||
#' each generation. | ||
#' | ||
#' @return Plot of fitness history | ||
#' | ||
#' @examples | ||
#' # example of usage | ||
#' fitness_history <- list(c(10, 8, 6, 4, 2), c(9, 7, 5, 3, 1)) | ||
#' plot_fitness_history(fitness_history) | ||
#' | ||
#' @export | ||
plot_fitness_history <- function(fitness_history) { | ||
# Extract fitness values | ||
fitness_values <- unlist(fitness_history) | ||
|
||
# Create generation index | ||
generations <- | ||
rep( | ||
seq_along(fitness_history), | ||
vapply(fitness_history, length, integer(1)) | ||
) | ||
|
||
# Create data frame | ||
df <- data.frame( | ||
Generation = generations, | ||
Fitness = fitness_values | ||
) | ||
|
||
# Plot | ||
ggplot2::ggplot(df, ggplot2::aes_string( | ||
x = "Generation", | ||
y = "Fitness" | ||
)) + | ||
geom_line() + | ||
labs(x = "Generation", y = "Fitness") + | ||
ggplot2::ggtitle("Fitness Change Over Generations") | ||
} | ||
|
||
|
||
|
||
#' Plot Fitness Values | ||
#' | ||
#' Plot the fitness values of the population over generations. | ||
#' | ||
#' @param fitness_values A numeric vector containing fitness values. | ||
#' | ||
#' @return Plot of fitness | ||
#' | ||
#' @examples | ||
#' # example of usage | ||
#' fitness_values <- c(10, 8, 6, 4, 2) | ||
#' plot_fitness(fitness_values) | ||
#' | ||
#' @export | ||
plot_fitness <- function(fitness_values) { | ||
generations <- seq_along(fitness_values) | ||
plot(generations, fitness_values, | ||
type = "l", | ||
xlab = "Generations", ylab = "Fitness", | ||
main = "Fitness Values Over Generations" | ||
) | ||
} | ||
|
||
|
||
#' Plot Population Distribution | ||
#' | ||
#' Plot the distribution of individuals in the population. | ||
#' | ||
#' @param population A numeric matrix containing the population data. | ||
#' | ||
#' @return Plot of population | ||
#' | ||
#' @import graphics | ||
#' | ||
#' @examples | ||
#' # example of usage | ||
#' population <- matrix(runif(100), nrow = 10, ncol = 10) | ||
#' plot_population(population) | ||
#' | ||
#' @export | ||
plot_population <- function(population) { | ||
par(mfrow = c(1, 2)) | ||
boxplot(population, main = "Boxplot of Population") | ||
hist(population, main = "Histogram of Population") | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.