Skip to content

Instantly share code, notes, and snippets.

boydgreenfield /
Last active Feb 23, 2017
Download samples based on their ID from One Codex
from __future__ import print_function
import argparse
import onecodex
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description=("Download a set of FASTA/Q files stored in One Codex with their sample IDs."))
parser.add_argument('samples', metavar='sample ID', nargs='+',
View gist:8435d854afab6dd9ec7abc46e3e8c1a2
:Date: 26 Jul 2016
:Author: Public Health England
"""Detect peaks in data based on their amplitude and other features."""
import argparse
from khmer import khmer_args
import khmer
boydgreenfield / fetch_ocx_analyses.R
Last active Aug 23, 2016
Sample R script for generating a CSV with One Codex analysis results, one column per sample
View fetch_ocx_analyses.R
# Copyright Reference Genomics, Inc. 2016
# Released under the MIT License
# Script for fetching analysis results from the One Codex API (v0)
# See for full documentation on the REST API
# Script can be run from the command line with:
# `Rscript fetch_ocx_analyses.R <API_KEY> <FILE> [-d DATABASE_NAME] [-b BEGINNING_DATE_RANGE -e ENDING_DATE_RANGE]`
boydgreenfield / current_tables.nim
Last active Aug 29, 2015
CountTable broken in Nim v0.11
View current_tables.nim
# Nim's Runtime Library
# (c) Copyright 2015 Andreas Rumpf
# See the file "copying.txt", included in this
# distribution, for details about the copyright.
## The ``tables`` module implements variants of an efficient `hash table`:idx:
View gist:fcfd8f81aea967550d27
#!/usr/bin/env python
# Usage: python refgenomics Core [optional list of repos to sync (short name)]
from github import Github
import getpass
import sys
print "Enter user: ",
user = raw_input()
password = getpass.getpass()
boydgreenfield / sample.fasta
Created Oct 13, 2014
Sample FASTA file (simulated metagenomic dataset, from Wood + Salzburg, 2014)
View sample.fasta
This file has been truncated, but you can view the full file.
boydgreenfield /
Last active Mar 14, 2016
Simple no-dependency Python script for concatenating two paired end FASTQ files
#!/usr/bin/env python
No dependency Python script for joining two paired end FASTQ files.
Supports concatenating reads with a separator ("NNNNN") or interleaving reads via the
--interleave option. Auto-detects gzip'd files, offers header checking via a --strict flag,
and supports output to STDOUT a gzip'd FASTQ or an uncompressed FASTQ (--uncompressed flag).
import argparse
import gzip
boydgreenfield / error_checking_at_runtime.nim
Last active Dec 30, 2015
Disabling overflow checking works for procs but not for blocks within a when isMainModule block?
View error_checking_at_runtime.nim
{.push checks: off.}
proc unsafe_mult2(x: int32): int32 =
result = x * 2
{.push checks: off.}
proc unsafe_assert(x: int): void =
assert x == (x + 1)
boydgreenfield /
Created Oct 20, 2012
just another inlet to tributary