PeacoQC-CLI
Command-line tool for PeacoQC (Peak-based Quality Control) for flow cytometry FCS files. This CLI provides a simple interface to run quality control on one or more FCS files with parallel processing support.
Installation
From Source
The binary will be at target/release/peacoqc.
Using Cargo
Install the binary as a cargo tool by pointing to its location (e.g. using the path of the repo cloned above):
Usage
Basic Usage (Single File)
Process a single FCS file:
With output file:
Multiple Files
Process multiple files in parallel:
With output directory:
Directory Processing
Process all FCS files in a directory (recursively):
The tool will:
- Recursively find all
.fcsfiles in the directory - Process them in parallel
- Save outputs to the specified output directory (or alongside input files with
_cleanedsuffix)
Options
<INPUT_FILES>... ) )
)
)
)
)
)
)
)
)
Examples
Process Single File
# Basic processing
# With custom channels
# Save report
# Verbose output
Process Multiple Files
# Process all files in directory
# Process specific files
# Save individual reports
Custom QC Settings
# Use only Isolation Tree method
# Adjust MAD threshold (higher = less strict)
# Adjust Isolation Tree limit
# Disable margin/doublet removal
Performance
The CLI automatically processes files in parallel:
- Multiple files: Processed simultaneously using all available CPU cores
- Multiple channels: Processed in parallel within each file
- Multiple bins: Processed in parallel within each channel
Expected speedup:
- Single file with many channels: 2-4x speedup on typical multi-core systems
- Multiple files: ~N cores speedup (e.g., 8 files on 8 cores → ~8x speedup)
Output
Console Output
The tool prints progress and summary information:
🧬 PeacoQC - Flow Cytometry Quality Control
============================================
📂 Found 5 file(s) to process
✅ Processing Complete!
Processed: 5 file(s)
Successful: 5
⏱️ Total time: 12.34s
With --verbose flag, additional details are shown for each file.
Reports
Reports are saved as JSON files with the following structure:
For multiple files:
- If
--reportpoints to a directory: Individual JSON files are created for each input file - If
--reportpoints to a file: A combined report with all results is created
Output Files (FCS)
⚠️ Note: FCS file writing is currently not implemented. The flow-fcs crate (which peacoqc-cli uses for FCS file support) is currently read-only.
To achieve feature parity with the R PeacoQC package (which saves filtered FCS files with save_fcs=TRUE), FCS file writing needs to be implemented in the flow-fcs crate first. Once implemented:
- Output files will be saved with
_cleanedsuffix (e.g.,sample.fcs→sample_cleaned.fcs) - If output directory is specified, files will maintain their original names with
_cleanedsuffix - Filtered FCS files will contain only the events that passed quality control
This feature is planned and will be added when flow-fcs supports writing FCS files.
Error Handling
The CLI continues processing even if individual files fail:
- Successful files: Processed and included in results
- Failed files: Error messages are printed, processing continues
- Exit code: Returns non-zero exit code if any files failed
Integration with peacoqc-rs
This CLI is built on top of the peacoqc-rs library, which provides:
- Trait-based design for maximum flexibility
- Efficient parallel processing
- Comprehensive quality control algorithms
- Integration with
flow-fcsfor FCS file support
See the peacoqc-rs documentation for library usage.
Attribution
This CLI tool is built on top of peacoqc-rs, which implements the PeacoQC algorithm. We gratefully acknowledge the original authors:
Original Paper:
- Emmaneel, A., Quintelier, K., Sichien, D., Rybakowska, P., Marañón, C., Alarcón-Riquelme, M. E., Van Isterdael, G., Van Gassen, S., & Saeys, Y. (2022). PeacoQC: Peak-based selection of high quality cytometry data. Cytometry A, 101(4), 325-338. https://doi.org/10.1002/cyto.a.24501
Original R Implementation:
- GitHub: https://github.com/saeyslab/PeacoQC
- Authors: Annelies Emmaneel, Katrien Quintelier, and the Saeys Lab
License
MIT License - see LICENSE file for details