Skip to main content

The command line interface for the GPAS

Project description

gpas-client

The command line and Python API client for the Global Pathogen Analysis Service. Enables secure sample upload with client-side human read removal and retrieval of analytical outputs.

Install

Installing Miniconda

If the conda package manager is already installed, skip this step, otherwise:

Linux

  • In a terminal console, install Miniconda, following instructions and accepting default options:
    curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
    bash Miniconda3-latest-Linux-x86_64.sh
    

MacOS

  • If your Mac has an Apple processor (M1/M2), first run the following command using Terminal:
    arch -x86_64 zsh
    
  • Install Miniconda using Terminal, following instructions and accepting default options:
    curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
    bash Miniconda3-latest-MacOSX-x86_64.sh
    

Installing the GPAS CLI

  • If your Mac has an Apple processor (M1/M2), first run the following command using Terminal:

    arch -x86_64 zsh
    
  • Perform the installation:

    conda create -n gpas -c conda-forge -c bioconda hostile
    conda activate gpas
    pip install gpas
    
  • Test the installation:

    gpas --version
    

Usage

Ensure that the conda environment is active:

conda activate gpas

Help

Run gpas --help for an overview of CLI subcommands. For help with a specific subcommand, use e.g. gpas auth --help

Authentication (gpas auth)

The first time you use the CLI, you will need to authenticate by running gpas auth and entering your username and password. This token will be used automatically for subsequent commands.

gpas auth
Enter your username: bede.constantinides@ndm.ox.ac.uk
Enter your password: ***************

Uploading samples (gpas upload)

Performs metadata validation and client-side removal of human reads in each of your samples before uploading sequences to the GPAS platform.

gpas upload tests/data/illumina.csv

This generates a mapping CSV (e.g. a5w2e8.mapping.csv) linking your local sample names with their randomly generated remote identifiers (GUIDs). Keep this file safe as it's useful for linking results later.

Downloading output files (gpas download)

Download output files associated with a one or more sample GUIDs, or a batch defined by the mapping CSV generated during upload. When a mapping CSV is used, files are prefixed with the sample names provided at upload, otherwise files are prefixed with the sample GUID.

# Download the main report for sample 3bf7d6f9-c883-4273-adc0-93bb96a499f6
gpas download 3bf7d6f9-c883-4273-adc0-93bb96a499f6

# Download the main reports for all samples in a5w2e8.mapping.csv
gpas download a5w2e8.mapping.csv

# Download the main and speciation reports for samples in a5w2e8.mapping.csv
gpas download a5w2e8.mapping.csv --filenames main_report.json,speciation_report.json

# Save downloaded files to a specific directory
gpas download a5w2e8.mapping.csv --out-dir results

Support

For technical support, please open an issue or contact support@gpas.global

Development

Development install

git clone https://github.com/GlobalPathogenAnalysisService/cli.git
cd cli
conda env create -f environment-dev.yml
pip install --editable .

Updating

git pull origin main
gpas --version

Using a local development server

export GPAS_HOST="localhost:8000"
export GPAS_PROTOCOL="http"

To unset:

unset GPAS_HOST
unset GPAS_PROTOCOL

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gpas-0.13.0.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

gpas-0.13.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file gpas-0.13.0.tar.gz.

File metadata

  • Download URL: gpas-0.13.0.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for gpas-0.13.0.tar.gz
Algorithm Hash digest
SHA256 025ba7ad252d950eeda4a2bf803079e49b395f5540f206b8481812485d953949
MD5 7f17ac30b874e3fe56e041cce383194b
BLAKE2b-256 13fb16c5a4b0ddd55ee9e8362fca82f082b00c4796ccec6848d7de8eeb85c2b4

See more details on using hashes here.

File details

Details for the file gpas-0.13.0-py3-none-any.whl.

File metadata

  • Download URL: gpas-0.13.0-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for gpas-0.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2015e5a3d263004f16953f99ea6137682408527f287af33db02583fbc1e0d1af
MD5 06b9eef059454bbbb84d9f644773db85
BLAKE2b-256 3411792cbfcd7d1d02e7a6a32248dbce30b33cf6ee5478383f5d7c921cf85946

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page