Skip to content

Instantly share code, notes, and snippets.

View williamrowell's full-sized avatar
🙃

Billy Rowell williamrowell

🙃
View GitHub Profile

openpgp4fpr:945A28513CB2BE6D67602C0F37BCE34F94A3D0BE

Type Filter TRUTH.TOTAL TRUTH.TP TRUTH.FN QUERY.TOTAL QUERY.FP QUERY.UNK FP.gt METRIC.Recall METRIC.Precision METRIC.Frac_NA METRIC.F1_Score TRUTH.TOTAL.TiTv_ratio QUERY.TOTAL.TiTv_ratio TRUTH.TOTAL.het_hom_ratio QUERY.TOTAL.het_hom_ratio
INDEL ALL 525467 522308 3159 1004238 3119 456981 1746 0.993988 0.994301 0.455052 0.994144 1.52827573414 2.00682078193
INDEL PASS 525467 522308 3159 1004238 3119 456981 1746 0.993988 0.994301 0.455052 0.994144 1.52827573414 2.00682078193
SNP ALL 3365126 3362716 2410 4365804 848 999299 476 0.999284 0.999748 0.228892 0.999516 2.10012756571 1.78797411801 1.58119585325 1.46169126378
SNP PASS 3365126 3362716 2410 4365804 848 999299 476 0.999284 0.999748 0.228892 0.999516 2.10012756571 1.78797411801 1.58119585325 1.46169126378
@williamrowell
williamrowell / reduceMPL.sh
Created January 30, 2022 04:20
reduceMPL
#!/usr/bin/env bash
# from https://leancrew.com/all-this/2022/01/reducing-the-size-of-large-pdfs/
# Reduces the size of PDF plots created by Matplotlib.
# Assumes that the files to be reduced are named mpl[Something].pdf
# and that it's called via
#
# reduceMPL mpl*.pdf
#
@williamrowell
williamrowell / master_to_main.md
Last active November 27, 2021 04:58
change default branch from master to main
  1. Move the ‘master’ branch to ‘main’
git branch -m master main
  1. Push ‘main’ to remote repo
git push -u origin main
@williamrowell
williamrowell / 00_README.md
Created April 30, 2020 02:54
Simplified DeepVariant singularity wrappers for small PacBio datasets

Simplified DeepVariant singularity wrappers for small PacBio datasets

Adapted from DeepVariant documentation.

CPU-only

# pull docker image (only need to do this once)
BIN_VERSION=0.10.0
singularity pull docker://google/deepvariant:"${BIN_VERSION}"
@williamrowell
williamrowell / depth_mean_stddev.py
Last active February 13, 2024 16:49
Calculate the mean and standard deviation of a coverage depth distribution as if it were normally distributed.
#!/usr/bin/env python3
"""Coverage mean and standard deviation of autosomes
Estimate the mean and standard deviation from a mosdepth coverage BED for
positions with coverage in the range (0, 2 * non-zero mode). This estimate
behaves well for PacBio HiFi WGS of human germline aligned to either hs37d5 and
GRCh38, and may be useful for other situations as well.
$ bash mosdepth --threads 3 --no-per-base --by 500 -m "${BAM%.*}.median" "${BAM}"
$ tabix ${BAM%.*}.median.regions.bed.gz {1..22} | python depth_mean_stddev.py
@williamrowell
williamrowell / dotplot workflow
Last active June 17, 2018 02:40
Make #dotplots of #ccs reads using either #gepard or #flexidot
module load smrtanalysis/mainline jre parallel
# extract fasta from ccs readset
bam2fasta -u -o consensusreadset consensusreadset.bam
# make dotplots with gepard
python split_ccs_fasta.py consensusreadset.fasta
## download gepard and prepare it
wget https://github.com/univieCUBE/gepard/archive/v1.40.0.zip
unzip v1.40.0.zip
@williamrowell
williamrowell / mockingbird.py
Last active June 17, 2018 02:44
Download corpus of #tweets for user and generate new tweets.
#!/usr/bin/env python
"""Download corpus of tweets for user SCREEN_NAME and generate new tweets.
"""
import os
import sys
import json
import argparse
import twitter
import markovify
@williamrowell
williamrowell / error_jitter.m
Created September 1, 2015 14:45
scatter plots with error bars and jitter in MATLAB
function error_jitter(xvals, yvals, errvals)
%%ERROR_JITTER(xvals, yvals)
%
% xvals -> array of x positions
% yvals -> cell array of multiple y positions for each x position
% errvals -> cell array of multiple std/sem for each x position
% TODO: allow yvals/errvals to be ragged array
%
% author: William Rowell (rowellw@janelia.hhmi.org)
@williamrowell
williamrowell / cellFromTextFile.m
Last active August 29, 2015 14:24
MATLAB helper functions
function cellArray = cellFromTextFile(fileName)
% Loads cell array of strings, 1xN character arrays, from the given text
% file.
if exist(fileName, 'file') == 0
error('unable to read file, %s, does not exist', fileName);
end
try
cellArray = textread(fileName, '%s');
catch ME
error('unable to read file, %s: %s', ME.message);