Skip to content
Permalink
Browse files

added skeletal XGBoost solver and test

  • Loading branch information...
paul-shannon committed Aug 11, 2019
1 parent cb87d57 commit 5b4cc1a1ccc2510bcc327febe021648730d14fcf
@@ -1,8 +1,8 @@
Package: trena
Type: Package
Title: Fit transcriptional regulatory networks using gene expression, priors, machine learning
Version: 1.7.6
Date: 2019-08-07
Version: 1.7.7
Date: 2019-08-10
Author: Seth Ament <seth.ament@systemsbiology.org>, Paul Shannon <pshannon@systemsbioloyg.org>, Matthew Richards <mrichard@systemsbiology.org>
Maintainer: Paul Shannon <paul.thurmond.shannon@gmail.com>
Imports:
@@ -65,6 +65,7 @@ Collate:
'SqrtLassoSolver.R'
'Trena.R'
'VarianceFilter.R'
'XGBoostSolver.R'
'help.R'
'sharedFunctions.R'
'utils.R'
@@ -19,6 +19,7 @@ export(SpearmanSolver)
export(SqrtLassoSolver)
export(Trena)
export(VarianceFilter)
export(XGBoostSolver)
export(getAvailableSolvers)
export(getCandidates)
export(parseChromLocString)
@@ -0,0 +1,51 @@
library(trena)
library(RUnit)
#----------------------------------------------------------------------------------------------------
printf <- function(...) print(noquote(sprintf(...)))
#----------------------------------------------------------------------------------------------------
runTests <- function()
{
test_XGBoostSolverConstructor()
test_ampAD.mef2c.154tfs.278samples.XGBoost()

} # runTests
#----------------------------------------------------------------------------------------------------
test_XGBoostSolverConstructor <- function()
{
printf("--- test_XGBoostSolverConstructor")

mtx <- matrix(1:9,nrow=3)
rownames(mtx) <- c("gene1","gene2","gene3")
solver <- XGBoostSolver(mtx,targetGene = "gene1",
candidateRegulators = c("gene2","gene3"))

checkEquals(class(solver)[1], "XGBoostSolver")
checkTrue(all(c("XGBoostSolver", "Solver") %in% is(solver)))

} # test_XGBoostSolverConstructor
#----------------------------------------------------------------------------------------------------
test_ampAD.mef2c.154tfs.278samples.XGBoost <- function()
{
printf("--- test_ampAD.mef2c.154tfs.278samples.XGBoost")

# Load matrix and transform via arcsinh
load(system.file(package="trena", "extdata/ampAD.154genes.mef2cTFs.278samples.RData"))

mtx.asinh <- asinh(mtx.sub)
target.gene <- "MEF2C"
tfs <- setdiff(rownames(mtx.asinh), "MEF2C")
#print(fivenum(mtx.asinh) # [1] 0.000000 1.327453 3.208193 4.460219 7.628290)

#--------------------------------------------------------------------------------
# temporarily disabled, awaiting a real implementation of the XGBoostSolver
#--------------------------------------------------------------------------------

# XGBoost.solver <- XGBoostSolver(mtx.asinh, target.gene, tfs)
# tbl <- run(XGBoost.solver)

# Check for empirical values
# checkTrue(nrow(subset(tbl, abs(coefficient) > 0.8)) == 9)

} # test_ampAD.mef2c.154tfs.278samples.XGBoost
#----------------------------------------------------------------------------------------------------
if(!interactive()) runTests()

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

0 comments on commit 5b4cc1a

Please sign in to comment.
You can’t perform that action at this time.