Command Line Interface Prerequisite Python 3.9 or newer Optional: pip
21.3 or newerThis is only required for ARM-based CPU. Installation Viral AI can be accessed programmatically through the DNAstack command line interface (CLI) for Windows, Mac, and Linux environments.
The library can be installed using pip
.
1
pip3 install dnastack-client-library== 3.0.56a1648737133
The library can be installed using pip
.
1
pip3 install --user dnastack-client-library== 3.0.56a1648737133
Run the following command in PowerShell
using pip
:
1
pip3 install dnastack-client-library== 3.0.56a1648737133
You can test the installation by running python3 -m dnastack
. To be able to run the DNAstack CLI from anywhere without python3 -m
, you will need to update your PATH to include the Python Scripts directory.
If you have not set this, you must use python3 -m
before every dnastack
command below.
Configuration To point the CLI to Viral AI, execute the following:
1
2
dnastack config set collections.url https://viral.ai/api/
dnastack config set drs.url https://viral.ai/
Usage List Collections 1
dnastack collections list
List Collection Tables 1
dnastack collections tables list [ COLLECTION-NAME]
Arguments: Argument Description COLLECTION-NAME
The name of the collection to query against
Example: 1
dnastack collections tables list ncbi-sra
Query a Collection Table 1
dnastack collections query [ COLLECTION-NAME] [ COLLECTION-QUERY]
Arguments: Argument Description COLLECTION-NAME
The name of the collection to query against COLLECTION-QUERY
The SQL query to execute
Flags: Option Required Description -f [csv/json],
--format [csv/json]
no The format to display the query results in. Default: json
Example: 1
dnastack collections query ncbi-sra "SELECT * FROM collections.ncbi_sra.variants LIMIT 20"
1
dnastack collections query ncbi-sra "SELECT * FROM collections.ncbi_sra.variants LIMIT 20" --format csv
Download From a DRS URL 1
dnastack files download [ DRS-URL]
Arguments: Argument Description DRS-URL
A DRS url of the resource you would like to download
Flags: Option Required Description -o [path], --output-dir [path]
no The location to download the DRS resource. Default: the current directory -i [file], --input-file [file]
no Specify a file to get DRS urls from. The file must contain one URL per line -q, --quiet
no Suppress all output from the command
Example: 1
dnastack files download drs://viral.ai/o2Dv-45753662-8cef-4c6e-bed0-121d15874912
Additional Resources Take a look at the GA4GH Data Connect Documentation for a detailed guide on using search commands.