View source: R/calculate_conditional_celltype_enrichment_limma.R
calculate_conditional_celltype_enrichment_limma | R Documentation |
Calculate celltype enrichments without MAGMA using adjusted MAGMA Z-statistic from .genes.out files.
calculate_conditional_celltype_enrichment_limma(
magma1,
magma2,
ctd,
ctd_species = infer_ctd_species(ctd),
annotLevel = 1,
prepare_ctd = TRUE,
thresh = 1e-04,
show_plot = TRUE,
verbose = TRUE,
...
)
magma1 |
Output from adjust_zstat_in_genesOut (e.g. trait 1). |
magma2 |
Output from adjust_zstat_in_genesOut (e.g. trait 2). |
ctd |
Cell type data structure containing
|
ctd_species |
Species name relevant to the CellTypeDataset ( |
annotLevel |
Level within the |
prepare_ctd |
Whether to run
prepare_quantile_groups on the |
thresh |
A threshold on low specificity values (used to drop genes). |
show_plot |
Show plot visualizations of results (Default: |
verbose |
Print messages. |
... |
Additional arguments passed to standardise_ctd. |
Data.frame with conditional enrichment results.
ctd <- ewceData::ctd()
#### MAGMA 1 #####
genesOut1 <- MAGMA.Celltyping::import_magma_files(
ids = c("ieu-a-298"),
file_types = ".genes.out",
return_dir = FALSE)
magma1 <- MAGMA.Celltyping::adjust_zstat_in_genesOut(
ctd = ctd,
magma_GenesOut_file = genesOut1)
#### MAGMA 2 #####
genesOut2 <- MAGMA.Celltyping::import_magma_files(
ids = c("ukb-a-333"),
file_types = ".genes.out",
return_dir = FALSE)
magma2 <- MAGMA.Celltyping::adjust_zstat_in_genesOut(
ctd = ctd,
magma_GenesOut_file = genesOut2)
#### Run conditional enrichment ####
cond_res <-
MAGMA.Celltyping::calculate_conditional_celltype_enrichment_limma(
magma1 = magma1,
magma2 = magma2,
ctd = ctd)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.