2 releases
Uses new Rust 2024
| new 0.5.1 | Nov 4, 2025 |
|---|---|
| 0.5.0 | Sep 17, 2025 |
#2636 in Algorithms
41 downloads per month
Used in 2 crates
140KB
3K
SLoC
gtars-scoring
Wrapper around gtars-overlaprs for generating X-by-peak count matrices.
Purpose
This module wraps the core overlap infrastructure from gtars-overlaprs to produce count matrices for genomic analysis. It handles all use cases that need X-by-peak matrices where X can be cells, pseudobulk aggregations, or samples.
Design Philosophy
All overlap computation is delegated to gtars-overlaprs. This module focuses on:
- Matrix data structures and I/O
- Aggregation strategies
- Output formats (dense/sparse)
Use Cases
- Cell-by-peak matrices for single-cell ATAC-seq
- Sample-by-peak matrices for bulk ATAC-seq/ChIP-seq
- Pseudobulk-by-peak matrices for aggregated single-cell data
Main Components
ConsensusSet: Wraps consensus peaks usinggtars-overlaprs::Bitsfor overlap detectionCountMatrix: Dense matrix storage for count dataregion_scoring_from_fragments: Main scoring function for file-based input
CLI Usage
# Score multiple fragment files against consensus peaks
gtars fscoring "fragments/*.bed.gz" peaks.bed --output matrix.csv.gz
Example
use gtars_scoring::{region_scoring_from_fragments, ConsensusSet, FragmentFileGlob, ScoringMode};
// Set up inputs
let mut fragments = FragmentFileGlob::new("fragments/*.bed.gz")?;
let consensus = ConsensusSet::new("peaks.bed".into())?;
// Generate count matrix
let count_matrix = region_scoring_from_fragments(
&mut fragments,
&consensus,
ScoringMode::Atac
)?;
// Write to file
count_matrix.write_to_file("output.csv.gz")?;
Dependencies
~6–10MB
~176K SLoC