Skip to content

Instantly share code, notes, and snippets.

View standage's full-sized avatar

Daniel Standage standage

View GitHub Profile
ProbandSex Chrom MotherDist FatherDist ProbandDist
Male X mu mu/2 mu/2
Male Y ??? mu/2 mu/2
Female X mu mu/2 mu
@standage
standage / inheritance-scenarios.tsv
Created October 25, 2018 16:53
Inheritance scenarios
Proband Mother Father ValidAutosomal ValidSonChrX ValidSonChrY ValidDaughterChrX
0/0 0/0 0/0 + + + +
0/0 0/0 0/1 + + + +
0/0 0/0 1/1 - - - -
0/0 0/1 0/0 + + - +
0/0 0/1 0/1 + + - +
0/0 0/1 1/1 - - - -
0/0 1/1 0/0 - - - -
0/0 1/1 0/1 - - - -
0/0 1/1 1/1 - - - -
alias list='ls -lhp'
alias vsc='open -a /Applications/Visual\ Studio\ Code.app/'
alias msu='ssh hpcc.msu.edu'
alias cab='ssh cabernet.genomecenter.ucdavis.edu'
alias rum='ssh rum.genomecenter.ucdavis.edu'
alias gremlin='ssh gremlin2.soic.indiana.edu'
export CLICOLOR=1
export HISTSIZE=1000000
export HISTFILESIZE=1000000
export EDITOR=nano
@standage
standage / sample.py
Created July 31, 2018 20:14
Simple kevlar utility for reservoir sampling of partitioned reads. The sampling function might be of general interest.
#!/usr/bin/env python
import argparse
import kevlar
import random
import sys
def resv_samp(objstream, n=100, stopafter=None, filterfunc=None):
sample = list()
for counter, obj in enumerate(objstream):
if filterfunc:
INDIVIDUALS = ('proband', 'mother', 'father')
KSIZES = ('27', '31', '35', '39', '43', '47', '51')
rule all:
input:
expand('{coverage}x_k{ksize}_kevlar_calls_like.vcf',
coverage=('30'), ksize=KSIZES)
rule novel_reads:
@standage
standage / filter.cpp
Last active May 9, 2018 22:15
A filter class implementing a Bloom filter and Count-min sketch. Compile with `g++ -Wall -Werror -O3 -o test --std=c++11 testfilter.cpp filter.cpp`.
#include <iostream>
#include <assert.h>
#include <cmath>
#include "filter.hpp"
template<typename ElementType, typename CounterType, size_t maxcount>
filter<ElementType, CounterType, maxcount>::filter(std::vector<size_t> array_sizes)
: _cells_occupied(array_sizes.size(), 0),
_arrays(array_sizes.size(), std::vector<CounterType>())
{
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
def test_alignment_score_threshold():
"""Test for "report all near optimal alignments" strategy.
"""
contigfile = data_file('aln_scr_thresh.contig.augfasta')
contigstream = kevlar.parse_augmented_fastx(kevlar.open(contigfile, 'r'))
contigs = list(contigstream)
gdnafile = data_file('aln_scr_thresh.gdna.fa')
gdnastream = kevlar.reference.load_refr_cutouts(kevlar.open(gdnafile, 'r'))

chr_start-end score cigar


k=31

DEBUG 10_121624961-121625052 30 2M19I5M51I5M4I10M5I43M37I1M25D
DEBUG 10_135194344-135194435 53 1M29I8M49I9M5I71M8I2M
DEBUG 10_17783947-17784038 55 83I13M5I76M3I2M
@standage
standage / like.py
Last active May 11, 2018 18:33
Computing variant likelihoods
#!/usr/bin/env python
import argparse
from collections import defaultdict
import khmer
from math import log
import re
import scipy.stats
import sys