Get analysis names and add or remove analyses
Usage
Analyses(data, description = FALSE)
AddAnalysis(data, name, table, by = NULL, warn.present = TRUE)
DropAnalysis(data, pattern = NULL)
Arguments
- data
A grandR object
- description
if TRUE, also return the column names of each analysis table (i.e. a list named according to the analyses)
- name
The user-defined analysis name
- table
The analysis table to add
- by
Specify a column that contains gene names or symbols (see details)
- warn.present
Warn if an analysis with the same name is already present (and then overwrite)
- pattern
A regular expression that is matched to analysis names
Value
Either the analysis names or a grandR data with added/removed slots or the metatable to be used with AddAnalysis
Details
The columns in the analysis tables are defined by the analysis method (e.g. "Synthesis","Half-life" and "rmse" by FitKinetics
).
A call to an analysis function might produce more than one table (e.g. because kinetic modeling is done for multiple Conditions). In this case,
AddAnalysisTable produces more than one analysis table.
AddAnalysis
is in most cases not called directly by the user, but is
used by analysis methods to add their final result to a grandR object (e.g., FitKinetics,LikelihoodRatioTest,LFC,PairwiseDESeq2).
If it is called by the user (e.g. to add analysis results from external tools or from the literature, see pulse-chase vignette), then
the user must make sure that either the rownames of the given table can be recognized as genes (names or symbols), or that there is a column in the
table giving genes (this must be specified as the "by" parameter). The table does neither have to be sorted the same way the grandR object is, nor does
it have to be complete. AddAnalysis
will take care or reordering and inserting NA for missing genes (and it will issue a warning in case of missing genes).
Functions
Analyses()
: Obtain the analyses namesAddAnalysis()
: Add an analysis tableDropAnalysis()
: Remove analyses from the grandR object
Examples
sars <- ReadGRAND(system.file("extdata", "sars.tsv.gz", package = "grandR"),
design=c("Cell",Design$dur.4sU,Design$Replicate))
#> Warning: Duplicate gene symbols (n=1, e.g. MATR3) present, making unique!
sars <- Normalize(sars) # default behavior is to update the default slot; this calls AddSlot
Slots(sars)
#> [1] "count" "ntr" "alpha" "beta" "norm"
DefaultSlot(sars)
#> [1] "norm"
sars <- DropSlot(sars,"norm")
sars # note that the default slot reverted to count
#> grandR:
#> Read from /tmp/RtmpzQAFxV/temp_libpath746d2bf75aeb/grandR/extdata/sars
#> 1045 genes, 12 samples/cells
#> Available data slots: count,ntr,alpha,beta
#> Available analyses:
#> Available plots:
#> Default data slot: count