Description Usage Arguments Value Author(s) Examples
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
1 | missingByLine(genoTable)
|
genoTable |
Data table where SNPs are rows and lines are columns, no metadata columns. Coded as 0,1,2. |
Returns a data.table object with one row and ncol(genoTable) columns. The row contains the fraction of missing SNP calls for that genotype.
Greg Ziegler
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))])
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.