fix_clonal_genotype {CIMICE} | R Documentation |
Fix the absence of the clonal genotype in the data (if needed)
fix_clonal_genotype(samples, freqs, labels)
samples |
input dataset (mutational matrix) as matrix |
freqs |
genotype frequencies (in the rows' order) |
labels |
list of gene names (in the columns' order) |
a named list containing the fixed "samples", "freqs" and "labels"
require(dplyr) # compact compactedDataset <- compact_dataset(example_dataset()) samples <- compactedDataset$matrix # save genes' names genes <- colnames(compactedDataset$matrix) # keep the information on frequencies for further analysis freqs <- compactedDataset$counts/sum(compactedDataset$counts) # prepare node labels listing the mutated genes for each node labels <- prepare_labels(samples, genes) # fix Colonal genotype absence, if needed fix <- fix_clonal_genotype(samples, freqs, labels) samples <- fix[["samples"]] freqs <- fix[["freqs"]] labels <- fix[["labels"]] list("samples" = samples, "freqs" = freqs, "labels" = labels, "genes" = genes)