Description Usage Arguments Value Category Filter See Also Examples
This function fits the COMPASS
model.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | COMPASS(
data,
treatment,
control,
subset = NULL,
category_filter = function(x) colSums(x > 5) > 2,
filter_lowest_frequency = 0,
filter_specific_markers = NULL,
model = "discrete",
iterations = 40000,
replications = 8,
keep_original_data = FALSE,
verbose = TRUE,
dropDegreeOne = FALSE,
init_with_fisher = FALSE,
...
)
|
data |
An object of class |
treatment |
An R expression, evaluated within the metadata, that
returns |
control |
An R expression, evaluated within the metadata, that
returns |
subset |
An expression used to subset the data. We keep only the samples
for which the expression evaluates to |
category_filter |
A filter for the categories that are generated. This is a
function that will be applied to the treatment counts matrix generated from
the intensities. Only categories meeting the |
filter_lowest_frequency |
A number specifying how many of the least expressed markers should be removed. |
filter_specific_markers |
Similar to |
model |
A string denoting which model to fit; currently, only
the discrete model ( |
iterations |
The number of iterations (per 'replication') to perform. |
replications |
The number of 'replications' to perform. In order to conserve memory, we only keep the model estimates from the last replication. |
keep_original_data |
Keep the original |
verbose |
Boolean; if |
dropDegreeOne |
Boolean; if |
init_with_fisher |
Boolean;initialize from fisher's exact test. Any subset and subject with lower 95 Otherwise initialize very subject and subset as a responder except those where ps <= pu. |
... |
Other arguments; currently unused. |
A COMPASSResult
is a list with the following components:
fit |
A list of various fitted parameters resulting from the
|
data |
The data used as input to the |
orig |
If |
The fit
component is a list with the following components:
alpha_s |
The hyperparameter shared across all subjects under the
stimulated condition. It is updated through the |
A_alphas |
The acceptance rate of |
alpha_u |
The hyperparameter shared across all subjects under the
unstimulated condition. It is updated through the |
A_alphau |
The acceptance rate of |
gamma |
An array of dimensions |
mean_gamma |
A matrix of mean response rates. Each cell denotes
the mean response of individual |
A_gamma |
The acceptance rate for the gamma. Each element
corresponds to the number of times an individual's |
categories |
The category matrix, showing which categories entered the model. |
model |
The type of model called. |
posterior |
Posterior measures from the sample fit. |
call |
The matched call used to generate the model fit. |
The data
component is a list with the following components:
n_s |
The counts matrix for stimulated samples. |
n_u |
The counts matrix for unstimulated samples. |
counts_s |
Total cell counts for stimulated samples. |
counts_u |
Total cell counts for unstimulated samples. |
categories |
The categories matrix used to define which categories will enter the model. |
meta |
The metadata. Note that only individual-level metadata will be kept; sample-specific metadata is dropped. |
sample_id |
The name of the vector in the metadata used to identify the samples. |
individual_id |
The name of the vector in the metadata used to identify the individuals. |
The orig
component (included if keep_original_data
is
TRUE
) is the COMPASSContainer
object used in the model
fit.
The category filter is used to exclude categories (combinations of
markers expressed for a particular cell) that are expressed very rarely.
It is applied to the treatment
counts matrix, which is a
N
samples by K
categories matrix. Those categories which
are mostly unexpressed can be excluded here. For example, the default
criteria,
category_filter=function(x) colSums(x > 5) > 2
indicates that we should only retain categories for which at least three samples had at least six cells expressing that particular combination of markers.
COMPASSContainer
, for constructing the data object
required by COMPASS
1 2 3 4 5 6 7 8 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.