gsa.reshape.concordance.table: Reshape a Concordance Table

View source: R/gsa.reshape.concordance.table.R

gsa.reshape.concordance.tableR Documentation

Reshape a Concordance Table

Description

Given a GATKReport generated by GenotypeConcordance (as output by gsa.read.gatkreport), this function reshapes the concordance for a specified sample into a matrix with the EvalGenotypes in rows and the CompGenotypes in columns (see the documentation for GenotypeConcordance for the definition of Eval and Comp)

Usage

gsa.reshape.concordance.table(
  report, 
  table.name="GenotypeConcordance_Counts", 
  sample.name="ALL")

Arguments

report

A GATKReport as output by gsa.read.gatkreport. If table.name is NULL, report is assumed to be the vector of concordance values to reshape.

table.name

The table name in the GATKReport to reshape. Defaults to "GenotypeConcordance_Counts", but could also be one of the proportion tables ("GenotypeConcordance_EvalProportions", "GenotypeConcordance_CompProportions"). This value can also be NULL, in which case report is reshaped directly.

sample.name

The sample name within table.name to use.

Value

Returns a two-dimensional matrix with Eval genotypes in the rows and Comp genotypes in the columns. The genotypes themselves (HOM_REF, NO_CALL, etc) are specified in the row/col names of the matrix.

Author(s)

Phillip Dexheimer

See Also

gsa.read.gatkreport

Examples

test_file = system.file("extdata", "test_genconcord.table", package = "gsalib")
report = gsa.read.gatkreport(test_file)
gsa.reshape.concordance.table(report)

## Output looks like:
##              CompGenotypes
##EvalGenotypes NO_CALL HOM_REF HET HOM_VAR UNAVAILABLE MIXED
##  NO_CALL     0       0       0       0       0           0    
##  HOM_REF     0       0       0       0       0           0    
##  HET         0       0       13463   90      3901        0    
##  HOM_VAR     0       0       2935    18144   4448        0    
##  UNAVAILABLE 0       0       2053693 1326112 11290       0    
##  MIXED       0       0       0       0       0           0  

gsalib documentation built on Oct. 8, 2022, 1:06 a.m.