HiFi Solves Human WGS data uploader
As part of the HiFi Solves Consortium, organizations will run their sequencing data through PacBio's Human Whole Genome Sequencing (WGS) pipeline.
This package handles uploading all required raw data to the organization's cloud and staging the sample metadata that describes it. Output files are automatically ingested into Publisher and made available on hifisolves.org.
Submitting workflow runs is not part of this package. Once your data is uploaded, submit runs from Instruments. The workflow itself, along with its version, defaults and transformations, is registered in your namespace by DNAstack rather than by this tool, so there is nothing to configure here.
Requirements
- python3.13+
- Credentials for the relevant backend (supported backends: AWS, Azure, GCP)
Installation
python3 -m pip install hifi-solves-run-humanwgs
Command name
The command is hifisolves-upload.
Two earlier names, hifisolves-ingest and run-humanwgs, still work and do exactly the same thing, so existing scripts do not need changing. Both predate the move of workflow submission to Instruments, and run-humanwgs in particular now names something this tool no longer does. Invoking either prints a notice pointing at hifisolves-upload; prefer the new name in anything written from here on.
Script usage
Arguments
usage: hifisolves-upload [-h] [-v] -s SAMPLE_INFO -b {AWS,GCP,AZURE}
-o ORGANIZATION [--verbose]
Upload genomics data and sample metadata in preparation for running PacBio's
official Human WGS pipeline. Workflow runs are submitted from Instruments, not
from this tool.
options:
-h, --help show this help message and exit
-v, --version Program version
-s, --sample-info SAMPLE_INFO
Path to sample info CSV or TSV. This file should have
columns [sample_id, hifi_reads]. Any other columns are
ignored. See documentation for more information on the
format of this file.
-b, --backend {AWS,GCP,AZURE}
Backend where infrastructure is set up
-o, --organization ORGANIZATION
Organization identifier; used to infer bucket names
--verbose Use verbose logging
Sample info file
The sample info file defines the set of samples that will be uploaded.
This information is organized into a CSV or TSV file with the following columns:
| Column | Description |
|---|---|
sample_id |
Unique identifier for this sample. |
hifi_reads |
Path to a BAM of HiFi reads for this sample. Both unaligned movie BAMs and aligned HiFi BAMs are accepted. † |
† There can be more than one BAM for a sample. If so, add a row per BAM, repeating the sample_id. movie_bams is still accepted as a column name in place of hifi_reads, but not both in the same file.
Example sample info files
Example - single sample
Here we have a single sample, HG005, with two associated BAMs found at the local paths bams/HG005_1.hifi_reads.bam and bams/HG005_2.hifi_reads.bam.
sample_id,hifi_reads
HG005,bams/HG005_1.hifi_reads.bam
HG005,bams/HG005_2.hifi_reads.bam
Example - several samples
Here we have three samples. HG006 and HG007 each have several BAMs, so there are multiple rows for each.
sample_id,hifi_reads
HG005,bams/HG005_1.hifi_reads.bam
HG006,bams/HG006_1.hifi_reads.bam
HG006,bams/HG006_2.hifi_reads.bam
HG007,bams/HG007_1.hifi_reads.bam
HG007,bams/HG007_2.hifi_reads.bam
HG007,bams/HG007_3.hifi_reads.bam
Running the script
The script uploads input files and stages sample metadata. It does not submit workflow runs; submit those from Instruments once the upload completes and your samples have been indexed.
The script is idempotent, so it is safe to re-run. Any BAM already present at the destination is skipped rather than uploaded again, so a re-run after an interruption transfers only what is still missing.
--upload-only and --region are still accepted but ignored, so existing invocations do not break. They are hidden from --help and should be dropped from new callers: uploading is now the only mode, and the region was only ever needed to build the workflow inputs that this tool no longer generates. Uploading itself does not use a region.
Environment Variables
WORKBENCH_URL
By default, the script will use workbench.omics.ai as the Workbench URL. You can override this by setting the WORKBENCH_URL environment variable:
export WORKBENCH_URL="custom-workbench.example.com"
Example upload command - AWS
# AWS credentials
export AWS_ACCESS_KEY_ID=""
export AWS_SECRET_ACCESS_KEY=""
export AWS_SESSION_TOKEN=""
# Used for naming upload and output buckets
ORGANIZATION=""
hifisolves-upload \
--sample-info sample_info.csv \
--backend aws \
--organization "${ORGANIZATION}"
Example upload command - Azure
# Azure credentials; needs Read, Add, Write, Create, Delete, List
export AZURE_STORAGE_SAS_TOKEN=""
# Used for naming upload and output buckets; this is going to be == the storage account name
ORGANIZATION=""
hifisolves-upload \
--sample-info sample_info.csv \
--backend Azure \
--organization "${ORGANIZATION}"
If you have files already uploaded in the target storage account, their paths may be referenced in the format /<storage_account>/rawdata/path/to/file.
Copying Azure <> Azure
If source files are currently in cloud storage, they can be copied into the target storage account rather than copying from local -> cloud.
BAM URLs in the sample_info CSV file should be in the format /<src_storage_account>/<src_storage_container>/path/to/movie.bam.
An additional env variable, SOURCE_CONTAINER_SAS_TOKEN, should be defined. This SAS token should have Read and List permissions on the source container.
# SAS token for the source bucket (R/L)
export SOURCE_CONTAINER_SAS_TOKEN=""
# SAS token for the destination bucket (R/A/W/C/D/L)
export AZURE_STORAGE_SAS_TOKEN=""
ORGANIZATION=""
hifisolves-upload \
--sample-info sample_info.csv \
--backend Azure \
--organization "${ORGANIZATION}"
Example upload command - GCP
# GCP credentials - GOOGLE_APPLICATION_CREDENTIALS should point towards a JSON file containing service account information
export GOOGLE_APPLICATION_CREDENTIALS=""
# Used for naming upload and output buckets
ORGANIZATION=""
hifisolves-upload \
--sample-info sample_info.csv \
--backend gcp \
--organization "${ORGANIZATION}"
Development
Tests
Note that you will need access to have the active cloud-specific credentials below set for the various cloud backends to run the tests.
See this secret for the values you'll need to set here.
# Required AWS credentials
export AWS_ACCESS_KEY_ID=""
export AWS_SECRET_ACCESS_KEY=""
export AWS_SESSION_TOKEN=""
# alternatively - just AWS_PROFILE
# export AWS_PROFILE=""
# Required Azure credentials
_Note that these credentials will eventually expire_
# R/A/W/C/D/L on destination container
export AZURE_STORAGE_SAS_TOKEN=""
# R/L on src container
export SOURCE_CONTAINER_SAS_TOKEN=""
# Path to service account JSON
export GOOGLE_APPLICATION_CREDENTIALS=""
python3 -m unittest discover -b -s tests
Building Packages
A Makefile resides in the root directory of the package. Rules have been created to clean, build, release and push a package release. The following sections provide details on building and pushing the code to a repository
Building the package
make build
This creates a Python package to be uploaded to the Python Package Index (PyPI: pypi.org).
Building and pushing the Docker image
make docker-build
This rule builds a Docker image and pushes it to a container registry.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hifi_solves_run_humanwgs-3.1.0.tar.gz.
File metadata
- Download URL: hifi_solves_run_humanwgs-3.1.0.tar.gz
- Upload date:
- Size: 48.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef2c1009603ea493cee9017e9e29578b3a154cd4679b13550e65d52b098e1beb
|
|
| MD5 |
7ce8cfdcf43f813903eb0659ec0d4b40
|
|
| BLAKE2b-256 |
1395de63fb74ec2daeb84e350420996d5828bf587333ad410f57c0dc76f10c03
|
File details
Details for the file hifi_solves_run_humanwgs-3.1.0-py3-none-any.whl.
File metadata
- Download URL: hifi_solves_run_humanwgs-3.1.0-py3-none-any.whl
- Upload date:
- Size: 47.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1698afaeb32011da7a925c3c3d2b28d92922db30e9ba1159f68236b45cade173
|
|
| MD5 |
89908f2fc52e51bf179ccfe64f08fc57
|
|
| BLAKE2b-256 |
1d75f49e09a0a4620cef918c88657d47aca3a16a9b9bd5e00d002ac5aac5a36a
|