Skip to content

Instantly share code, notes, and snippets.

View angelovangel's full-sized avatar
:electron:
nextflow, R, shiny, shell

Angel Angelov angelovangel

:electron:
nextflow, R, shiny, shell
  • Germany
View GitHub Profile
@ijt
ijt / stringsim.rs
Created October 3, 2019 00:36
Rust program to compute the trigram Jaccard similarity between two strings
//! 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 February 24, 2024 01:23
SAM and BAM filtering oneliners
@shujishigenobu
shujishigenobu / calc_N50.R
Created February 18, 2012 09:32
calculate N50
# 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]