Create an object for pulse-change count data
PulseData(counts, conditions, formulas, formulaIndexes = NULL, spikeins = NULL, groups = NULL)
| counts | a matrix; column names correspond to sample names.
The columns in |
|---|---|
| conditions | a data.frame;
the first column corresponds to the conditions given in |
| formulas | a list, created by |
| formulaIndexes | a list of lists (or of vectors); defines indexes of formulas used for calculation of the expected read number. |
| spikeins | NULL (default) or a list of two items:
|
| groups | NULL (default) or a vector or a formula,
e.g. ~ fraction + time.
If the normalisation factors must be recovered during fitting,
If it is NULL, |
an object of class "PulseData"
It is a list with the following slots:
user_conditions, user_formulas, counts are the values of arguments
conditions, formulas and counts, provided to the call of PulseData
rawFormulas is a list of initial formulas, evaluated at the
corresponding conditions (e.g. time in formulas is substituted with
its values in the conditions$time).
formulas is a list of the compiled rawFormulas
formulaIndexes is a list of integers (or vectors) with indexes of formulas
used in estimation of the expression level in a given sample.
The order of list items corresponds to the order of the samples in the
conditions data.frame. See also addKnownToFormulas.
groups is a vector with the names of the sample groups, which is used to
calculate normalisation factors.
depthNormalisation is a list of normalisation factors of the same structure as
formulaIndexes. If no spike-ins are used, these values correspond
to sequencing depth within a given group of samples according to the
groups vector. For example, depth normalisation for a group "pull_down.2hr"
of the pull-down samples after 2 hr of labelling. The relation between
different groups, i.e. "total_fraction", "pull_down.2hr" etc., is
not known and must be recovered during fitting as normFactors values.
If spike-ins are provided, the relation between different fractions
is recovered during the initialisation of the PulseData object and
the values are written to the depthNormalisation slot.
interSampleCoeffs is a list, which structure is used as a sekeleton for the
normalisation factors, if no spike-ins were provided. For every group in
groups, there is a corresponding list item (a number of a numeric vector).
interSampleIndexes describes which normalisation factors to use during
calculation of the mean read count in every sample (an index in the
unlist(interSampleCoeffs))
The conditions argument may include additional columns, which
provide values for known parameters, such as time. Their name must be the
same as defined in formulas. For example, if a formula is defined as
mu * exp(-d * time) where time is the time point of the experiment,
the condition data.frame must contain a column named time, otherwise time
is treated as a parameter to fit!
formulaIndexes <- list( total_fraction = 'total', flow_through = c('unlabelled', 'labelled'), pull_down = c('labelled', 'unlabelled')) # Spike-ins definition for object creation refGroup <- "total_fraction" labelled <- c("spike1", "spike2") unlabelled <- c("spike3", "spike4") spikeLists <- list( # total samples are normalised using all spike-ins total_fraction = list(c(unlabelled, labelled)), # for every item in formulaIndexes we have a set of spike-ins: flow_through = list(unlabelled, labelled), pull_down = list(labelled, unlabelled)) # argument for the function: spikeins <- list(refGroup = refGroup, spikeLists = spikeLists)