removeWeak: Remove Uncommon Mutation Types

Usage Arguments Examples

Usage

1
removeWeak(input_mutCounts, params)

Arguments

input_mutCounts
params

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
##---- 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 (input_mutCounts, params) 
{
    thresh_removeWeakMutTypes <- params$thresh_removeWeakMutTypes
    sum.counts <- apply(input_mutCounts, 1, sum)
    sum.counts.idx <- order(sum.counts, decreasing = FALSE)
    sorted.sum.counts <- sum.counts[sum.counts.idx]
    tot.mut.counts <- sum(input_mutCounts)
    tot.muttypes.toremove <- sum((sapply(1:length(sorted.sum.counts), 
        (function(i) {
            sum(sorted.sum.counts[1:i])
        }))/tot.mut.counts) < thresh_removeWeakMutTypes)
    return.list <- list()
    if (tot.muttypes.toremove > 0) {
        removed.mutset <- sum.counts.idx[c(1:tot.muttypes.toremove)]
        input_mutCounts <- input_mutCounts[-removed.mutset, ]
        return.list$removed.mutset <- removed.mutset
    }
    else {
        return.list$removed.mutset <- (-1)
    }
    return.list$output.mutCounts <- input_mutCounts
    return(return.list)
  }

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