View source: R/treecor_ctprop.R
treecor_ctprop | R Documentation |
Pipeline for TreeCorTreat using celltype proportion as features
treecor_ctprop(
hierarchy_list,
cell_meta,
sample_meta,
response_variable,
method = "aggregate",
formula = NULL,
separate = T,
analysis_type = "pearson",
num_cancor_components = 1,
num_permutations = 1000,
alternative = "two.sided",
num_PCs = 2,
verbose = T
)
hierarchy_list |
A hierarchy list by running |
cell_meta |
A data frame for cell-level metadata, with cells on the row. 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 to be used in the analysis, such as covariates or outcomes of interest. |
response_variable |
A vector of response variables. Extract these columns from 'sample_meta'. |
method |
A character string indicating which approach is used to summarize features. One of 'aggregate' (default) or 'concat_leaf' or 'concat_immediate_children'. |
formula |
An object of class 'formula': a symbolic description of the model to be fitted, adjusting for confounders. |
separate |
A TRUE (default) or FALSE indicator, specifying how to evaluate multivariate outcomes.
|
analysis_type |
Specify a summary statistic for analysis, must be one of
|
num_cancor_components |
Number of canonical components to be extracted. Only works for multivariate phenotypes when specifying |
num_permutations |
Number of permutations (by default: 1000). |
alternative |
A character string 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
# default setting
result <- treecor_ctprop(hierarchy_list, cell_meta, sample_meta, response_variable = 'severity')
# extract a table of summary statistic for each cell cluster
result[[1]] # or result$canonical_corr
# extract a list of PC matrices for each cell cluster
result[[2]] # or result$pc.ls
# extract PC matrix for celltype 'T'
result$pc.ls[['T']]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.