Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/simpleaf_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,16 @@ pub struct MultiplexQuantOpts {
#[arg(long, default_value = "both")]
pub expected_ori: String,

/// Sample barcode orientation: `forward` (whitelist matches read as-is) or
/// `reverse` (reverse-complement the whitelist before lookup). Overrides
/// the chemistry preset's `sample_bc_ori` when set. Useful for cycle-plan
/// variants (e.g. 10x Flex Configuration B) where the sample BC is read
/// off the opposite strand from the canonical preset. Vocabulary matches
/// the preset JSON and alevin-fry's `--sample-bc-ori`.
#[arg(long,
value_parser = clap::builder::PossibleValuesParser::new(["forward", "reverse"]))]
pub sample_bc_ori: Option<String>,

/// Sample barcode correction mode
#[arg(long, default_value = "exact",
value_parser = clap::builder::PossibleValuesParser::new(["exact", "1-edit"]),
Expand Down
21 changes: 13 additions & 8 deletions src/simpleaf_commands/multiplex_quant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,14 +403,19 @@ pub fn multiplex_map_and_quant(af_home: &Path, opts: MultiplexQuantOpts) -> anyh
.arg("--min-reads")
.arg(format!("{}", opts.min_reads));

// If the chemistry declares a sample-barcode orientation (e.g. 10x Flex v2
// where the whitelist is the RC of what appears on the read), forward it.
if let Some(c) = chem.as_ref() {
if let Some(sbc_info) = c.sample_bc_list.as_ref() {
if let Some(ori) = sbc_info.sample_bc_ori.as_deref() {
gpl_cmd.arg("--sample-bc-ori").arg(ori);
}
}
// Forward the sample-barcode orientation to alevin-fry. Precedence:
// 1. user-supplied --sample-bc-ori CLI override (`forward` / `reverse`,
// matching alevin-fry's vocabulary and the preset JSON).
// 2. the chemistry preset's declared sample_bc_ori (e.g. 10x Flex v2
// where the whitelist is the RC of what appears on the read).
// 3. omit the flag (alevin-fry default).
let sbc_ori_override = opts.sample_bc_ori.as_deref().or_else(|| {
chem.as_ref()
.and_then(|c| c.sample_bc_list.as_ref())
.and_then(|s| s.sample_bc_ori.as_deref())
});
if let Some(ori) = sbc_ori_override {
gpl_cmd.arg("--sample-bc-ori").arg(ori);
}

let gpl_cmd_str = prog_utils::get_cmd_line_string(&gpl_cmd);
Expand Down
Loading