A Rust CLI tool to prepare FASTQ and 10x data for GEO submission
Submitting sequencing data to GEO is tedious: FASTQs and 10x outputs are
scattered across directories, samples must be grouped consistently, and
MD5 checksums must be reported correctly. rust-geo-prep automates this
process by scanning your project directory, grouping files into samples,
computing MD5 sums, and generating reproducible collection scripts.
It assumes that you have grouped your data into experiment folders and that both the FASTQ data and the count outputs are located in subfolders of this main experiment folder. It further requires that files follow directory structures as created by the CellRanger tool:
- FASTQ files must contain the SampleID at the beginning of the filename and a read type identifier such as R1, R2, I1, or I2.
- matrix.mtx.gz files must be located in <sample_id>/outs/filtered_feature_bc_matrix/ and be accompanied by features.tsv.gz and barcodes.tsv.gz.
- filtered_feature_bc_matrix.h5 files must be located in <sample_id>/outs/.
The tool generates GEO-ready sample tables, MD5 checksum reports, FASTQ pairing tables, and a platform-specific collection script that safely gathers all referenced files into a single upload directory.
- Recursively scans experiment folders
- Groups FASTQ files into GEO-ready sample groups
- Supports multiple FASTQ suffixes (e.g.
.fastq.gz,.fq.gz) - Supports 10x HDF5 / MTX triplets
- Excludes arbitrary paths
- Computes MD5 checksums for every file
- Generates deterministic, reproducible outputs
- Automatically resolves filename collisions during collection
- Designed for large HPC / shared-storage projects
cargo install --git https://github.com/stela2502/rust-geo-prepOr build locally:
cargo build --release
cp target/release/rust-geo-prep ~/bin/rust-geo-prep [OPTIONS]Option Description
-i, --input <DIR> Root directory. Each direct subfolder is treated
as one experiment
` --experiment Override the experiment name
-e, --exclude <NAME> Path names to ignore (can be repeated)
-p, --prefix <PREFIX> Output file prefix (default:
sample_collection)
-s, --suffix <SUFFIX> File suffixes to include (can be repeated)
-h, --help Show help
Defaults:
suffixes: .fastq.gz .fq.gz
prefix: sample_collection
INPUT/
experiment_1/
sampleA_R1.fastq.gz
sampleA_R2.fastq.gz
experiment_2/
...
Each direct subfolder of --input is treated as one experiment.
rust-geo-prep \
--input /data/projects \
--exclude old_runs \
--exclude geo_downloaded_data \
--suffix .fastq.gz \
--suffix .fq.gz \
--prefix geo_submissionTo collect 10x CellRanger outputs:
rust-geo-prep \
--input /data/projects \
--suffix filtered_feature_bc_matrix.h5 \
--suffix matrix.mtx.gz \
--prefix geo_10xAnd collect the files using the also created copy script.
This allows you to prepare unique:
<sample_id>_filtered_feature_bc_matrix.h5<sample_id>.zip(combining the 10x matrix triplets into one zip)
for GEO submission.
Typical outputs:
File Purpose
*_sample_collection.tsvGEO sample table*_files_md5sum.tsvMD5 checksum table*_fastq_pairs.tsvFASTQ R1/R2 pairing table*_collection_script.shBash collection script (UNIX)*_collection_script.ps1PowerShell collection script (Windows)
The FASTQ pairs table contains one row per logical sample and groups:
- R1
- R2
- I1 / I2 (if present)
into a single row. This makes it easy to inspect whether pairs are complete and consistent before submission.
The generated scripts:
*_collection_script.sh*_collection_script.ps1
copy all referenced files into a single destination directory.
If two samples would result in identical filenames, the tool automatically adds the experiment name to the unique filenames during collection while keeping full traceability in the tables.
This guarantees:
- No overwriting
- GEO-safe flat upload directories
- Stable reproducibility
You do not need to resolve collisions manually.
Recommended workflow:
- Run
rust-geo-prep - Inspect the generated TSV tables
- Run the collection script to gather all referenced files into one directory
- Upload the collected directory to GEO
- Use the MD5 table for GEO validation
--exclude tmp --exclude backup --exclude geo_downloadedAny path containing the excluded token is ignored.
--suffix .fastq.gz --suffix .fq.gzand to include the quantified data add
--suffix filtered_feature_bc_matrix.h5 --suffix matrix.mtx.gzAll listed suffixes are treated as valid target files.
- Linux/macOS: use the generated
.shscript - Windows: use the generated
.ps1script - Paths are preserved exactly as discovered
- Files are sorted deterministically
- Grouping is stable
- MD5 sums are calculated on demand
- Scripts are reproducible
Your FASTQ filename does not follow standard R1/R2/I1/I2 naming conventions.
Handled automatically by the collection script with unique renaming.
rust-geo-prep does not try to infer experimental biology.
It guarantees:
- Correct grouping
- Correct checksums
- GEO-compatible file handling
Biological interpretation remains the responsibility of the researcher.
Stefan Lang
Division of Molecular Hematology, Lund University
ORCID: 0000-0002-0854-2328
MIT License