Skip to content

Instantly share code, notes, and snippets.

@larssono
Created June 13, 2019 23:15
Show Gist options
  • Save larssono/a2cdb49fa871d45eb3735d205808f4b5 to your computer and use it in GitHub Desktop.
Save larssono/a2cdb49fa871d45eb3735d205808f4b5 to your computer and use it in GitHub Desktop.
import synapseclient
import synapsebridgehelpers as sb
FILTER_QUERY = "SELECT distinct healthCode FROM syn7841519 where substudyMemberships like '%Cirrhosis_pilot%'"
ORIG_PROJECT = 'syn7838471'
DESTINATION_PROJECT = 'syn18589808'
TABLE_MAPPING = {'syn7841519': 'syn18632063'}
syn = synapseclient.login()
healthCodes = syn.tableQuery(FILTER_QUERY).asDataFrame()
out = sb.export_tables(syn, table_mapping= TABLE_MAPPING, identifier_col = 'healthCode',
identifier=list(healthCodes.healthCode))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment