Skip to content

Instantly share code, notes, and snippets.



  • Oxford Nanopore Technologies
View GitHub Profile
cjw85 /
Last active Nov 13, 2021
Non-blocking Nextflow workflow with unknown-sized gather step
#!/usr/bin/env nextflow
// Demonstration of hierarchical scatter/gather in Nextflow
// Tasks have two pieces of meta a chr (chromosome) and a reg (sub-
// chromosomal region). The workflow includes a step which gathers
// of all regions for a chromosome.
// The process phase_region is fast when chr in {"chr1", "chr2"} and slow
// when chr == "chr3". The gather process for distinct chromosomes
cjw85 /
Last active Nov 11, 2020
Run DeepVariant on a VCF produced by medaka
#!/usr/bin/env bash
set -eo pipefail
DeepVariant genotyping of medaka variants.
First run:
cjw85 /
Last active May 19, 2020
A minimal fasta/q parser in python using kseq.h
/* The MIT License
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
cjw85 / Dockerfile
Created Mar 9, 2020
flappie ubuntu 18.04 docker
View Dockerfile
FROM ubuntu:18.04
RUN groupadd -g 1001 -r flappie && useradd -r -u 999 -g flappie flappie
# Install flappie
RUN apt-get update \
&& apt-get install -y libcunit1 libhdf5-100 libopenblas-base cmake libcunit1-dev libhdf5-dev libopenblas-dev git git-lfs \
&& git lfs install \
&& git clone \
&& cd flappie \
&& git lfs install \
View 2019-ncov.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
cjw85 /
Last active Apr 18, 2018
Simulate basecalls via simulated squiggles. This is not a serious attempt to model correctly error profiles in basecalls.
# Requirements: pip install numpy, pysam, scrappie
# usage: [-h] [--mu MU] [--sigma SIGMA] [--noise NOISE]
# [--threads THREADS]
# fasta ncalls
# Simulate basecalls with scrappy.
# positional arguments:
# fasta Source sequence file.
cjw85 /
Created Jun 21, 2017
Implementation of nanonet using keras.
Reimplementation of nanonet using keras.
Follow the instructions at
to setup an NVIDIA GPU with CUDA8.0 and cuDNN v5.1.
virtualenv venv --python=python3
. venv/bin/activate
pip install numpy
cjw85 /
Created Jan 18, 2016
Nicely pickling numpy array
import numpy as np
import pickle
class MyArray(np.ndarray):
"""An np.ndarray subclass with attrs that behave nicely."""
def __new__(cls, a, meta=None):
obj = np.asarray(a).view(cls)
obj.meta = meta
return obj