Giter Club home page Giter Club logo

immunespacer's Introduction

ImmuneSpaceR

R build status Codecov test coverage Lifecycle: stable

Years in BioC BioC status Downloads Updated

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 Data & Tools Portal from R.

This package simplifies access to the HIPC ImmuneSpace database for R programmers. It takes advantage of the standardization of the database to hide all the Rlabkey specific code away from the user. The study-specific datasets can be accessed via an object-oriented paradigm.

Installation

Install from Bioconductor:

install.packages("BiocManager")
BiocManager::install("ImmuneSpaceR")

Or install the latest development version via remotes:

install.packages("remotes")
remotes::install_github("RGLab/ImmuneSpaceR")

Configuration

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
  2. Create a netrc file with your ImmuneSpace credetntials using interactive_netrc() function in R:
library(ImmuneSpaceR)
interactive_netrc()

If you're familiar with the command-line interface, see the introductory vignette.

Usage

Create a connection

The general idea is that the user creates an instance of an ImmuneSpaceConnection class. The instance configures itself to connect to a specific study, and datasets and gene expression matrices can be retrieved by name.

For example:

library(ImmuneSpaceR)
con <- CreateConnection("SDY269")

will create an instance of SDY269.

List datasets

Datasets can be listed by:

con$listDatasets()

which will print names of available datasets and gene expression matrices.

Retrieve datasets

Gene expression matrices or datasets can be retreived by:

LAIV2008 <- con$getGEMatrix("SDY269_PBMC_LAIV_Geo")
elisa <- con$getDataset("elisa")

The connection object caches data, so once it is retrieved, the next time you access it, it will use the local cached copy. The package uses a R6 class system to represent the connection to a study and get around some of R's copy-on-change behaviour.

Visualize

The plot method uses ggplot2 functions to generate visualizations of datasets, leveraging the standardized dataset tables.

con$plot("hai")

Examples & Documentation

For more advanced examples and detailed documentation, see the package vignettes and the reports available on ImmuneSpace.

Contributing

If you'd like to report bugs/issues/feature requests or contribute to the package, please see the contributing guidelines and join our Slack workspace.

immunespacer's People

Contributors

dtenenba avatar ehfhcrc avatar elehbans avatar gfinak avatar helenmiller16 avatar hpages avatar immunespace0 avatar juyeongkim avatar jwokaty avatar kant avatar lakikowolfe avatar link-ny avatar nturaga avatar srenan avatar thegilt avatar vobencha avatar wolfel2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

immunespacer's Issues

Remote LabKey connection to ImmuneSpace with ImmuneSpaceR

I am attempting a connection to ImmuneSpace from a remote LabKey instance through the ImmuneSpaceR package. I can connect from my own account, but for some reason trying the same thing thing through a LabKey R view doesn't work. I put my .netrc under the labkey user account that I setup for the LabKey server. I am probably doing something wrong, given my inexperience with LabKey other than small proof-of-concept hacks. Here's my little script:

connect to ImmuneSpace and grab Study 269 expression and HAI titers

library(ImmuneSpaceR)

labkey variables

cat("Setting LabKey variables\n")
labkey.url.base <- "https://www.immunespace.org"
labkey.url.path <- "Studies/SDY269"
labkey.email.user <- "bill-white at utulsa.edu"

connect to the study database

cat("Creating connection\n")
sdy269 <- CreateConnection("SDY269")
sdy269

that produces this error:

Error executing command
javax.script.ScriptException: javax.script.ScriptException: An error occurred when running the script 'script.R', exit code: 1).
Loading required package: ggthemr
Loading required package: ggplot2
Setting LabKey variables
Creating connection
Error in fromJSON(rawdata) : unexpected character '<'
Calls: CreateConnection ... getAvailableDataSets -> labkey.selectRows -> makeDF -> fromJSON
Execution halted

Any ideas? Thanks!

Cannot connect to ImmuneSpace with current netrc information -- check login and password for errors with STATUS 404

Hi,
Running through a piece of analysis that I can no longer get to. The issue seemed similar to [https://github.com//issues/99]

I try to connect to the immune space server using the correct log in information that works on the website.
interactive_netrc()
and get the output

Validating netrc ...
Cannot connect to ImmuneSpace with current netrc information -- check login and password for errors

I went through the comments and noticed that when I run, as suggested in Issue 99.
httr::GET("https://www.immunespace.org/login-whoami.view", Rlabkey:::labkey.getRequestOptions())

I get this output which includes status 404. (Different to 200 in issue 99)

Response [https://immunespace.org/login-whoami.view]
Date: 2023-11-15 16:11
Status: 404
Content-Type: text/html; charset=utf-8
Size: 3.02 kB

<!doctype html>

...

I have tried:
Changing machines.
clearing and restarting the R environment (attempting to remove any labkey.url.base variable defined)
Writing my own .netrc file in command line.

Your advice is much appreciated!
Best
Matt

Can not connect to

Hello

I can not connect to ImmuneSpace, while running:
library(ImmuneSpaceR)
interactive_netrc()

getting this error:
Validating netrc ...
Cannot connect to ImmuneSpace with current netrc information -- check login and password for errors

It would be great if you can help me figure out this issue.

Feature Request: expressionSet maker method

In talking with RGlab members, discussion of the following use-case has come up a few times:

  • Scientist wants to compare gene expression to clinical outcome data using subject_id as key across multiple studies.
  • gene expression would come from expression_matrices
  • clinical outcome would be HAI or similar.
  • output would be expressionSet object with exprs() of EM with rownames as gene_symbol and colnames as Subject_ID, pData of rownames with subject_ID and columns with clinical outcome data and/or demographic names (e.g. Age, Gender, HAI, Study ID).
  • Limitations / filtering: only gene_symbols shared across all subjects would be included ... and an option should be in place for scientist to select only a handful of genes via gene_symbols argument.

example:

  • con <- CreateConnection("")
  • result <- get_expressionSet(con = con, clinical_data = "hai", genes = "A1BG")

Error in function (type, msg, asError = TRUE) :

Hi.

I'm trying to follow the vignette on how to use ImmuneSpaceR.
I've managed to install the packages (ImmuneSpaceR + Rlabkey).

When I try to create a connection I get this error:

sdy269 <- CreateConnection(study="SDY269", verbose=TRUE)
Error in function (type, msg, asError = TRUE) :
Unknown cipher in list: ALL

I am following the vignette example to start with.
I've created a $HOME/.netrc file with my credentials for logging into ImmuneSpace.
I'm running "R version 3.1.1 (2014-07-10)"
On Fedora 20 (fully patched).

Any and all help would be greatly appreciated.
Thanks,
Damian

This is my code:

library(ImmuneSpaceR)

labkey.url.base="https://www.immunespace.org"
labkey.url.path="Studies/SDY269"
labkey.email.user="damian.fermin at yale.edu"

sdy269 <- CreateConnection(study="SDY269", verbose=TRUE)

Unable to CreateConnection: invalid credentials, but login/password work via web portal

Re-running through a bit of analysis that used to work. I get an error when trying to create a connection.

Error in .CreateConnection(study = study, labkey.url.base = labkey.url.base, :
Invalid credential or deactivated account. Check your account in the portal.

Credentials appear to be valid when accessing ImmuneSpace via the web portal. This is using R 3.5 running on a Windows machine.

Steps taken:

  • Reset my password on the portal and tried again after restarting my R instance and updating my _netrc file.
  • That's pretty much it...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.