createGeneModelFromRegulatoryRegions: Create a model for a target gene using a Trena object

createGeneModelFromRegulatoryRegions,Trena-methodR Documentation

Create a model for a target gene using a Trena object

Description

Create a model for a target gene using a Trena object

Usage

## S4 method for signature 'Trena'
createGeneModelFromRegulatoryRegions(
  obj,
  targetGene,
  solverNames,
  tbl.regulatoryRegions,
  mtx
)

Arguments

obj

An object of class Trena

targetGene

The name of a target gene to use for building a model

solverNames

A character vector containing the solver names to be used for building the model

tbl.regulatoryRegions

A data frame of regulatory regions, typically generated by using a filter

mtx

An assay matrix of expression data

Value

A data frame containing the gene model

Examples

if(interactive()){  # takes too long for the bioconductor build
   # Create a Trena object for human and make a gene model for "MEF2C" using a footprint filter
   trena <- Trena("hg38")
   chromosome <- "chr5"
   mef2c.tss <- 88904257
   loc.start <- mef2c.tss - 1000
   loc.end   <- mef2c.tss + 1000

   database.filename <- system.file(package="trena", "extdata", "mef2c.neigborhood.hg38.footprints.db")
   database.uri <- sprintf("sqlite://%s", database.filename)
   sources <- c(database.uri)
   load(system.file(package="trena", "extdata/ampAD.154genes.mef2cTFs.278samples.RData"))

   motifs.list <- getRegulatoryChromosomalRegions(trena, chromosome, mef2c.tss-1000, mef2c.tss+1000,
   sources, "MEF2C", mef2c.tss)

   library(MotifDb)
   tbl.motifs.tfs <- associateTranscriptionFactors(MotifDb, motifs.list[[1]], source="MotifDb", expand.rows=TRUE)
   model.mef2c <- createGeneModelFromRegulatoryRegions(trena, "MEF2C", c("lasso","ridge","randomforest"),
                                                       tbl.motifs.tfs, mtx.sub)
   } # if interactive

PriceLab/TReNA documentation built on March 21, 2023, 1:57 p.m.