ExcludeGenes: Excludes genes.

Description Usage Arguments Examples

Description

Excludes genes whose observations are unusable due to missingness or measurement error.

Usage

1
ExcludeGenes(d, Threshold = 0.5, Type = c("Train", "Test"))

Arguments

d
Threshold
Type

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
##---- 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 (d, Threshold = 0.5, Type = c("Train", "Test")) 
{
    if (Type == "Train") {
        Gene <- d[, 2:(dim(d)[2] - 1)]
    }
    else {
        Gene <- d[, 2:(dim(d)[2])]
    }
    PercentMissing <- apply(Gene, 2, FUN = function(x) {
        return((length(x) - length(na.omit(x)))/length(x))
    })
    Exclusion <- which(PercentMissing >= Threshold)
    ExcludedGenes <- colnames(Gene)[Exclusion]
    if (length(ExcludedGenes) > 0) {
        Dat <- d[, -(Exclusion + 1)]
        Dd <- list(ExcludedGeneList = ExcludedGenes, Data = Dat)
        return(Dd)
    }
    else {
        Dat <- d
        Dd <- list(ExcludedGeneList = ExcludedGenes, Data = Dat)
        return(Dd)
    }
  }

bvnlab/SCATTome documentation built on May 13, 2019, 9:05 a.m.