Skip to content

Instantly share code, notes, and snippets.

@rob-p
Created June 2, 2023 15:49
Show Gist options
  • Save rob-p/6159aed154ef6aed690be19eca55e147 to your computer and use it in GitHub Desktop.
Save rob-p/6159aed154ef6aed690be19eca55e147 to your computer and use it in GitHub Desktop.
antisequence_sciseq3.rs
use antisequence::*;
fn main() {
// 1{b[9-10]f[CAGAGC]u[8]b[10]}2{r:}
let patterns = r#"
name: anchor
patterns:
- pattern: "CAGAGC"
"#;
iter_fastq1("example_data/sciseq3_r1.fastq", 256)
.unwrap_or_else(|e| panic!("{e}"))
.match_any(
sel!(),
tr!(seq1.* -> seq1.barcode1, seq1.anchor, seq1.rest),
patterns,
LocalAln {
identity: 0.83,
overlap: 1.0,
},
)
.retain(sel!(seq1.anchor))
.cut(
sel!(),
tr!(seq1.rest -> seq1.umi, seq1.tail1),
LeftEnd(8)
)
.cut(
sel!(),
tr!(seq1.tail1 -> seq1.barcode2, seq1.junk),
LeftEnd(10)
)
.dbg(sel!())
.run()
.unwrap_or_else(|e| panic!("{e}"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment