setMutClusterParams: Set Mutation Cluster Parameters

Usage Arguments Examples

View source: R/core_mutSignatures_scr_5.R

Usage

1
setMutClusterParams(num_processesToExtract = 2, num_totIterations = 10, num_parallelCores = 1, thresh_removeWeakMutTypes = 0.01, thresh_removeLastPercent = 0.07, distanceFunction = "cosine", num_totReplicates = 100, eps = 2.2204e-16, stopconv = 20000, niter = 1e+06, guided = TRUE, debug = FALSE, approach = "freq", stopRule = "DF", algorithm = "brunet", logIterations = "lite")

Arguments

num_processesToExtract
num_totIterations
num_parallelCores
thresh_removeWeakMutTypes
thresh_removeLastPercent
distanceFunction
num_totReplicates
eps
stopconv
niter
guided
debug
approach
stopRule
algorithm
logIterations

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (num_processesToExtract = 2, num_totIterations = 10, 
    num_parallelCores = 1, thresh_removeWeakMutTypes = 0.01, 
    thresh_removeLastPercent = 0.07, distanceFunction = "cosine", 
    num_totReplicates = 100, eps = 2.2204e-16, stopconv = 20000, 
    niter = 1e+06, guided = TRUE, debug = FALSE, approach = "freq", 
    stopRule = "DF", algorithm = "brunet", logIterations = "lite") 
{
    paramList <- list()
    if (!((is.numeric(num_processesToExtract[1]) & num_processesToExtract[1] > 
        0))) 
        stop("Provide a reasonable number of signatures/processes to extract")
    paramList$num_processesToExtract <- round(num_processesToExtract[1])
    if (!(is.numeric(num_totIterations[1]) & num_totIterations[1] > 
        0)) 
        stop("Provide a reasonable number of iterations to run (Bootstrapping)")
    paramList$num_totIterations <- round(num_totIterations[1])
    if (!(is.numeric(num_parallelCores[1]) & num_parallelCores[1] > 
        0)) 
        stop("Provide a reasonable number of CPU cores to use for the analysis")
    paramList$num_parallelCores <- round(num_parallelCores[1])
    if (!(is.numeric(thresh_removeWeakMutTypes[1]) & thresh_removeWeakMutTypes[1] >= 
        0 & thresh_removeWeakMutTypes[1] < 1)) 
        stop("Provide a reasonable (0.00-0.99) number of low-occurring mutation types to remove from the input before starting the analysis")
    paramList$thresh_removeWeakMutTypes <- thresh_removeWeakMutTypes[1]
    if (!(is.numeric(thresh_removeLastPercent[1]) & thresh_removeLastPercent[1] >= 
        0 & thresh_removeLastPercent[1] < 1)) 
        stop("Provide a reasonable (0.00-0.99) number for filtering out poor iterations")
    paramList$thresh_removeLastPercent <- thresh_removeLastPercent[1]
    allowed.dist.methods <- c("Braun-Blanquet", "Chi-squared", 
        "correlation", "cosine", "Cramer", "Dice", "eDice", "eJaccard", 
        "Fager", "Faith", "Gower", "Hamman", "Jaccard", "Kulczynski1", 
        "Kulczynski2", "Michael", "Mountford", "Mozley", "Ochiai", 
        "Pearson", "Phi", "Phi-squared", "Russel", "simple matching", 
        "Simpson", "Stiles", "Tanimoto", "Tschuprow", "Yule", 
        "Yule2", "Bhjattacharyya", "Bray", "Canberra", "Chord", 
        "divergence", "Euclidean", "fJaccard", "Geodesic", "Hellinger", 
        "Kullback", "Levenshtein", "Mahalanobis", "Manhattan", 
        "Minkowski", "Podani", "Soergel", "supremum", "Wave", 
        "Whittaker")
    if (!(is.character(distanceFunction[1]) & distanceFunction[1] %in% 
        allowed.dist.methods)) 
        stop("Unknown method for calculating distances. For options, run: <<summary(proxy::pr_DB)>>")
    paramList$distanceFunction <- distanceFunction[1]
    if (!(is.numeric(num_totReplicates[1]) & num_totReplicates[1] > 
        99)) 
        stop("Provide a reasonable number of replicates for stability evaluation of the results")
    paramList$num_totReplicates <- round(num_totReplicates[1])
    if (!(is.numeric(eps[1]) & eps[1] > 0 & eps[1] < 1e-04)) 
        stop("Provide a reasonably small number (0 < n < 0.0001) for data overflow prevention")
    paramList$eps <- eps[1]
    if (!(is.numeric(stopconv[1]) & stopconv[1] >= 500)) 
        stop("Provide a reasonable large number: number of 'conn-matrix-stable' iterations before stopping NMF")
    paramList$stopconv <- round(stopconv[1])
    if (!(is.numeric(niter[1]) & niter[1] >= 20000)) 
        stop("Provide a reasonable large number: total NMF iterations")
    paramList$niter <- round(niter[1])
    paramList$guided <- ifelse(guided, TRUE, FALSE)
    paramList$debug <- ifelse(debug, TRUE, FALSE)
    paramList$approach <- ifelse(approach == "counts", "counts", 
        "freq")
    paramList$stopRule <- ifelse(stopRule == "LA", "LA", "DF")
    paramList$algorithm <- ifelse(tolower(algorithm) %in% c("brunet", 
        "alexa"), "brunet", "chihjen")
    paramList$logIterations <- ifelse(tolower(logIterations) %in% 
        c("lite", "light", "li"), "lite", "full")
    return(new(Class = "mutFrameworkParams", params = paramList))
  }

dami82/mutSignatures_dev documentation built on May 17, 2019, 7:02 p.m.