View source: R/transformationFunctions.R
countsToVariables | R Documentation |
countsToVariables
converts counts table to additional variables.
countsToVariables(counts, dictionary, na.value = NA, nacols.rm = TRUE)
counts |
Data frame with counts, such as returned by
|
dictionary |
Path to file containing variables dictionary or data frame. See details for further explanations. |
na.value |
Vector of length one speciyfing value for variables with no
matching entry in |
nacols.rm |
Logical indicating if result columns that contain only
|
dictionary
file should be a tsv format with header and two columns.
First column should be named "Name"
and hold variable name, second
should be named "Expression"
and hold expression used to identify
variable (eg. "KIR2DL3 & ! KIR2DL2"
will match all samples with
KIR2DL3
and without KIR2DL2
). Optionally a data frame formatted
in the same manner can be passed instead.
Dictionaries shipped with the package:
kir_haplotypes
KIR genes to KIR haplotypes dictionary.
Data frame with variable number of columns. First column named
"ID"
corresponds to "ID"
column in counts
, further
columns hold indicators for converted variables. 1
and 0
code presence and absence of a variable respectively.
countsToVariables(MiDAS_tut_KIR, "kir_haplotypes")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.