holodeck_lib/commands/common.rs
1use std::path::PathBuf;
2
3/// Help heading for core options shared by most commands.
4pub const CORE_OPTIONS: &str = "Core Options";
5
6/// Options for specifying the reference FASTA file.
7#[derive(clap::Args, Debug, Clone)]
8pub struct ReferenceOptions {
9 /// Reference FASTA file (must be indexed with .fai).
10 #[arg(short = 'r', long, value_name = "FASTA")]
11 pub reference: PathBuf,
12}
13
14/// Options for specifying the output path prefix (for commands that produce
15/// multiple output files with shared prefix, e.g. `simulate`).
16#[derive(clap::Args, Debug, Clone)]
17pub struct OutputPrefixOptions {
18 /// Output path prefix for generated files.
19 #[arg(short = 'o', long, value_name = "PREFIX")]
20 pub output: PathBuf,
21}
22
23/// Options for specifying an input VCF file and optional sample selection.
24#[derive(clap::Args, Debug, Clone)]
25pub struct VcfOptions {
26 /// VCF file with variants to apply. Must have GT field in genotypes.
27 #[arg(short = 'v', long, value_name = "VCF")]
28 pub vcf: Option<PathBuf>,
29
30 /// Sample name to select from a multi-sample VCF. Required if the VCF
31 /// contains more than one sample; ignored for single-sample VCFs.
32 #[arg(long, value_name = "SAMPLE")]
33 pub sample: Option<String>,
34}
35
36/// Options for specifying a BED file of target regions.
37#[derive(clap::Args, Debug, Clone)]
38pub struct BedOptions {
39 /// BED file of target regions. Only fragments overlapping these regions
40 /// will be emitted.
41 #[arg(short = 'b', long = "targets", value_name = "BED")]
42 pub targets: Option<PathBuf>,
43}
44
45/// Options for controlling the random seed.
46#[derive(clap::Args, Debug, Clone)]
47pub struct SeedOptions {
48 /// Random seed for reproducibility. If omitted, a deterministic seed is
49 /// derived from all other options so that identical parameters produce
50 /// identical output.
51 #[arg(long, value_name = "SEED")]
52 pub seed: Option<u64>,
53}