Skip to content

CLI Reference ​

This document provides a comprehensive reference for all command-line options available in the Varvis Download CLI.

Usage ​

bash
varvis-download [options]

Options ​

OptionTypeDefaultDescription
--config, cstring.config.jsonPath to the configuration file
--username, ustring-Varvis API username
--password, pstring-Varvis API password
--password-stdinbooleanfalseRead the password from the first line of stdin (recommended for automation; mirrors docker login).
--target, tstring-Target for the Varvis API (instance short name, e.g. laborberlin)
--analysisIds, aarray-Analysis IDs to download files for (comma-separated)
--sampleIds, sarray-Sample IDs to filter analyses (comma-separated)
--limsIds, larray-LIMS IDs to filter analyses (comma-separated)
--list, LbooleanfalseList available files for the specified analysis IDs
--destination, dstring.Destination folder for the downloaded files
--proxy, xstring-Proxy URL
--proxyUsername, pxustring-Proxy username
--proxyPassword, pxpstring-Proxy password
--overwrite, obooleanfalseOverwrite existing files
--filetypes, farraybam,bam.baiFile types to download (comma-separated): bam, bam.bai, vcf.gz, vcf.gz.tbi
--loglevel, llstringinfoLogging level (info, warn, error, debug)
--logfile, lfstring-Path to the log file
--reportfile, rstring-Path to the report file
--filter, Farray[]Filter expressions with AND logic. Operators: = != > < >= <= ~= (contains) ^= (starts with).
--latestbooleanfalseKeep only the newest analysis per sample (highest analysis ID). Useful for repeat sequencing.
--range, gstring-Genomic range for ranged download (e.g., chr1:1-100000)
--bed, bstring-Path to BED file containing multiple regions
--unmapped, umbooleanfalseExtract unmapped reads from BAM files. Can be combined with --range to produce a single BAM with both.
--restoreArchived, rastringaskRestore archived files. Accepts "no", "ask" (default), "all", or "force".
--restorationFile, rfstringawaiting-restoration.jsonPath and name for the awaiting-restoration JSON file
--resumeArchivedDownloads, radbooleanfalseResume downloads for archived files from the awaiting-restoration JSON file if restoreEstimation has passed.
--list-urls, UbooleanfalseList the direct download URLs for the selected files instead of downloading them. Useful for piping to other tools.
--url-filestring-Path to a file to save the download URLs when using --list-urls.
--version, vbooleanfalseShow version information
--help, hbooleanfalseShow help

Examples ​

Basic Usage ​

bash
# Download BAM files for specific analysis IDs
varvis-download -u username -p password -t target -a "analysis1,analysis2"

# List available files without downloading
varvis-download -u username -p password -t target -a "analysis1" --list

# Download with custom destination
varvis-download -u username -p password -t target -a "analysis1" -d "/path/to/download"

Advanced Usage ​

bash
# Download with filters
varvis-download -u username -p password -t target -s "sample1,sample2" --filter "analysisType=SNV"

# Ranged download for specific genomic region (BAM files)
varvis-download -u username -p password -t target -a "analysis1" --range "chr1:1-100000" -f "bam,bam.bai"

# Ranged download for VCF files (uses tabix + bgzip pipeline)
varvis-download -u username -p password -t target -a "analysis1" --range "chr1:155000000-156000000" -f "vcf.gz,vcf.gz.tbi"

# Multiple regions (creates separate files for each region)
varvis-download -u username -p password -t target -a "analysis1" --range "chr1:1000000-2000000 chr17:41000000-42000000" -f "vcf.gz,vcf.gz.tbi"

# Download with BED file for multiple regions
varvis-download -u username -p password -t target -a "analysis1" --bed "/path/to/regions.bed" -f "vcf.gz,vcf.gz.tbi"

# Resume archived downloads
varvis-download --resumeArchivedDownloads

# List download URLs instead of downloading
varvis-download -u username -p password -t target -a "analysis1" --list-urls

# Save URLs to a file for later use
varvis-download -u username -p password -t target -a "analysis1" --list-urls --url-file urls.txt

# Pipe URLs to wget for parallel downloading
varvis-download -u username -p password -t target -a "analysis1" --list-urls | wget -i -

# Use with aria2c for accelerated downloads
varvis-download -u username -p password -t target -a "analysis1" --list-urls | aria2c -i -

Genomic Range Downloads ​

VCF Range Downloads:

  • Requires tabix v1.20+ and bgzip v1.20+
  • Automatically downloads .tbi index files
  • Uses tabix -h | bgzip pipeline for proper VCF format
  • Creates files with format: basename.region.vcf.gz
  • Each region creates a separate output file

BAM Range Downloads:

  • Requires samtools v1.17+
  • Automatically downloads .bai index files
  • Uses samtools view -b for region extraction
  • Single output file for all regions in BED file

Unmapped Read Extraction (--unmapped):

  • Requires samtools v1.17+ (no tabix/bgzip needed)
  • Extracts reads with no reference assignment using wildcard chromosome *
  • Standalone: creates basename.unmapped.bam
  • Combined with --range: produces a single BAM with both ranged and unmapped reads
  • Only applies to BAM files (VCF files are skipped)

Configuration File ​

You can use a configuration file to store commonly used options:

bash
varvis-download --config /path/to/config.json

Example configuration file:

json
{
  "username": "your-username",
  "target": "mytarget",
  "destination": "/path/to/downloads",
  "filetypes": "bam,bam.bai,vcf.gz",
  "loglevel": "info"
}

Released under the GPL-3.0 License.