synapsePythonClient
synapsePythonClient copied to clipboard
Command line download of tables
The ability to download tables into TSVs using the command line client would be very helpful. Right now:
synapse get syn3156503
returns
WARNING: No files associated with entity syn3156503
Schema: RNA-Seq Metadata (syn3156503)
columns_to_store=[]
properties:
accessControlList=/repo/v1/entity/syn3156503/acl
annotations=/repo/v1/entity/syn3156503/annotations
columnIds=[u'4071', u'4192', u'4099', u'5449', u'4152', u'4077', u'4078', u'4079', u'35396', u'4073', u'35397', u'35399', u'35400', u'4124', u'4344', u'4225', u'4226', u'4158', u'4159', u'4227', u'4234', u'4228', u'4166', u'4229', u'4042', u'35398', u'4021', u'4023', u'4242', u'4243', u'4026', u'4233', u'4028', u'4043', u'4044', u'4030', u'4031', u'4032', u'4244', u'4034', u'4035', u'4036', u'4037', u'4045', u'4038', u'4046', u'4047', u'4039', u'4048', u'4245', u'4519', u'4521', u'4162', u'5518', u'4155', u'5515', u'5519', u'5520', u'4528', u'7673', u'7674', u'7705', u'7707']
concreteType=org.sagebionetworks.repo.model.table.TableEntity
createdBy=3323072
createdOn=2015-01-28T18:46:07.159Z
entityType=org.sagebionetworks.repo.model.table.TableEntity
etag=aaa03a73-1847-4ec8-b8f0-80305c1adc7a
id=syn3156503
modifiedBy=3323072
modifiedOn=2015-06-05T23:40:51.119Z
name=RNA-Seq Metadata
parentId=syn1773109
uri=/repo/v1/entity/syn3156503
versionLabel=10
versionNumber=10
versionUrl=/repo/v1/entity/syn3156503/version/10
versions=/repo/v1/entity/syn3156503/version
annotations:
AttributeError: path
There is a download button on the page, but nothing for the command line tool.
Thanks @kellrott for requesting this. We are tracking the development work here: https://sagebionetworks.jira.com/browse/SYNPY-765
Currently, you can download a table via the Synapse Python client by tableQuery("select * from <the Synapse Id of the table>")
. For more information about using Table, please see: http://docs.synapse.org/articles/tables.html
Currently the command line client has a query
function which queries Synapse tables.
synapse query "SELECT * FROM synid" > my_table.tsv
But a synapse get
on a table still probably shouldn't error out.