missingByLine: Takes a recoded (0,1,2) data.table and returns a single row...

Description Usage Arguments Value Author(s) Examples

Description

Takes a recoded (0,1,2) data.table and returns a single row data.table of length ncol with fraction of missing calls for each line

Usage

1
missingByLine(genoTable)

Arguments

genoTable

Data table where SNPs are rows and lines are columns, no metadata columns. Coded as 0,1,2.

Value

Returns a data.table object with one row and ncol(genoTable) columns. The row contains the fraction of missing SNP calls for that genotype.

Author(s)

Greg Ziegler

Examples

1
2
3
4
5
6
7
8
missingByLine(GenotypeData)
missingByLine[,which(missingByLine>0.2),with=F] #3 lines are missing more than 20% of the calls
snp.subset[,colnames(missingByLine[,which(missingByLine>0.2),with=F]) := NULL]

## The function is currently defined as
`missingByLine` <- function(genoTable) {
  return(genoTable[,lapply(.SD,function(x) length(which(is.na(x)))/length(x))])
}

gziegler/ionomicsUtils documentation built on June 20, 2019, 8:04 p.m.