Skip to content

Commit

Permalink
Merge pull request #121 from RGLab/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
juyeongkim authored Dec 13, 2022
2 parents 7a9f0da + 8720a6a commit 3372fe8
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 38 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ jobs:
- name: Set environment for branch
run: |
if [[ $GITHUB_REF == "refs/heads/main" ]]; then
echo "ISR_machine=www.immunespace.org" >> "$GITHUB_ENV"
echo "ISR_machine=datatools.immunespace.org" >> "$GITHUB_ENV"
else
echo "ISR_machine=test.immunespace.org" >> "$GITHUB_ENV"
echo "ISR_machine=datatools-dev.immunespace.org" >> "$GITHUB_ENV"
fi
shell: bash

Expand Down
10 changes: 5 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: ImmuneSpaceR
Type: Package
Title: A Thin Wrapper around the ImmuneSpace Database
Version: 1.25.1
Title: A Thin Wrapper around the ImmuneSpace Data and Tools Portal
Version: 1.25.2
Date: 2014-06-12
Authors@R: c(person("Greg", "Finak", role = "aut"),
person("Renan", "Sauteraud", role = "aut"),
Expand All @@ -18,8 +18,8 @@ Authors@R: c(person("Greg", "Finak", role = "aut"),
role = c("cre", "cph")))
VignetteBuilder: knitr
Description: Provides a convenient API for accessing data sets within
ImmuneSpace (www.immunespace.org), the data repository and
analysis platform of the Human Immunology Project Consortium
ImmuneSpace Data and Tools Portal (datatools.immunespace.org), the data
repository and analysis platform of the Human Immunology Project Consortium
(HIPC).
biocViews: DataImport, DataRepresentation, ThirdPartyClient
URL: https://github.com/RGLab/ImmuneSpaceR
Expand Down Expand Up @@ -51,7 +51,7 @@ Imports:
flowCore,
flowWorkspace,
digest
RoxygenNote: 7.2.1
RoxygenNote: 7.2.2
Encoding: UTF-8
Collate:
'CreateConnection.R'
Expand Down
4 changes: 2 additions & 2 deletions R/CreateConnection.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#' @param verbose A \code{"logical"} whether to print the extra details for
#' troubleshooting.
#' @param onTest A \code{"logical"} whether to connect to the test server
#' (https://test.immunespace.org/) instead of the production server
#' (https://www.immunespace.org/).
#' (https://datatools-dev.immunespace.org/) instead of the production server
#' (https://datatools.immunespace.org/).
#'
#' @description Constructor for \code{ImmuneSpaceConnection} class.
#'
Expand Down
10 changes: 3 additions & 7 deletions R/ISCon.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
#' \code{.netrc} file in \code{"~/"} the user's home directory. The
#' \code{.netrc} file should contain a \code{machine}, \code{login}, and
#' \code{password} entry to allow access to ImmuneSpace, where \code{machine} is
#' the host name like "www.immunespace.org".
#' the host name like "datatools.immunespace.org".
#'
#' It can also use global variables \code{labkey.url.base}, and
#' \code{labkey.url.path}, to access a study. \code{labkey.url.base} should be
#' \code{https://www.immunespace.org/}. \code{labkey.url.path} should be
#' \code{https://datatools.immunespace.org/}. \code{labkey.url.path} should be
#' \code{/Studies/studyname}, where 'studyname' is the accession number of the
#' study.
#'
Expand Down Expand Up @@ -403,7 +403,7 @@ ISCon$set(


.get_host <- function(onTest = FALSE) {
ifelse(onTest, "test.immunespace.org", "www.immunespace.org")
ifelse(onTest, "datatools-dev.immunespace.org", "datatools.immunespace.org")
}


Expand Down Expand Up @@ -511,15 +511,11 @@ ISCon$set(

if (!inherits(nf, "try-error") && !is.null(nf)) {
curlOptions <- labkey.setCurlOptions(
ssl_verifyhost = 2,
sslversion = 1,
netrc_file = nf,
useragent = useragent
)
} else {
curlOptions <- labkey.setCurlOptions(
ssl_verifyhost = 2,
sslversion = 1,
useragent = useragent
)
}
Expand Down
12 changes: 6 additions & 6 deletions R/netrc.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ interactive_netrc <- function() {

if (chk == TRUE) {
message("writing netrc to ", filepath)
cat("machine www.immunespace.org\nlogin ", login, "\npassword ", password, "\n", file = filepath)
cat("machine datatools.immunespace.org\nlogin ", login, "\npassword ", password, "\n", file = filepath)
}
} else {
# don't overwrite - validate available netrc
Expand All @@ -58,7 +58,7 @@ interactive_netrc <- function() {
#' @export
write_netrc <- function(login,
password,
machine = "www.immunespace.org",
machine = "datatools.immunespace.org",
file = NULL) {
string <- paste0(
"machine ", machine, "\n",
Expand Down Expand Up @@ -109,8 +109,8 @@ check_netrc <- function() {
}
lines <- readLines(netrc_file)
lines <- gsub("http.*//", "", lines)
if (length(grep("machine\\swww.immunespace.org", lines)) == 0) {
stop("No entry found for www.immunespace.org in the netrc file.")
if (length(grep("machine\\sdatatools.immunespace.org", lines)) == 0) {
stop("No entry found for datatools.immunespace.org in the netrc file.")
}
print("The netrc looks valid.")
return(netrc_file)
Expand All @@ -122,7 +122,7 @@ check_netrc <- function() {
ISR_login <- Sys.getenv("ISR_login")
ISR_pwd <- Sys.getenv("ISR_pwd")
ISR_machine <- ifelse(Sys.getenv("ISR_machine") == "",
"www.immunespace.org",
"datatools.immunespace.org",
Sys.getenv("ISR_machine")
)
if (ISR_login != "" & ISR_pwd != "") {
Expand All @@ -139,7 +139,7 @@ check_netrc <- function() {
machine <- Sys.getenv("ISR_machine")
# if blank, then use production
if (machine == "") {
return("https://www.immunespace.org")
return("https://datatools.immunespace.org")
}

if (grepl("immunespace", machine)) {
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
[![Updated](https://bioconductor.org/shields/lastcommit/release/bioc/ImmuneSpaceR.svg)](http://bioconductor.org/packages/release/bioc/news/ImmuneSpaceR/NEWS)
<!-- badges: end -->

> Please update the URL (machine name) to `datatools.immunespace.org` from `www.immunespace.org` in your `.netrc` file.
A thin wrapper around Rlabkey to access the [ImmuneSpace](https://www.immunespace.org) database from R.
A thin wrapper around Rlabkey to access the [ImmuneSpace Data & Tools Portal](https://datatools.immunespace.org) from R.

This package simplifies access to the [HIPC](https://www.immuneprofiling.org/) ImmuneSpace database for R programmers. It takes advantage of the standardization of the database to hide all the [`Rlabkey`](https://cran.r-project.org/web/packages/Rlabkey/index.html) specific code away from the user. The study-specific datasets can be accessed via an object-oriented paradigm.

Expand Down Expand Up @@ -40,7 +41,7 @@ remotes::install_github("RGLab/ImmuneSpaceR")

The ImmuneSpace Portal can be accessed via `ImmuneSpaceR` with the user's credentials. A `.netrc` file storing login and password information is required.

1. [Register](https://www.immunespace.org/login/home/register.view?)
1. [Register](https://datatools.immunespace.org/login/home/register.view?)
1. Create a netrc file with your ImmuneSpace credetntials using `interactive_netrc()` function in R:

``` r
Expand Down Expand Up @@ -103,7 +104,7 @@ con$plot("hai")

## Examples & Documentation

For more advanced examples and detailed documentation, see [the package vignettes](http://rglab.github.io/ImmuneSpaceR/articles/) and the reports available on [ImmuneSpace](https://www.immunespace.org/).
For more advanced examples and detailed documentation, see [the package vignettes](http://rglab.github.io/ImmuneSpaceR/articles/) and the reports available on [ImmuneSpace](https://datatools.immunespace.org/).



Expand Down
2 changes: 1 addition & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ template:
navbar:
right:
- icon: fa-globe
href: https://www.immunespace.org/
href: https://datatools.immunespace.org/
- icon: fa-twitter
href: https://twitter.com/ImmuneSpace
- icon: fa-github
Expand Down
4 changes: 2 additions & 2 deletions man/CreateConnection.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/ImmuneSpaceConnection.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion man/write_netrc.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions vignettes/Intro_to_ImmuneSpaceR.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if (!any(file.exists("~/.netrc", "~/_netrc"))) {
```


This package provides a *thin* wrapper around [`Rlabkey`](https://cran.r-project.org/web/packages/Rlabkey/index.html) and connects to the [ImmuneSpace](https://www.immunespace.org) database, making it easier to fetch datasets, including gene expression data, HAI, and so forth, from specific studies.
This package provides a *thin* wrapper around [`Rlabkey`](https://cran.r-project.org/web/packages/Rlabkey/index.html) and connects to the [ImmuneSpace](https://datatools.immunespace.org) database, making it easier to fetch datasets, including gene expression data, HAI, and so forth, from specific studies.



Expand All @@ -49,12 +49,12 @@ Or create netrc file in the computer running R:
The following three lines must be included in the `.netrc` or `_netrc` file either separated by white space (spaces, tabs, or newlines) or commas.

```
machine www.immunespace.org
machine datatools.immunespace.org
login [email protected]
password superSecretPassword
```

Multiple such blocks can exist in one file. Please ensure that the machine name in the netrc file contains the "www" prefix as that is how the package connects to immunespace by default. A mismatch will lead to connection failures.
Multiple such blocks can exist in one file. Please ensure that the machine name in the netrc file contains the "datatools" subdomain as that is how the package connects to immunespace by default. A mismatch will lead to connection failures.

See [the official LabKey documentation](https://www.labkey.org/wiki/home/Documentation/page.view?name=netrc) for more information.

Expand Down
4 changes: 2 additions & 2 deletions vignettes/interactiveNetrc.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ In order to connect to ImmuneSpace, you will need a `.netrc` file in your home d
A netrc file may look like this:

```
machine www.immunespace.org
machine datatools.immunespace.org
login [email protected]
password supersecretpassword
```
Expand Down Expand Up @@ -58,7 +58,7 @@ Below is a gif demonstrating how to use this function:

In the case that the user did not provide login information that results in a connection to ImmuneSpace, a netrc file will not be written to the user's home directory, and the user can try the method again checking for typos.

If the user still cannot connect to ImmuneSpace via the API, they might want to double check that they are registered and that their login information works for [ImmuneSpace](https://immunespace.org/).
If the user still cannot connect to ImmuneSpace via the API, they might want to double check that they are registered and that their login information works for [ImmuneSpace](https://datatools.immunespace.org/).

If a netrc file already exists, `interactive_netrc` will print the existing file to the console and ask the user if they wish to overwrite that file.

Expand Down
2 changes: 1 addition & 1 deletion vignettes/report_SDY180.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (!any(file.exists("~/.netrc", "~/_netrc"))) {



`ImmuneSpaceR` code produces consistent results, regardless of whether it is being executed from a module or a UI based report on the server or on a local machine. This vignette reproduces a report available on <a href="https://www.immunespace.org/reports/Studies/SDY180/runReport.view?reportId=module %3ASDY180%2Freports%2Fschemas%2Fstudy%2Fdemographics%2Fplasmablast_abundance.Rmd">the ImmuneSpace portal</a> using the same code.
`ImmuneSpaceR` code produces consistent results, regardless of whether it is being executed from a module or a UI based report on the server or on a local machine. This vignette reproduces a report available on <a href="https://datatools.immunespace.org/reports/Studies/SDY180/runReport.view?reportId=module %3ASDY180%2Freports%2Fschemas%2Fstudy%2Fdemographics%2Fplasmablast_abundance.Rmd">the ImmuneSpace portal</a> using the same code.



Expand Down
2 changes: 1 addition & 1 deletion vignettes/report_SDY269.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (!any(file.exists("~/.netrc", "~/_netrc"))) {



`ImmuneSpaceR` code produces consistent results, regardless of whether it is being executed from a module or UI based report on the server or on a local machine. This vignette reproduces a report available on <a href="https://www.immunespace.org/reports/Studies/SDY269/runReport.view?reportId=module%3ASDY269%2Freports%2Fschemas%2Fhai_flow_elispot.Rmd">the ImmuneSpace portal</a> using the same code.
`ImmuneSpaceR` code produces consistent results, regardless of whether it is being executed from a module or UI based report on the server or on a local machine. This vignette reproduces a report available on <a href="https://datatools.immunespace.org/reports/Studies/SDY269/runReport.view?reportId=module%3ASDY269%2Freports%2Fschemas%2Fhai_flow_elispot.Rmd">the ImmuneSpace portal</a> using the same code.



Expand Down

0 comments on commit 3372fe8

Please sign in to comment.