R/AutoGeneS.R
build_model_autogenes.Rd
Calculates the signature model with AutoGeneS. This function can be used in case that the signature should be examined. The final signature is stored as a pickle file.
build_model_autogenes(
single_cell_object,
cell_type_annotations,
bulk_gene_expression = NULL,
ngen = 5000,
mode = c("fixed", "standard"),
nfeatures = 500,
weights = list(-1, 1),
objectives = list("correlation", "distance"),
seed = 0,
population_size = 100,
offspring_size = 100,
crossover_pb = 0.7,
mutation_pb = 0.3,
mutate_flip_pb = 0.001,
crossover_thres = 1000,
ind_standard_pb = 0.1,
plot_weights = NULL,
plot_objectives = c(0, 1),
index = NULL,
close_to = NULL,
plot = FALSE,
output_dir = tempdir(),
verbose = FALSE
)
A matrix with the single-cell data. Rows are genes, columns are samples. Row and column names need to be set.
A vector of the cell type annotations. Has to be in the same order as the samples in single_cell_object.
OPTIONAL: A matrix of bulk data. Rows are genes, columns are samples. Row and column names need to be set. If the bulk data is supplied, the single cell object loses all gene rows not contained in the bulk data as not to create solution sets with them.
Number of generations. The higher, the longer it takes.
In standard mode, the number of genes of a selection is allowed to vary arbitrarily. In fixed mode, the number of selected genes is fixed (using nfeatures).
Number of genes to be selected in fixed mode.
Weights applied to the objectives. For the optimization, only the sign is relevant: 1 means to maximize the respective objective, -1 to minimize it and 0 means to ignore it. The weight supplied here will be the default weight for selection. There must be as many weights as there are objectives.
The objectives to maximize or minimize. Must have the same length as weights. The default objectives (correlation, distance) can be referred to using strings. For custom objectives, a function has to be passed.
Seed for random number generators.
Size of every generation (mu parameter).
Number of individuals created in every generation (lambda parameter).
Crossover probability.
Mutation probability.
Mutation flipping probability (fixed mode).
Crossover threshold (standard mode).
Probability used to generate initial population in standard mode.
Plotting: Weights with which to weight the objective values. For example, (-1,2) will minimize the first objective and maximize the the second (with higher weight).
Plotting: The objectives to be plotted. Contains indices of objectives. The first index refers to the objective that is plotted on the x-axis. For example, (2,1) will plot the third objective on the x-axis and the second on the y-axis.
Plotting: If one int is passed, return pareto[index] If two ints are passed, the first is an objective (0 for the first). The second is the nth element if the solutions have been sorted by the objective in ascending order. For example, (0,1) will return the solution that has the second-lowest value in the first objective. (1,-1) will return the solution with the highest value in the second objective.
Plotting: Select the solution whose objective value is closest to a certain value. Assumes (objective,value). For example, (0,100) will select the solution whose value for the first objective is closest to 100.
Whether to produce a plot at all. This just hands over the reticulate plot and has some visualization problems. To get a normal plot, use the pickle file, open it in python and use the plot method there.
path to directory where the picke output file will be saved. Default is tempdir().
Whether to produce an output on the console.
The path to the pickle file needed for the deconvolution with AutoGeneS.