Commands for reviewing and downloading projects, runs, and sample FastQ files using the BaseSpace Sequence Hub CLI.
- Install BaseSpace CLI
- Authenticate
- Check User Info
- Option A: Download by Project
- Option B: Download by Run
- Post-Download Cleanup
- Tips
# macOS (Homebrew)
brew tap basespace/basespace && brew install bs-cli
# Linux (manual install)
# Download from: https://developer.basespace.illumina.com/docs/content/documentation/cli/cli-overviewbs authThis will open a browser window for you to log in and authorize the CLI.
bs whoamiUse this when your FastQs are organized under a Project in BaseSpace (most common for standard sequencing runs that have been analyzed).
bs list projectsbs list datasets --project-id=<ProjectID> --is-type=common.fastqcd /path/to/projectName
bs download project -i <ProjectID> -o /to/the/out/path/fastqs/ --extension=fastq.gz💡 For paired-end sequencing, each sample has two FastQ files: Read1 (R1) and Read2 (R2).
# Move all fastq.gz files from subfolders to current directory
mv */*.fastq.gz ./
# Remove empty subfolders
rmdir ./*Use this when you want to download the raw BCL/FastQ data directly from a sequencing Run — for example, when you need to re-demultiplex or when data hasn't been assigned to a project yet.
bs list runsbs get run -i <RunID>bs download run -i <RunID> -o /to/the/out/path/fastqs/ --extension=fastq.gzIf you only need certain samples:
# List samples
bs list biosample
# Download a specific dataset by its ID
bs download dataset -i <DatasetID> -o /to/the/out/path/fastqs/After downloading, FastQ files are often nested in subdirectories. Flatten them:
cd /to/the/out/path/fastqs/
# Move all fastq.gz into the current directory
mv */*.fastq.gz ./
# Remove the now-empty subdirectories
rmdir ./*-
Project vs Run: If you ran a standard pipeline (e.g., DRAGEN, bcl2fastq) on BaseSpace, the resulting FastQs are usually under a Project. If you want the raw output or need to work with unprocessed data, download by Run.
-
Large downloads: For large projects/runs, consider using
--retryor running insidetmux/screento avoid interruptions. -
Check disk space before downloading — sequencing runs can be hundreds of GB.
-
Verify file integrity after download:
# Quick check: count files ls *.fastq.gz | wc -l # Check for truncated files using gzip test for f in *.fastq.gz; do gzip -t "$f" && echo "$f OK" || echo "$f CORRUPT"; done