Function to construct an object of class siamcat-class
siamcat(..., feat=NULL, label=NULL, meta=NULL, phyloseq=NULL, validate=TRUE, verbose=3)
feature information for SIAMCAT (see details)
label information for SIAMCAT (see details)
(optional) metadata information for SIAMCAT (see details)
(optional) a phyloseq object for the creation of an SIAMCAT object (see details)
boolean, should the newly constructed SIAMCAT object be validated? defaults to TRUE (we strongly recommend against setting this parameter to FALSE)
A new siamcat-class object
Build siamcat-class objects from their components.
This functions creates a SIAMCAT object (see siamcat-class). In order to do so, the function needs
feat the feature information for SIAMCAT, should be either a
matrix, a data.frame, or a otu_table-class. The columns
should correspond to the different samples (e.g. patients) and the rows the
different features (e.g. taxa). Columns and rows should be named.
meta metadata information for the different samples in the
feature matrix. Metadata is optional for the SIAMCAT workflow. Should be
either a data.frame (with the rownames corresponding to the sample
names of the feature matrix) or an object of class
phyloseq Alternatively to supplying both feat and meta,
SIAMCAT can also work with a phyloseq object containing an otu_table and
other optional slots (like sample_data for meta-variables).
Notice: do supply either the feature information as matrix/data.frame/otu_table (and optionally metadata) or a phyloseq object, but not both.
The label information for SIAMCAT can take several forms:
metadata column: if there is metadata (either via meta or as
sample_data in the phyloseq object), the label object can be created
by taking the information in a specific metadata column. In order to
label should be the name of the column, and
should indicate which group(s) should be the positive group(s). A
typical example could look like that:
siamcat <- siamcat(feat=feat.matrix, meta=metadata,
for the construction of a label to predict CRC status (which is encoded
in the column
"DiseaseState" of the metadata). For more control
(e.g. specific labels for plotting or specific control state), the
label can also be created outside of the
siamcat function using
the create.label function.
named vector: the label can also be supplied as named vector which
encodes the label either as characters (e.g. "Healthy" and "Diseased"),
as factor, or numerically (e.g. -1 and 1). The vector must be named
with the names of samples (corresponding to the samples in features).
Also here, the information about the positive group(s) is needed via
case parameter. Internally, the vector is given to the
# example with package data data("feat_crc_zeller", package="SIAMCAT") data("meta_crc_zeller", package="SIAMCAT") siamcat <- siamcat(feat=feat.crc.zeller, meta=meta.crc.zeller, label='Group', case='CRC') #> + starting create.label #> Label used as case: #> CRC #> Label used as control: #> CTR #> + finished create.label.from.metadata in 0.002 s #> + starting validate.data #> +++ checking overlap between labels and features #> + Keeping labels of 141 sample(s). #> +++ checking sample number per class #> +++ checking overlap between samples and metadata #> + finished validate.data in 0.023 s