Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: update screenshot, remove section on simple/advanced search, which is not present in the current table query component
Info

Not familiar with these terms? Find more information on Tables, Views, and Datasets /wiki/spaces/DOCS/pages/2011038095, /wiki/spaces/DOCS/pages/2011070739, and /wiki/spaces/DOCS/pages/2611281979.

You can query tables, views, and datasets to find the data you need quickly. Views are especially useful for finding data that may be spread across multiple folders or projects. You can take advantage of querying via the Synapse UI, or using one of the programmatic clients.

...

The data within a table, view, or dataset can also be retrieved by using a SQL-like query language from the Synapse web interface. To query a table, view, or dataset, select the funnel wrench icon in the upper righthand right-hand menu to reveal the advanced search bar.

...

See the REST API docs for a list of all queries that can be performed.

Toggling Between Simple and Advanced Search

You can toggle from the simple search to the advanced search without losing your query results. For example, if you selected treatment arm A, age of 23:64, and gender as female, the query will be preserved in the advanced search bar. However, this feature is unidirectional because the advanced search allows for parameters that are not available with facets. Therefore, switching from advanced to simple search will result in resetting the search query. Synapse will warn you before your search is reset.

...

 

Note

Warning: When toggling back to simple search, the query will be reset.

Querying Tables, Views, and Datasets Programatically

...

To find files in a specific project, create a file view /wiki/spaces/DOCS/pages/2011070739 in the web client. For example, if you’d like to see all files in a project, navigate to your project and then select the Tables tab. From there, click Tables Tools and Add File View. Click Add container and Enter Synapse ID to create a tabular file view that contains every file in the project, which you can now query. Importantly, if you want to later query on annotations, you must select Add All Annotations. For a more in-depth look at this feature, see Views.

Listing Files in a Specific Folder

...

Code Block
synapse query "SELECT specimenID,genomeBuild,fileFormat,platform FROM syn123456 WHERE \"specimenID\"='sampleA_conditionB'"

result = syn.tableQuery("SELECT specimenID,genomeBuild,fileFormat,platform FROM syn123456 WHERE \"specimenID\"='sampleA_conditionB'")

result = synTableQuery("SELECT specimenID,genomeBuild,fileFormat,platform FROM syn123456 WHERE \"specimenID\"='sampleA_conditionB'")

...

Downloading from a Query

You can download files in a folder using queries. Currently this feature is only available in the command line client. For example, if you want to download all files in a file view that has a synapse ID of syn00123, use:

...