ImmuneSpaceR (version 1.0.2)

ImmuneSpaceConnection-class: The ImmuneSpaceConnection class

Description

A connection respresents a study or a set of studies available on ImmuneSpace. It provides function to download and display the data within these studies.

Arguments

Value

An instance of an ImmuneSpaceConnection for a study in `labkey.url.path`

Fields

study
A character. The study accession number. Use an empty string ("") to create a connection at the project level.
config
A list. Stores configuration of the connection object such as URL, path and username.
available_datasets
A data.table. The table of datasets available in the connection object.
data_cache
A list. Stores the data to avoid downloading the same tables multiple times.
constants
A list. Used to store information regarding gene-expression data.

Methods

addTrt(x = NULL)
Add treatment information to the phenoData of an expression matrix available in the connection object. x: A character. The name of a expression matrix that has been downloaded from the connection.
clear_cache()
Clear the data_cache. Remove downloaded datasets and expression matrices.
EMNames(EM = NULL, colType = "participant_id")
Change the sampleNames of an ExpressionSet fetched by getGEMatrix using the information in the phenodData slot. x: An ExpressionSet, as returned by getGEMatrix. colType: A character. The type of column names. Valid options are 'expsample_accession' and 'participant_id'.
getDataset(x, original_view = FALSE, reload = FALSE, colFilter = NULL, ...)
Get a dataset form the connection original_view: A logical. If set tot TRUE, download the ImmPort view. Else, download the default grid view. reload: A logical. Clear the cache. If set to TRUE, download the dataset, whether a cached version exist or not. colFilter: A character. A filter as returned by Rlabkey's makeFilter function. '...': Extra arguments to be passed to labkey.selectRows.
getGEAnalysis(...)
Downloads data from the gene expression analysis results table. '...': A list of arguments to be passed to labkey.selectRows.
getGEFiles(files, destdir = ".")
Download gene expression raw data files. files: A character. Filenames as shown on the gene_expression_files dataset. destdir: A character. The loacal path to store the downloaded files.
getGEMatrix(x = NULL, cohort = NULL, summary = FALSE, reload = FALSE)
Downloads a normalized gene expression matrix from ImmuneSpace. `x': A `character'. The name of the gene expression matrix to download. `cohort': A `character'. The name of a cohort that has an associated gene expression matrix. Note that if `cohort' isn't NULL, then `x' is ignored. `summary': A `logical'. If set to TRUE, Downloads a matrix with expression averaged by gene symbol. `reload': A `logical'. If set to TRUE, the matrix will be downloaded again, even if a cached cop exist in the ImmuneSpaceConnection object.
listDatasets(which = c("datasets", "expression"))
List the datasets available in the study or studies of the connection.
listGEAnalysis()
List available gene expression analysis for the connection.
quick_plot(...)
Plots a selected dataset. This is the function used by the DataExplorer module on ImmuneSpace. dataset: A character. The name of the dataset to plot, as displayed by the listDataset method. normalize_to_baseline: A logical. If set to TRUE, the values are plotted as log2 fold-change from baseline. type: A character. The type of plot. Valid choices are 'auto', 'heatmap', 'boxplot', 'lineplot', 'violinplot'. If set to 'auto', the function will select an appropriate plot type for the selected data. filter: A filter as created by the makeFilter function from Rlabkey. facet: The facetting for ggplot2 based plots. Valid choices are 'grid' and 'wrap'. text_size: The size of all text elements in the plot. legend: A character. Columns of the dataset or demographics to be added as legend on the heatmap. This argument is ignored if the plot type isn't heatmap. show_virus_strain: A logical. Should all the virus strains be shown or should the values be averaged. Only used when dataset = 'hai'. '...': Extra argument to be passed to ggplot. e.g: shape = 'Age', color = 'Race'.

Details

Uses global variables labkey.url.base, and labkey.url.path, to access a study. labkey.url.base should be https://www.immunespace.org/. labkey.url.path should be /Studies/studyname, where 'studyname' is the accession number of the study. The ImmunespaceConnection will initialize itself, and look for a .netrc file in "~/" the user's home directory. The .netrc file should contain a machine, login, and password entry to allow access to ImmuneSpace, where machine is the host name like "www.immunespace.org".

See Also

CreateConnection ImmuneSpaceR-package

Examples

Run this code
## Not run: 
#   sdy269 <- CreateConnection("SDY269")
#   sdy269
# ## End(Not run)

Run the code above in your browser using DataLab