This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// K-mer counting | |
/// Basic Zig port of kc-c1.c from https://github.com/lh3/kmer-cnt/blob/master/kc-c1.c | |
/// | |
/// zig build -Doptimize=ReleaseFast | |
/// wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR174/003/ERR1741363/ERR1741363_1.fastq.gz | |
/// | |
/// time ./kc-c1 ERR1741363_1.fastq.gz => real 0m20,494s | |
/// time pigz -dc ERR1741363_1.fastq.gz | zig-out/bin/kc-z1 => real 0m20,336s | |
/// | |
const std = @import("std"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
# run script with sudo | |
# cleanup | |
apt -y autoremove | |
# update all security patches | |
apt-get -y -s dist-upgrade | grep "^Inst" | \ | |
grep -i securi | awk -F " " {'print $2'} | \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/env bash | |
set -e | |
ENV=snp_tree | |
source miniconda3/etc/profile.d/conda.sh | |
if !(conda info --envs | grep $ENV); then | |
echo "Installing dependencies..." | |
# conda config --add channels defaults | |
# conda config --add channels bioconda | |
# conda config --add channels conda-forge | |
conda create --name $ENV python=3.9 mafft snp-sites snp-dists quicktree -q -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from io import StringIO | |
import pandas | |
from Bio.Phylo.TreeConstruction import DistanceMatrix | |
def distance_matrix(snp_tab): | |
df = pandas.read_csv(snp_tab, sep='\t', header=0) | |
cols = list(df.columns)[1:] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Takes a CSV distance matrix and renders it as a MST.""" | |
import sys | |
import matplotlib.pyplot as plt | |
import networkx as nx | |
import pandas | |
from scipy.sparse.csgraph import minimum_spanning_tree | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import inspect | |
from urllib.parse import urlparse | |
class ParameterSet: | |
pass | |
class Field: | |
def __init__(self, description, **kwargs): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type bitnum = (int, list bool); | |
let elem_of_list ls => ReactRe.arrayToElement (Array.of_list ls); | |
let text s => ReactRe.stringToElement s; | |
let cell_col bit => { | |
let color = if bit {"light"} else {"dark"}; | |
<div className=("cell " ^ color) /> | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0 info it worked if it ends with ok | |
1 verbose cli [ '/usr/local/bin/node', | |
1 verbose cli '/usr/local/bin/npm', | |
1 verbose cli '--verbose', | |
1 verbose cli 'install' ] | |
2 info using [email protected] | |
3 info using [email protected] | |
4 silly loadCurrentTree Starting | |
5 silly install loadCurrentTree | |
6 silly install readLocalPackageData |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro lwt (&rest args) | |
(destructuring-bind (b1 wh b2 &rest body) args | |
`(let* (,@b2 ,@b1) ,@body))) | |
(macroexpand-all | |
'(lwt ((w (* x y))) | |
:where | |
((x 2) | |
(y 3)) | |
(+ 1 w))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro lwt (&rest args) | |
(destructuring-bind (b1 wh b2 &rest body) args | |
`(let* (,@b2 ,@b1) ,@body))) | |
(macroexpand-all | |
'(lwt ((w (* x y))) | |
:where | |
((x 2) | |
(y 3)) | |
(+ 1 w))) |
NewerOlder