Skip to content

Commit

Permalink
unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
GuangchuangYu committed Aug 15, 2016
1 parent f60b631 commit 6809ad5
Show file tree
Hide file tree
Showing 17 changed files with 311 additions and 54 deletions.
4 changes: 4 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
.svnignore
^.*\.DS_Store
Makefile
.travis.yml
appveyor.yml
README.Rmd
3 changes: 3 additions & 0 deletions .svnignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
.git
Makefile
README.Rmd
appveyor.yml
.travis.yml
46 changes: 46 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
## reference: http://docs.travis-ci.com/user/languages/r/

language: r
r:
- devel
- bioc-devel

cache: packages
bioc_required: true
bioc_use_devel: true

os:
- linux
- osx


env:
global:
- _R_CHECK_FORCE_SUGGESTS_=False
- R_LIBS="http://cran.rstudio.com"

r_packages:
- knitr
- rmarkdown

bioc_packages:
- DO.db
- org.Hs.eg.db
- DOSE
- reactome.db

after_failure:
- ./travis-tool.sh dump_logs

r_github_packages:
- jimhester/covr

after_success:
- Rscript -e 'library(covr); codecov()'

notifications:
email:
recipients: [email protected]
on_success: never
on_failure: always

5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: ReactomePA
Type: Package
Title: Reactome Pathway Analysis
Version: 1.17.3
Version: 1.17.4
Authors@R: c(person(given = "Guangchuang", family = "Yu",
email = "[email protected]",
role = c("aut", "cre")),
Expand All @@ -26,7 +26,8 @@ Suggests:
BiocStyle,
clusterProfiler,
knitr,
org.Hs.eg.db
org.Hs.eg.db,
testthat
VignetteBuilder: knitr
ByteCompile: true
License: GPL-2
Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ PKGNAME := $(shell sed -n "s/Package: *\([^ ]*\)/\1/p" DESCRIPTION)
PKGVERS := $(shell sed -n "s/Version: *\([^ ]*\)/\1/p" DESCRIPTION)
PKGSRC := $(shell basename `pwd`)

all: check clean
all: readme check clean

docs:
Rscript -e 'roxygen2::roxygenise(".")'

readme:
Rscript -e 'rmarkdown::render("README.Rmd")'

build:
cd ..;\
R CMD build $(PKGSRC)
Expand All @@ -19,6 +22,10 @@ check: build
cd ..;\
R CMD check $(PKGNAME)_$(PKGVERS).tar.gz

bioccheck:
cd ..;\
Rscript -e 'BiocCheck::BiocCheck("$(PKGNAME)_$(PKGVERS).tar.gz")'

clean:
cd ..;\
$(RM) -r $(PKGNAME).Rcheck/
Expand Down
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
CHANGES IN VERSION 1.17.4
------------------------
o unit test <2016-08-15, Mon>

CHANGES IN VERSION 1.17.3
------------------------
o move getDb from GOSemSim (no longer need this function) to ReactomePA and remove dependency of GOSemSim <2016-07-06, Wed>
Expand Down
74 changes: 74 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
output:
md_document:
variant: markdown_github
html_preview: false
---

# ReactomePA: Reactome Pathway Analysis

[![platform](http://www.bioconductor.org/shields/availability/devel/ReactomePA.svg)](https://www.bioconductor.org/packages/devel/bioc/html/ReactomePA.html#archives)
[![Build Status](http://www.bioconductor.org/shields/build/devel/bioc/ReactomePA.svg)](https://bioconductor.org/checkResults/devel/bioc-LATEST/ReactomePA/)
[![Linux/Mac Travis Build Status](https://img.shields.io/travis/GuangchuangYu/ReactomePA/master.svg?label=Mac%20OSX%20%26%20Linux)](https://travis-ci.org/GuangchuangYu/ReactomePA)
[![AppVeyor Build Status](https://img.shields.io/appveyor/ci/Guangchuangyu/ReactomePA/master.svg?label=Windows)](https://ci.appveyor.com/project/GuangchuangYu/ReactomePA)
[![install with bioconda](https://img.shields.io/badge/install%20with-bioconda-green.svg?style=flat)](http://bioconda.github.io/recipes/bioconductor-reactomepa/README.html)

[![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)
[![codecov](https://codecov.io/gh/GuangchuangYu/ReactomePA/branch/master/graph/badge.svg)](https://codecov.io/gh/GuangchuangYu/ReactomePA/)
[![Last-changedate](https://img.shields.io/badge/last%20change-`r gsub('-', '--', Sys.Date())`-green.svg)](https://github.com/GuangchuangYu/ReactomePA/commits/master)
[![commit](http://www.bioconductor.org/shields/commits/bioc/ReactomePA.svg)](https://www.bioconductor.org/packages/devel/bioc/html/ReactomePA.html#svn_source)
[![GitHub forks](https://img.shields.io/github/forks/GuangchuangYu/ReactomePA.svg)](https://github.com/GuangchuangYu/ReactomePA/network)
[![GitHub stars](https://img.shields.io/github/stars/GuangchuangYu/ReactomePA.svg)](https://github.com/GuangchuangYu/ReactomePA/stargazers)


[![releaseVersion](https://img.shields.io/badge/release%20version-`r url="https://bioconductor.org/packages/release/bioc/html/ReactomePA.html"; x=readLines(url); gsub("\\D+(\\d+\\.\\d+\\.\\d+)\\D+", "\\1", x[grep("Version", x) +1])`-green.svg?style=flat)](https://bioconductor.org/packages/ReactomePA)
[![develVersion](https://img.shields.io/badge/devel%20version-`r x=readLines("DESCRIPTION"); y=x[grep("^Version", x)]; sub("Version: ", "", y)`-green.svg?style=flat)](https://github.com/GuangchuangYu/ReactomePA)
[![Bioc](http://www.bioconductor.org/shields/years-in-bioc/ReactomePA.svg)](https://www.bioconductor.org/packages/devel/bioc/html/ReactomePA.html#since)
[![post](http://www.bioconductor.org/shields/posts/ReactomePA.svg)](https://support.bioconductor.org/t/ReactomePA/)
[![download](http://www.bioconductor.org/shields/downloads/ReactomePA.svg)](https://bioconductor.org/packages/stats/bioc/ReactomePA/)


This package provides functions for pathway analysis based on REACTOME pathway database. It implements enrichment analysis, gene set enrichment analysis and several functions for visualization.

[![Twitter](https://img.shields.io/twitter/url/https/github.com/GuangchuangYu/ReactomePA.svg?style=social)](https://twitter.com/intent/tweet?hashtags=ReactomePA&url=https://guangchuangyu.github.io/ReactomePA)

------------------------------------------------------------------------

Please cite the following article when using `ReactomePA`:

__*G Yu*__, QY He^\*^. ReactomePA: an R/Bioconductor package for reactome pathway analysis and visualization. __*Molecular BioSystems*__ 2016, 12(2):477-479.

[![doi](https://img.shields.io/badge/doi-1039/c5mb00663e-green.svg?style=flat)](http://dx.doi.org/1039/c5mb00663e)
[![citation](https://img.shields.io/badge/cited%20by-`r library(scholar); sum(get_article_cite_history('DO5oG40AAAAJ', '8d8msizDQcsC')$cites)`-green.svg?style=flat)](https://scholar.google.com.hk/scholar?oi=bibs&hl=en&cites=16627502277303919270,2188293597650690793,16774578204592269646,17800543858983923015)

------------------------------------------------------------------------

For details, please visit our project website, <https://guangchuangyu.github.io/ReactomePA>.

+ [Documentation](https://guangchuangyu.github.io/ReactomePA/documentation/)
+ [Featured Articles](https://guangchuangyu.github.io/ReactomePA/featuredArticles/)
+ [Feedback](https://guangchuangyu.github.io/ReactomePA/#feedback)

### Citation

[![citation](https://img.shields.io/badge/cited%20by-`r library(scholar); sum(get_article_cite_history('DO5oG40AAAAJ', '8d8msizDQcsC')$cites)`-green.svg?style=flat)](https://scholar.google.com.hk/scholar?oi=bibs&hl=en&cites=3311691878690959578)


```{r echo=F, comment=NA}
d <- scholar::get_article_cite_history('DO5oG40AAAAJ', '8d8msizDQcsC')
txtplot::txtplot(d$year, d$cites)
```

### Download stats

[![download](http://www.bioconductor.org/shields/downloads/ReactomePA.svg)](https://bioconductor.org/packages/stats/bioc/ReactomePA/)
[![total](https://img.shields.io/badge/downloads-`r sum(dlstats::bioc_stats("ReactomePA")$Nb_of_downloads)`/total-blue.svg?style=flat)](https://bioconductor.org/packages/stats/bioc/ReactomePA/)
[![month](https://img.shields.io/badge/downloads-`r x <- dlstats::bioc_stats("ReactomePA"); x$Nb_of_downloads[nrow(x)-1]`/month-blue.svg?style=flat)](https://bioconductor.org/packages/stats/bioc/ReactomePA/)

```{r echo=F, comment=NA}
x <- dlstats::bioc_stats("ReactomePA")
x <- x[-nrow(x), ] # last month data is not complete
txtplot::txtplot(ggtree::Date2decimal(x$end), x$Nb_of_downloads, width=100, height=25)
```


79 changes: 72 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,78 @@
# ReactomePA: Reactome Pathway Analysis
ReactomePA: Reactome Pathway Analysis
=====================================

[![platform](http://www.bioconductor.org/shields/availability/devel/ReactomePA.svg)](https://www.bioconductor.org/packages/devel/bioc/html/ReactomePA.html#archives)
[![Build Status](http://www.bioconductor.org/shields/build/devel/bioc/ReactomePA.svg)](https://bioconductor.org/checkResults/devel/bioc-LATEST/ReactomePA/)
[![Bioc](http://www.bioconductor.org/shields/years-in-bioc/ReactomePA.svg)](https://www.bioconductor.org/packages/devel/bioc/html/ReactomePA.html#since)
[![post](http://www.bioconductor.org/shields/posts/ReactomePA.svg)](https://support.bioconductor.org/t/ReactomePA/)
[![commit](http://www.bioconductor.org/shields/commits/bioc/ReactomePA.svg)](https://www.bioconductor.org/packages/devel/bioc/html/ReactomePA.html#svn_source)
[![download](http://www.bioconductor.org/shields/downloads/ReactomePA.svg)](https://bioconductor.org/packages/stats/bioc/ReactomePA)
[![platform](http://www.bioconductor.org/shields/availability/devel/ReactomePA.svg)](https://www.bioconductor.org/packages/devel/bioc/html/ReactomePA.html#archives) [![Build Status](http://www.bioconductor.org/shields/build/devel/bioc/ReactomePA.svg)](https://bioconductor.org/checkResults/devel/bioc-LATEST/ReactomePA/) [![Linux/Mac Travis Build Status](https://img.shields.io/travis/GuangchuangYu/ReactomePA/master.svg?label=Mac%20OSX%20%26%20Linux)](https://travis-ci.org/GuangchuangYu/ReactomePA) [![AppVeyor Build Status](https://img.shields.io/appveyor/ci/Guangchuangyu/ReactomePA/master.svg?label=Windows)](https://ci.appveyor.com/project/GuangchuangYu/ReactomePA) [![install with bioconda](https://img.shields.io/badge/install%20with-bioconda-green.svg?style=flat)](http://bioconda.github.io/recipes/bioconductor-reactomepa/README.html)

[![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active) [![codecov](https://codecov.io/gh/GuangchuangYu/ReactomePA/branch/master/graph/badge.svg)](https://codecov.io/gh/GuangchuangYu/ReactomePA/) [![Last-changedate](https://img.shields.io/badge/last%20change-2016--08--15-green.svg)](https://github.com/GuangchuangYu/ReactomePA/commits/master) [![commit](http://www.bioconductor.org/shields/commits/bioc/ReactomePA.svg)](https://www.bioconductor.org/packages/devel/bioc/html/ReactomePA.html#svn_source) [![GitHub forks](https://img.shields.io/github/forks/GuangchuangYu/ReactomePA.svg)](https://github.com/GuangchuangYu/ReactomePA/network) [![GitHub stars](https://img.shields.io/github/stars/GuangchuangYu/ReactomePA.svg)](https://github.com/GuangchuangYu/ReactomePA/stargazers)

[![releaseVersion](https://img.shields.io/badge/release%20version-1.16.2-green.svg?style=flat)](https://bioconductor.org/packages/ReactomePA) [![develVersion](https://img.shields.io/badge/devel%20version-1.17.4-green.svg?style=flat)](https://github.com/GuangchuangYu/ReactomePA) [![Bioc](http://www.bioconductor.org/shields/years-in-bioc/ReactomePA.svg)](https://www.bioconductor.org/packages/devel/bioc/html/ReactomePA.html#since) [![post](http://www.bioconductor.org/shields/posts/ReactomePA.svg)](https://support.bioconductor.org/t/ReactomePA/) [![download](http://www.bioconductor.org/shields/downloads/ReactomePA.svg)](https://bioconductor.org/packages/stats/bioc/ReactomePA/)

This package provides functions for pathway analysis based on REACTOME pathway database. It implements enrichment analysis, gene set enrichment analysis and several functions for visualization.

[![Twitter](https://img.shields.io/twitter/url/https/github.com/GuangchuangYu/ReactomePA.svg?style=social)](https://twitter.com/intent/tweet?hashtags=ReactomePA&url=https://guangchuangyu.github.io/ReactomePA)

------------------------------------------------------------------------

Please cite the following article when using `ReactomePA`:

***G Yu***, QY He<sup>\*</sup>. ReactomePA: an R/Bioconductor package for reactome pathway analysis and visualization. ***Molecular BioSystems*** 2016, 12(2):477-479.

[![doi](https://img.shields.io/badge/doi-1039/c5mb00663e-green.svg?style=flat)](http://dx.doi.org/1039/c5mb00663e) [![citation](https://img.shields.io/badge/cited%20by-5-green.svg?style=flat)](https://scholar.google.com.hk/scholar?oi=bibs&hl=en&cites=16627502277303919270,2188293597650690793,16774578204592269646,17800543858983923015)

------------------------------------------------------------------------

For details, please visit our project website, <https://guangchuangyu.github.io/ReactomePA>.

- [Documentation](https://guangchuangyu.github.io/ReactomePA/documentation/)
- [Featured Articles](https://guangchuangyu.github.io/ReactomePA/featuredArticles/)
- [Feedback](https://guangchuangyu.github.io/ReactomePA/#feedback)

### Citation

[![citation](https://img.shields.io/badge/cited%20by-5-green.svg?style=flat)](https://scholar.google.com.hk/scholar?oi=bibs&hl=en&cites=3311691878690959578)

+-+---------+---------+---------+---------+--------+---+
4 + * +
| |
3.5 + +
| |
3 + +
| |
2.5 + +
2 + +
| |
1.5 + +
| |
1 + * +
+-+---------+---------+---------+---------+--------+---+
2015 2015.2 2015.4 2015.6 2015.8 2016

### Download stats

[![download](http://www.bioconductor.org/shields/downloads/ReactomePA.svg)](https://bioconductor.org/packages/stats/bioc/ReactomePA/) [![total](https://img.shields.io/badge/downloads-21897/total-blue.svg?style=flat)](https://bioconductor.org/packages/stats/bioc/ReactomePA/) [![month](https://img.shields.io/badge/downloads-539/month-blue.svg?style=flat)](https://bioconductor.org/packages/stats/bioc/ReactomePA/)

+------------------+-------------------+------------------+-------------------+----------------+
| * |
| |
800 + +
| |
| * |
| * * |
| * |
600 + * * * +
| * * * |
| * * * * |
| * ** * ** * * * |
| * * * * |
400 + * * * * * * +
| * * * * |
| * |
| ** * * |
200 + * * * ** +
| * ** |
| * |
| |
| |
0 + * +
+------------------+-------------------+------------------+-------------------+----------------+
2013 2014 2015 2016
56 changes: 56 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
environment:
matrix:
- R_VERSION: devel
R_ARCH: x64


# DO NOT CHANGE the "init" and "install" sections below

# Download script file from GitHub
init:
ps: |
$ErrorActionPreference = "Stop"
Invoke-WebRequest http://raw.github.com/krlmlr/r-appveyor/master/scripts/appveyor-tool.ps1 -OutFile "..\appveyor-tool.ps1"
Import-Module '..\appveyor-tool.ps1'
install:
ps: Bootstrap

# Adapt as necessary starting from here

build_script:
- travis-tool.sh install_bioc BiocStyle AnnotationDbi DO.db org.Hs.eg.db reactome.db
- travis-tool.sh install_deps

test_script:
- travis-tool.sh run_tests

on_failure:
- 7z a failure.zip *.Rcheck\*
- appveyor PushArtifact failure.zip

artifacts:
- path: '*.Rcheck\**\*.log'
name: Logs

- path: '*.Rcheck\**\*.out'
name: Logs

- path: '*.Rcheck\**\*.fail'
name: Logs

- path: '*.Rcheck\**\*.Rout'
name: Logs

- path: '\*_*.tar.gz'
name: Linux Package

- path: '\*_*.zip'
name: Windows Package

notifications:
- provider: Email
to:
- [email protected]
on_build_success: false

5 changes: 5 additions & 0 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
library(testthat)
library(ReactomePA)

test_check("ReactomePA")

9 changes: 9 additions & 0 deletions tests/testthat/test-getDb.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
library(ReactomePA)

context("getDb")

test_that("getDb", {
expect_equal(getDb("human"), "org.Hs.eg.db")
expect_equal(getDb("mouse"), "org.Mm.eg.db")
})

Loading

0 comments on commit 6809ad5

Please sign in to comment.