-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.Rcheck/ | ||
*.tar.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
language: r | ||
sudo: required |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Package: rWikiPathways | ||
Type: Package | ||
Title: rWikiPathways - R client library for the WikiPathways API | ||
Version: 0.0.1 | ||
Date: 2015-12-20 | ||
Author: Egon Willighagen <egon.willighagen@maastrichtuniversity.nl> | ||
Maintainer: Egon Willighagen <egon.willighagen@maastrichtuniversity.nl> | ||
Depends: jsonlite, curl, plyr | ||
Suggests: testthat | ||
Description: Use this package to interface with the WikiPathways API. | ||
License: MIT + file LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
YEAR: 2015 | ||
COPYRIGHT HOLDER: Egon L Willighagen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
importFrom(jsonlite, fromJSON) | ||
importFrom(curl, curl, new_handle, handle_setheaders) | ||
importFrom(plyr, laply) | ||
|
||
export( | ||
listOrganisms | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
listOrganisms <- function() { | ||
handle = new_handle() | ||
handle_setheaders(handle, "User-Agent" = "r/rwikipathways") | ||
handle_setheaders(handle, "Accept" = "application/json") | ||
|
||
url = paste("http://webservice.wikipathways.org/listOrganisms?format=json", sep="") | ||
conn <- curl::curl(url, handle, open="r") | ||
txt <- readLines(conn, warn=FALSE) | ||
close(conn) | ||
data = fromJSON(txt)$organisms | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
\name{listOrganisms} | ||
\alias{listOrganisms} | ||
\title{ | ||
Lists the organisms available from the WikiPathways API server | ||
} | ||
\description{ | ||
Lists the organisms available from the WikiPathways API server | ||
} | ||
\usage{ | ||
listOrganisms() | ||
} | ||
\value{ | ||
\item{data}{the available organisms} | ||
} | ||
\examples{ | ||
organisms <- listOrganisms() | ||
} | ||
\author{ | ||
Egon Willighagen | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
library(testthat) | ||
library(rWikiPathways) | ||
|
||
test_check("rWikiPathways") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
library(rWikiPathways) | ||
context("Lists") | ||
|
||
test_that("organisms are found", { | ||
organisms = listOrganisms() | ||
expect_that(nrow(organisms), not(equals(0))) | ||
expect_true("Anopheles gambiae" %in% organisms) | ||
}) |