Skip to content
Permalink
Browse files

more cleanup

  • Loading branch information...
paul-shannon committed May 23, 2019
1 parent b1d629f commit b0ff4d2a4033ca6cc55d5a8735cb4fe1acb8a10b
Showing with 73 additions and 72 deletions.
  1. +1 −0 .gitignore
  2. +1 −1 DESCRIPTION
  3. +69 −69 inst/unitTests/test_Trena.R
  4. +2 −2 man/getRegulatoryRegions.Rd
@@ -1,3 +1,4 @@
.DS_Store
Meta
doc
.Rhistory
@@ -1,7 +1,7 @@
Package: trena
Type: Package
Title: Fit transcriptional regulatory networks using gene expression, priors, machine learning
Version: 1.7.3
Version: 1.7.4
Date: 2019-05-23
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>
@@ -25,8 +25,8 @@ runTests <- function()
test_createGeneModelFromRegulatoryRegions()
test_createGeneModelFromTfList()

test_getProximalPromoterHuman()
test_getProximalPromoterMouse()
# test_getProximalPromoterHuman()
# test_getProximalPromoterMouse()

checkEquals(openPostgresConnections(), 0)

@@ -235,73 +235,73 @@ test_createGeneModelFromTfList <- function()

} # test_createGeneModelFromTfList
#----------------------------------------------------------------------------------------------------
test_getProximalPromoterHuman <- function()
{
printf("--- test_getProximalPromoterHuman")

if(!interactive())
return(TRUE)

trena <- Trena("hg38")

# Designate the MEF2C gene and a shoulder size of 1000
geneSymbol <- "MEF2C"
tssUpstream <- 1000
tssDownstream <- 1000

# Pull the regions for MEF2C
regions <- getProximalPromoter(trena, geneSymbol, tssUpstream, tssDownstream)

# Check the type of data returned and its size
checkEquals(dim(regions), c(1,4))
checkEquals(class(regions), "data.frame")
checkEquals(with(regions, end - start), tssUpstream + tssDownstream)

# check with bogus gene symbol
checkTrue(is.na(getProximalPromoter(trena, "bogus", tssUpstream, tssDownstream)))

# Test it on a list, with one real and one bogus, and make sure its the same as the first
genes.of.interest <- c(geneSymbol, "bogus")
regions.2 <- getProximalPromoter(trena, genes.of.interest, tssUpstream, tssDownstream)
checkEquals(regions, regions.2)

} # test_getProximalPromoterHuman
#----------------------------------------------------------------------------------------------------
test_getProximalPromoterMouse <- function(){

printf("--- test_getProximalPromoterMouse")

if(!interactive())
return(TRUE)

trena <- Trena("mm10")

# Designate the Twist2 gene and a shoulder size of 1000
geneSymbol <- "Twist2"
tssUpstream <- 1000
tssDownstream <- 1000

# Pull the regions for Twist2
regions <- getProximalPromoter(trena, geneSymbol, tssUpstream, tssDownstream)

# Check the type of data returned and its size
checkEquals(dim(regions), c(1,4))
checkEquals(class(regions), "data.frame")

# Check the nominal values (tss = 88904257)
tss <- 91801461
checkEquals(regions$chrom, "chr1")
checkEquals(regions$start, tss - tssUpstream)
checkEquals(regions$end, tss + tssDownstream)

# check with bogus gene symbol
checkTrue(is.na(getProximalPromoter(trena, "bogus", tssUpstream, tssDownstream)))

# Test it on a list, with one real and one bogus, and make sure its the same as the first
regions.2 <- getProximalPromoter(trena, c(geneSymbol, "bogus"), tssUpstream, tssDownstream)
checkEquals(regions, regions.2)

} # test_getProximalPromoterMouse
# test_getProximalPromoterHuman <- function()
# {
# printf("--- test_getProximalPromoterHuman")
#
# if(!interactive())
# return(TRUE)
#
# trena <- Trena("hg38")
#
# # Designate the MEF2C gene and a shoulder size of 1000
# geneSymbol <- "MEF2C"
# tssUpstream <- 1000
# tssDownstream <- 1000
#
# # Pull the regions for MEF2C
# regions <- getProximalPromoter(trena, geneSymbol, tssUpstream, tssDownstream)
#
# # Check the type of data returned and its size
# checkEquals(dim(regions), c(1,4))
# checkEquals(class(regions), "data.frame")
# checkEquals(with(regions, end - start), tssUpstream + tssDownstream)
#
# # check with bogus gene symbol
# checkTrue(is.na(getProximalPromoter(trena, "bogus", tssUpstream, tssDownstream)))
#
# # Test it on a list, with one real and one bogus, and make sure its the same as the first
# genes.of.interest <- c(geneSymbol, "bogus")
# regions.2 <- getProximalPromoter(trena, genes.of.interest, tssUpstream, tssDownstream)
# checkEquals(regions, regions.2)
#
# } # test_getProximalPromoterHuman
# #----------------------------------------------------------------------------------------------------
# test_getProximalPromoterMouse <- function(){
#
# printf("--- test_getProximalPromoterMouse")
#
# if(!interactive())
# return(TRUE)
#
# trena <- Trena("mm10")
#
# # Designate the Twist2 gene and a shoulder size of 1000
# geneSymbol <- "Twist2"
# tssUpstream <- 1000
# tssDownstream <- 1000
#
# # Pull the regions for Twist2
# regions <- getProximalPromoter(trena, geneSymbol, tssUpstream, tssDownstream)
#
# # Check the type of data returned and its size
# checkEquals(dim(regions), c(1,4))
# checkEquals(class(regions), "data.frame")
#
# # Check the nominal values (tss = 88904257)
# tss <- 91801461
# checkEquals(regions$chrom, "chr1")
# checkEquals(regions$start, tss - tssUpstream)
# checkEquals(regions$end, tss + tssDownstream)
#
# # check with bogus gene symbol
# checkTrue(is.na(getProximalPromoter(trena, "bogus", tssUpstream, tssDownstream)))
#
# # Test it on a list, with one real and one bogus, and make sure its the same as the first
# regions.2 <- getProximalPromoter(trena, c(geneSymbol, "bogus"), tssUpstream, tssDownstream)
# checkEquals(regions, regions.2)
#
# } # test_getProximalPromoterMouse
#----------------------------------------------------------------------------------------------------
test_assessSnp <- function()
{

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

0 comments on commit b0ff4d2

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