Download data releases from MEP-LINCS
If the Synapse client has already been installed on your machine, you can skip this section and continue to the sections below. To install the Synapse client, please refer to the section titled "Installing Synapse Clients" on the Getting Started page.
The data from a release can be downloaded using one of the Synapse clients (R, Python, command line, or Java). All files are annotated, and queries can be performed to find those that are desired. For example, to get the Level 4 files for the current release, the following code snippets can be used:
synapse login --rememberMe
synapse get -q "SELECT id FROM file WHERE projectId=='syn2862345' AND Level==4"
import synapseclient
syn = synapseclient.login(username, password)
res = syn.chunkedQuery("SELECT id FROM file WHERE projectId=='syn2862345' AND Level==4")
objs = map(lambda x: syn.get(x['file.id'], downloadLocation="./"), res)
library(synapseClient)
synapseLogin(username, password)
res <- synQuery("SELECT id FROM file WHERE projectId=='syn2862345' AND Level='4'")
# This downloads to the Synapse cache, by default ~/.synapseCache
objs <- lapply(res$file.id, function(x) synGet(x))
# The path to each file can be found using getFileLocation()
objPaths <- lapply(objs, getFileLocation)
To download data for a specific previous release, use the file manifest table for the release desired. You can download all data, or filter for specific files based on annotations. For example, the following Python code will download all Level 4 data from the 09-Mar-2016 release, using the file manifest table (syn5724840):
import csv
import synapseclient
syn = synapseclient.login(username, password)
res = syn.tableQuery("SELECT * FROM syn5691738 WHERE Level='4'")
with file(res.filepath) as f:
r = csv.DictReader(f)
map(lambda x: syn.get(x['id'], downloadLocation="./"), r)
For more information on how to use the Synapse clients for downloading data, see the Synapse user guide for downloading data.