Skip to content

Commit 1bc79e7

Browse files
committed
Thread --dict flag through simpleaf index to piscem
Adds `--dict {auto,sshash,tiny}` (default auto) to `simpleaf index`, forwarded to the piscem build subprocess. Enables Tiny dictionary artifacts for small references (transcriptomes, probe sets).
1 parent 77c333c commit 1bc79e7

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

src/simpleaf_commands.rs

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,27 @@ pub use self::workflow::{
2626
pub use crate::atac::commands::AtacCommand;
2727
pub use crate::defaults::{DefaultMappingParams, DefaultParams};
2828

29-
use clap::{ArgGroup, Args, Subcommand, builder::ArgPredicate};
29+
use clap::{ArgGroup, Args, Subcommand, ValueEnum, builder::ArgPredicate};
3030
use std::path::PathBuf;
3131

32+
/// Dictionary backend to request from piscem build / map commands.
33+
#[derive(ValueEnum, Clone, Copy, Debug, PartialEq, Eq)]
34+
pub enum PiscemDict {
35+
Auto,
36+
Sshash,
37+
Tiny,
38+
}
39+
40+
impl PiscemDict {
41+
pub fn as_cli(&self) -> &'static str {
42+
match self {
43+
PiscemDict::Auto => "auto",
44+
PiscemDict::Sshash => "sshash",
45+
PiscemDict::Tiny => "tiny",
46+
}
47+
}
48+
}
49+
3250
/// The type of references we might create
3351
/// to map against for quantification with
3452
/// alevin-fry.
@@ -356,6 +374,17 @@ pub struct IndexOpts {
356374
#[arg(long, display_order = 6)]
357375
pub overwrite: bool,
358376

377+
/// Piscem dictionary backend: `auto` (default, emits Tiny artifacts for
378+
/// small references), `sshash` (compact), or `tiny` (fast-path).
379+
#[arg(
380+
long,
381+
value_enum,
382+
default_value_t = PiscemDict::Auto,
383+
help_heading = "Piscem Index Options",
384+
display_order = 7
385+
)]
386+
pub dict: PiscemDict,
387+
359388
/// Number of threads to use when running
360389
#[arg(short, long, default_value_t = 16, display_order = 2)]
361390
pub threads: u32,

src/simpleaf_commands/indexing.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,9 @@ pub fn build_ref_and_index(af_home_path: &Path, opts: IndexOpts) -> anyhow::Resu
591591

592592
piscem_index_cmd
593593
.arg("--threads")
594-
.arg(format!("{}", threads));
594+
.arg(format!("{}", threads))
595+
.arg("--dict")
596+
.arg(opts.dict.as_cli());
595597

596598
if let Some(decoy_paths) = opts.decoy_paths {
597599
match prog_utils::check_version_constraints(

0 commit comments

Comments
 (0)