Usage Examples

DNAstack products can be accessed programmatically through the Command Line Interface (CLI) for Windows, Mac, and Linux environments.

For installation instructions, see Overview and installation

General

Set up a service registry

You can easily set up your environment by using the dnastack use command. For example, we set up the CLI to work with the service endpoints available at viral.ai.

dnastack use viral.ai

Download Files / Blobs

dnastack files download [DRS-URL] 

Arguments: DRS-URL: A DRS URL of the resource you would like to download

Example

dnastack files download drs://viral.ai/faux-blob-id-001 faux-blob-id-002

Collections

List Collections

dnastack collections list

List Collection Items

You can list all items in a particular collection with dnastack collections list-items -c SLUG_NAME where SLUG_NAME is the slug name of the collection. Here is an example.

dnastack collections list-items -c ncbi-sra

where items can be tables or blobs/files.

Query a Collection Table

dnastack collections query -c [SLUG-NAME] [COLLECTION-QUERY]

Arguments: SLUG-NAME: The name of the collection to query against COLLECTION-QUERY: The SQL query to execute

Example

dnastack collections query -c ncbi-sra "SELECT * FROM collections.ncbi_sra.variants LIMIT 10"

Alternatively, you can run the following query:

dnastack data-connect query --endpoint-id data-connect-ncbi-sra 
"SELECT * FROM collections.ncbi_sra.variants LIMIT 10"

Additional Resources

Take a look at the GA4GH Data Connect Documentation for a detailed guide on using search commands.

Workbench

See the workbench reference for usage examples

Last updated

© DNAstack. All rights reserved.