fix_clonal_genotype: Manage Clonal genotype in data

fix_clonal_genotypeR Documentation

Manage Clonal genotype in data

Description

Fix the absence of the clonal genotype in the data (if needed)

Usage

fix_clonal_genotype(samples, freqs, labels, matching_samples)

Arguments

samples

input dataset (mutational matrix) as matrix

freqs

genotype frequencies (in the rows' order)

labels

list of gene names (in the columns' order)

matching_samples

list of sample names matching each genotype

Value

a named list containing the fixed "samples", "freqs" and "labels"

Examples

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)
if( is.null(compactedDataset$row_names) ){
  compactedDataset$row_names <- rownames(compactedDataset$matrix)
}
matching_samples <- compactedDataset$row_names
# matching_samples
matching_samples 

# fix Colonal genotype absence, if needed
fix <- fix_clonal_genotype(samples, freqs, labels, matching_samples)


redsnic/CIMICE documentation built on March 30, 2022, 2:46 a.m.