check_ewce_genelist_inputs: check_ewce_genelist_inputs

Description Usage Arguments Value Examples

View source: R/check_ewce_genelist_input.r

Description

check_ewce_genelist_inputs Is used to check that hits and bg gene lists passed to EWCE are setup correctly. Checks they are the appropriate length. Checks all hits genes are in bg. Checks the species match and if not reduces to 1:1 orthologs.

Usage

1
2
3
4
5
6
7
8
check_ewce_genelist_inputs(
  sct_data,
  hits,
  bg,
  genelistSpecies,
  sctSpecies,
  geneSizeControl = FALSE
)

Arguments

sct_data

List generated using generate_celltype_data

hits

Array of MGI/HGNC gene symbols containing the target gene list.

bg

Array of MGI/HGNC gene symbols containing the background gene list.

genelistSpecies

Either 'mouse' or 'human' depending on whether MGI or HGNC symbols are used for gene lists

sctSpecies

Either 'mouse' or 'human' depending on whether MGI or HGNC symbols are used for the single cell dataset

geneSizeControl

Will genelists sampled control for GC content and transcript length? Boolean.

Value

A list containing

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(ewceData)
# Called from "bootstrap_enrichment_test()" and "generate_bootstrap_plots()"
ctd <- ctd()
example_genelist <- example_genelist()
mouse_to_human_homologs <- mouse_to_human_homologs()
m2h <- unique(mouse_to_human_homologs[, c("HGNC.symbol", "MGI.symbol")])
mouse.hits <-
     unique(m2h[m2h$HGNC.symbol %in% example_genelist, "MGI.symbol"])
#subset mouse.bg for speed but ensure it still contains the hits
mouse.bg <- unique(c(m2h$MGI.symbol[1:100],mouse.hits))
checkedLists <- check_ewce_genelist_inputs(
    sct_data = ctd, hits = mouse.hits,
    bg = mouse.bg, genelistSpecies = "mouse", sctSpecies = "mouse"
)

NathanSkene/EWCE documentation built on June 19, 2021, 5:40 a.m.