runCIE: Run Causual Inference Enrichment

View source: R/runCIE.R

runCIER Documentation

Run Causual Inference Enrichment

Description

Runs inference models selected on network selected, with differentially expressed genes provided, and with methods requested.

Usage

runCIE(databaseType = c("TRED", "string", "ChIP", "TRRUST"), filter = FALSE,
                              DGEs, p.thresh = 0.05, fc.thresh=log(1.5),
                              methods,
                              filteredDataName=NA, ents=NA, rels=NA, useFile=TRUE,
                              useMart=FALSE, useBHLH=FALSE, martFN=NA, BHLHFN=NA,
                              targetsOfInterest=NA
                              hypTabs= c("1", "2"), verbose=T, databaseDir = NA,
                              expectProgressObject=FALSE,
                              progress=NA, numCores=NA)

Arguments

databaseType

Currently we only support selecting one database at a time. Using this option and having the database automatically loaded for you only currently works if your working directory is the folder where this script exists in the package. You may also override the path it uses to look for the databse with the parameter databaseDir. There are ways to overide this and get the databse from the environment (see parameters ents and rels). If not needed, enter NULL.

filter

If using the repositories that come with this function, and you have made filter ChIP Atlas save the filtered data to file, use this option as TRUE. If your data is not in the data folder with the format ChIPfilter.rels|ents, please specify a full path with parameter filteredDataName. If you are not reading from file, enter NULL.

DGEs

Either a list of dataframes of differentally expressed gene data, or a single data frame. Must have columns consisting of p or q value, fold change, and entrez id.

p.thresh

0.05 by default, used as a cuttoff for filtering the DGEs by their q or p value.

ents

Optional argument, specifies a .ents table that you have in your environment in the event that you did not wish to write the .rels or .ents tables to file

rels

Optional argument, specifies a .rels table that you have in your environment in the event that you did not wish to write the .rels or .ents tables to file. **NOTE** You cannot mix and match your sources of .rels and .ents tables at this time. If supplying as data frames from environment, none can be read from file and visa versa

useFile

Boolean value, indicating the source of the database. If using the els and rels paramters, set this to FALSE. Otherwise, the default is TRUE

useMart

Boolean value, indicating whether you are adding additional information to your enrichment about whether or not an entry is TF. If you are, you must supply a valid martFN. Default value for this is false.

useBHLH

Boolean value, indicating whether you are adding additional information to your enrichment about whether or not this enry is a BHLH. If you are, you must supply a valid BHLHFN. Default value for this is false

martFN

The full path to the file where the Mart Human TF data can be found

BHLHFN

The full path to the file where the BHLH information can be found

hypTabs

One of 1 or 2, indicating which hypTab function you wish to use

verbose

Make output verbose, true by default

databaseDir

The path where the .rels and .ents files for a given Database type can be found.

expectProgressObject

Boolean, a switch to use a shiny progress bar instead of text progress bar.

progress

Optional parameter, specifying a shiny progress bar to be updated.

numCores

Optional parameter, specifies number of cores

fc.thres

log(1.5) by default, used as cutoff for filtering the DGEs by their fold change

targetsOfIntrest

A vector of strings of targets that you want to show whether or not a protien targets in the analysis.

Value

Either a single data frame or list of data frames, depending on the number of methods and DGEs provided, which contain the enrichment results (if a list, they are named with the methods and the original names of the DGE list)

Examples


## This example assumes that you have differential gene expression
## files ending in "edgeR.txt" in the current working directory and
## that the database directory is "../data".  The filtering
## parameters for ChIP in this instance are tailored for the
## experiment, namely restricting results to interactions observed
## in prostatic tissues.  For information about filtering the ChIP
## Atlas database, please visit our Wiki or review the
## documentation for filterChIPAtlas.
## Please note that if you ever
## wish to run enrichment on multiple conditions you may do so in
## the following manner and have your results be accessible by
## [out var name]$[method, if more than one]$[name of dge table
## named list]
## ex. enrichment$cell_line_cxcl12_tgfb_evidence_edgeR.txt
## ex. enrichment[[1]]
## Or as shown below:

ChIP1ap <- filterChIPAtlas(1, NA, "auto", NA, "prostate", NA, NA, FALSE)
files <- list.files("./", "edgeR.txt")
dges <- lapply(files, function(x) {
   read.table(x, header=T, sep="\t") } )
names(dges) <- files
methods <- c("Enrichment", "Fisher")
enrichment <- runCIE(NULL, NULL, DGEs=dges,
                     method = methods,
                     ents=ChIP1ap$filteredChIP.ents,
                     rels=ChIP1ap$filteredChIP.rels,
                     useFile=F, useMart=TRUE, useBHLH=TRUE,
                     martFN="../CIE/data/mart_human_TFs.csv",
                     BHLHFN="../CIE/data/BHLH_TFs.txt")
View(enrichment$Fisher$cell_line_cxcl12_tgfb_evidence_edgeR.txt)


umbibio/CIE-R-Package documentation built on Sept. 26, 2023, 3:37 a.m.