Skip to contents

R6 class implementing multi-objective gene selection using NSGA-II algorithm. Use the darwin constructor function to create instances.

Public fields

None directly exposed. Use methods to access data.

Public methods

initialize(data, ...)

Create a new Darwin object. See darwin.

optimize(ngen, mode, ...)

Run the NSGA-II optimization algorithm.

plot()

Plot the Pareto front.

select(weights, index, close_to)

Select a solution from the Pareto front.

get_genes()

Get names of selected genes.

get_selection()

Get logical vector of gene selection.

get_pareto()

Get all Pareto-optimal solutions.

get_fitness()

Get fitness values for Pareto front.

deconvolve(bulk, method)

Perform bulk RNA-seq deconvolution.

save(path)

Save object to file.

print()

Print object summary.

See also

darwin for the constructor function.

Examples

# Create example data
set.seed(42)
data <- matrix(rnorm(500), nrow = 5, ncol = 100)
rownames(data) <- paste0("CellType", 1:5)
colnames(data) <- paste0("Gene", 1:100)

# Create and use Darwin object
dw <- darwin(data)  # Using constructor function
#> v Initialized darwin with 5 cell types and 100 genes
dw$optimize(ngen = 5, verbose = FALSE, parallel = FALSE)
dw$select()
#> v Selected solution #1 with 82 genes
genes <- dw$get_genes()