Skip to content

Instantly share code, notes, and snippets.

Avatar
:electron:
nextflow, R, shiny, shell

Angel Angelov angelovangel

:electron:
nextflow, R, shiny, shell
  • Germany
View GitHub Profile
@ijt
ijt / stringsim.rs
Created Oct 3, 2019
Rust program to compute the trigram Jaccard similarity between two strings
View stringsim.rs
//! The stringsim program prints out the trigram similarity of two strings
//! using what appears to be the same algorithm used by Postgres.
//! https://www.postgresql.org/docs/9.1/pgtrgm.html
use std::collections::HashSet;
use std::hash::Hash;
fn main() {
let args: Vec<String> = ::std::env::args().collect();
if args.len() != 1+2 {
@davfre
davfre / bamfilter_oneliners.md
Last active Jan 2, 2023
SAM and BAM filtering oneliners
View bamfilter_oneliners.md
View calc_N50.R
# len <- c(100, 120, 40, 1000, ....)
len.sorted <- rev(sort(len))
N50 <- len.sorted[cumsum(len.sorted) >= sum(len.sorted)*0.5][1]
N90 <- len.sorted[cumsum(len.sorted) >= sum(len.sorted)*0.9][1]