Data in Synapse can be downloaded using our programmatic clients (Python, R, and command line), or from the Synapse UI. as well as the web client. /wiki/spaces/DOCS/pages/2004254837. In this guide, you will learn the basic commands to download data programmatically.
...
Finding and Downloading Files via Annotations
Files can be annotated/wiki/spaces/DOCS/pages/2667708522 in Synapse to help organize your data and make files findable. In order to search the annotations, a file view must be created you must create a /wiki/spaces/DOCS/pages/2011070739 first.
For example, the PCBC Project has a table listing sequencing data files that are annotated. To find all mRNA fastq files originating from CD34+ cells in the we can query by:
...
Code Block |
---|
results <- synTableQuery('"select * from syn7511263 where dataType="'mRNA"' AND fileType="'fastq"' AND Cell_Type_of_Origin="'CD34+ cells'"') df <- as.data.frame(results) |
...
Code Block |
---|
results <- synTableQuery('"select * from syn7511263 where dataType="'mRNA"' AND fileType="'fastq"' AND Cell_Type_of_Origin="'CD34+ cells'"') df <- as.data.frame(results) entity <- lapply(df$file.id, function(x) synGet(x)) |
...
Files can be downloaded in bulk using the syncFromSynapse
function found in the synapseutils helper package. This function crawls all the subfolders of the project or folder that you specify and retrieves all the files that have not been downloaded. By default, the files will be downloaded into your synapseCache
, but a different download location can be specified with the path
parameter. If you do download to a location out side of synapseCache
, this function will also create a tab-delimited manifest of all the files along with their metadata (path, provenance, annotations, etc).
...