get_driver_genes | R Documentation |
Get genes driving significant MAGMA_celltyping results
Description
Infers the genes driving significant cell-type-specific enrichment results
by computing the mean rank of the adjusted Z-score from the
GWAS gene annotation file ("ADJ_ZSTAT"
) and
the cell-type specificity score from the CellTypeDataset
("specificity_proportion"
).
Usage
get_driver_genes(
ctd,
ctd_species = infer_ctd_species(ctd = ctd),
prepare_ctd = TRUE,
magma_res,
GenesOut_dir,
fdr_thresh = 0.05,
n_genes = 100,
spec_deciles = NULL,
verbose = TRUE,
...
)
Arguments
ctd |
CellTypeData object
|
ctd_species |
Either 'human' or 'mouse'
|
prepare_ctd |
Whether to run
prepare_quantile_groups on the ctd first.
|
magma_res |
Merged results from merge_results.
|
GenesOut_dir |
Folder to search for .genes.out
files implicated in magma_res .
|
fdr_thresh |
FDR threshold for magma_res .
|
n_genes |
Max number of drive genes to return per cell-type enrichment.
|
spec_deciles |
[Optional]
Which "specificity_proportion" deciles to
include when calculating driver genes.
(10 = most specific).
|
verbose |
Print messages.
|
... |
Arguments passed on to EWCE::standardise_ctd
dataset CellTypeData. name.
input_species Which species the gene names in exp come from.
See list_species for all available species.
output_species Which species' genes names to convert exp to.
See list_species for all available species.
sctSpecies_origin Species that the sct_data
originally came from, regardless of its current gene format
(e.g. it was previously converted from mouse to human gene orthologs).
This is used for computing an appropriate backgrund.
non121_strategy How to handle genes that don't have
1:1 mappings between input_species :output_species .
Options include:
"drop_both_species" or "dbs" or 1 :
Drop genes that have duplicate
mappings in either the input_species or output_species
(DEFAULT).
"drop_input_species" or "dis" or 2 :
Only drop genes that have duplicate
mappings in the input_species .
"drop_output_species" or "dos" or 3 :
Only drop genes that have duplicate
mappings in the output_species .
"keep_both_species" or "kbs" or 4 :
Keep all genes regardless of whether
they have duplicate mappings in either species.
"keep_popular" or "kp" or 5 :
Return only the most "popular" interspecies ortholog mappings.
This procedure tends to yield a greater number of returned genes
but at the cost of many of them not being true biological 1:1 orthologs.
"sum","mean","median","min" or "max" :
When gene_df is a matrix and gene_output="rownames" ,
these options will aggregate many-to-one gene mappings
(input_species -to-output_species )
after dropping any duplicate genes in the output_species .
method R package to use for gene mapping:
"gprofiler" : Slower but more species and genes.
"homologene" : Faster but fewer species and genes.
"babelgene" : Faster but fewer species and genes.
Also gives consensus scores for each gene mapping based on a
several different data sources.
force_new_quantiles By default, quantile computation is
skipped if they have already been computed.
Set =TRUE to override this and generate new quantiles.
force_standardise If ctd has already been standardised, whether
to rerun standardisation anyway (Default: FALSE ).
remove_unlabeled_clusters Remove any samples that have
numeric column names.
numberOfBins Number of non-zero quantile bins.
keep_annot Keep the column annotation data if provided.
keep_plots Keep the dendrograms if provided.
as_sparse Convert to sparse matrix.
as_DelayedArray Convert to DelayedArray .
rename_columns Remove replace_chars from column names.
make_columns_unique Rename each columns with the prefix
dataset.species.celltype .
|
Examples
ctd <- ewceData::ctd()
GenesOut_dir <- MAGMA.Celltyping::import_magma_files()
magma_res <- MAGMA.Celltyping::merge_results(
MAGMA.Celltyping::enrichment_results)
genesets <- MAGMA.Celltyping::get_driver_genes(ctd = ctd,
magma_res = magma_res,
GenesOut_dir = GenesOut_dir,
fdr_thresh = 1)