Skip to content

Instantly share code, notes, and snippets.

View weinstockj's full-sized avatar

Josh Weinstock weinstockj

View GitHub Profile
@weinstockj
weinstockj / allelic_depths_snakefile
Created January 28, 2020 22:10
A workflow to split TOPMed BCFs and annotate with allelic depths
import os
output_vcf_dir = "output_vcfs"
bcf_dir = "freeze.8/phased/"
nwd_file = "vcf-split/10-samples.txt"
vcf_split_binary = "vcf-split/bin/vcf-split"
ad2vcf_binary = "ad2vcf/bin/ad2vcf"
cram_path_binary="bin/topmedpath.pl"
if not os.path.exists(bcf_dir):
IOError(f"{bcf_dir} does not exist")
@weinstockj
weinstockj / ADMM.R
Created April 1, 2019 18:33
Implements ADMM solver for SVM optimization
ADMM_box_eq_QP = function(Dmat, dvec, Amat, bvec,
lb, ub, rho = 1, max.iter = 1e5, tol = 1e-8) {
n <- length(dvec)
m <- length(bvec)
stopifnot(dim(Amat) == c(m,n) && dim(Dmat) == c(n, n)) ## sanity checking
x0 = rep(0, n)
x <- x0 ## initial value of
z <- x0 ## initial value of z
@weinstockj
weinstockj / subset_vcfs.wdl
Created August 21, 2018 16:00
WDL script to filter VCF files based on a bed file and gzip and tabix the results
task subset_vcf {
File vcf
File tabix
File bed
String basename
Int disk_size
Int preemptible_tries
command <<<
echo "basename is: ${basename}"