use clap::{Parser, ValueEnum};
use crate::bed_data::Normalize;
#[derive(Copy, Clone, Debug, ValueEnum)]
pub enum AnalysisType {
Bulk,
#[value(name = "single-cell")]
SingleCell,
}
#[derive(Parser, Debug, Clone)]
pub struct CoverageCli {
#[arg(short = 'b', long)]
pub bam: String,
#[arg(short = 'o', long)]
pub outfile: String,
#[arg(default_value_t = 4, short, long)]
pub threads: usize,
#[arg(
short = 'n',
long = "normalize",
default_value = "not",
long_help = r#"Coverage normalization method.
Available modes:
- not : no normalization (raw read counts per bin)
- rpkm : Reads Per Kilobase per Million mapped reads
- cpm : Counts Per Million mapped reads
- bpm : Bins Per Million mapped reads (bin-level CPM)
- rpgc : Reads Per Genomic Content (1× genome coverage)
Default: not"#
)]
pub normalize: Normalize,
#[arg(short = 'w', long, default_value_t = 50)]
pub width: u32,
#[arg(long)]
pub only_r1: bool,
#[arg(long, default_value_t = 0)]
pub min_mapping_quality: u8,
#[arg(long, default_value_t = true)]
pub include_secondary: bool,
#[arg(long, default_value_t = true)]
pub include_supplementary: bool,
#[arg(long, default_value_t = true)]
pub include_duplicates: bool,
#[arg(
long,
long_help = r#"Exclude reads with ANY of these SAM flag bits set
(equivalent to deeptools --samFlagExclude).
The value is a bitmask of SAM flags. Any read with
(read_flag & mask) != 0 will be discarded.
Examples:
- 256 -> exclude secondary alignments
- 512 -> exclude QC-failed reads
- 1024 -> exclude PCR/optical duplicates
- 2048 -> exclude supplementary alignments
- 2816 -> exclude secondary + QC-fail + supplementary
Default: None (no flag-based exclusion, matches bamCoverage defaults)"#
)]
pub sam_flag_exclude: Option<u16>,
#[arg(
long,
long_help = r#"Include only reads that have ALL of these SAM flag bits set.
Applied after the exclusion test
(equivalent to deeptools --samFlagInclude).
The value is a bitmask of SAM flags. A read is kept only if:
(read_flag & mask) == mask
Examples:
- 64 -> include only read1
- 128 -> include only read2
- 2 -> include only properly paired reads
Default: None (no include constraint, matches bamCoverage defaults)"#
)]
pub sam_flag_include: Option<u16>,
}