View source: R/ctprop_cancor.R
ctprop_cancor | R Documentation |
This function calculates celltype proportion for each sample, performs Principal Component Analysis (PCA), calculates correlation/summary statistic based on top K chosen PCs and obtains permutation based p-value.
ctprop_cancor(
cell_meta,
sample_meta,
response_variable,
method,
formula = NULL,
analysis_type = "pearson",
leaves_info,
immediate_children,
component_id = 1,
num_permutations = 100,
alternative = "two.sided",
num_PCs = 2,
verbose = T
)
cell_meta |
A data frame for cell-level metadata, where each row is a cell. Must contain these columns: barcode, celltype and sample. |
sample_meta |
A data frame for sample-level metadata, where each row is a sample. Must contain 'sample' column and additional variables such as covariates or outcome of interest. |
response_variable |
A vector of response variables. Will be used to calculate canonical correlation. |
method |
A character string indicating which approach is used to summarize features. One of 'concat_leaf (default)' or 'concat_immediate_children' or 'aggregate'. |
formula |
An object of class 'formula': a symbolic description of the model to be fitted, adjusting for confounders. |
analysis_type |
|
leaves_info |
A data frame that encodes leaf children for each node. Can be extracted from 'hierarchy_list' by running |
immediate_children |
A data frame that contains immediate children for each node. Can be extracted from 'hierarchy_list' by running |
component_id |
An index to extract canonical correlation component (by default: 1). |
num_permutations |
Number of permutations (by default: 1000). |
alternative |
Specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less". |
num_PCs |
Number of PCs |
verbose |
Show progress |
A list of two elements: the first element is a table of summary statistic for each tree node and second element is a list of PC matrices for each tree node.
Boyang Zhang <bzhang34@jhu.edu>, Hongkai Ji
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.