An R package for interacting with the Single-cell Pediatric Cancer Atlas (ScPCA) Portal API.
The ScPCAr package can be installed from the GitHub repository using the remotes package:
pak::pak("AlexsLemonade/ScPCAr")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 data for an ScPCA project.
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 the data files for the project (warning, large!)
# this function returns a vector of the downloaded file paths
file_paths <- download_project(
project_id = "SCPCP000001",
destination = "scpca_data",
format = "sce"
)For detailed usage instructions, including instructions on creating and downloading custom datasets, please refer to the package documentation.