Skip to content
Merged
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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/fgumi-sam/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ license.workspace = true
noodles = { version = "0.106.0", features = ["bam", "sam", "core"] }
fgumi-raw-bam = { workspace = true, features = ["noodles"] }
bstr = "1.12.1"
clap = { version = "4", features = ["derive"] }
log = "0"
anyhow = "1.0"
fgumi-dna = { workspace = true }
Expand Down
13 changes: 12 additions & 1 deletion crates/fgumi-sam/src/clipper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,27 @@ macro_rules! slice_array {
}

/// Modes of clipping that can be applied to reads
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, clap::ValueEnum)]
pub enum ClippingMode {
/// Soft clip: convert bases to S operators in CIGAR, keep bases and qualities
Soft,
/// Soft clip with masking: convert to S operators and mask bases to N, qualities to min
#[value(name = "soft-with-mask")]
SoftWithMask,
/// Hard clip: remove bases, qualities, and convert to H operators in CIGAR
Hard,
}

impl std::fmt::Display for ClippingMode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Soft => write!(f, "soft"),
Self::SoftWithMask => write!(f, "soft-with-mask"),
Self::Hard => write!(f, "hard"),
}
}
}

/// Utility for clipping BAM/SAM records in various ways
pub struct SamRecordClipper {
/// The clipping mode to use
Expand Down
Loading
Loading