An R package for interacting with the Single-cell Pediatric Cancer Atlas (ScPCA) Portal API.
Installation
The ScPCAr package can be installed from the GitHub repository using the remotes package:
remotes::install_github("AlexsLemonade/ScPCAr")Usage
The package provides functions to get metadata and download data from the ScPCA Portal from within R. The code chunk below shows an example of how to authenticate and download a single sample from the portal.
library(ScPCAr)
# First, look at the terms of use
view_terms()
# Get an authentication token for use with the ScPCA Portal.
# This stores the token in the `SCPCA_AUTH_TOKEN` environment variable,
# which the download functions read automatically.
get_auth(email = "your.email@example.com", agree = TRUE)
# Get the sample metadata for a project
sample_metadata <- get_sample_metadata(project_id = "SCPCP000001")
# Download data for a sample
# this function returns a vector of the downloaded file paths
file_paths <- download_sample(
sample_id = "SCPCS000001",
destination = "scpca_data",
format = "sce"
)For detailed usage instructions, please refer to the package documentation.