Skip to content

Instantly share code, notes, and snippets.

View brentp's full-sized avatar

Brent Pedersen brentp

View GitHub Profile
@nathanhaigh
nathanhaigh / deinterleave_fastq.sh
Last active May 6, 2024 06:38
deinterleave FASTQ files
#!/bin/bash
# Usage: deinterleave_fastq.sh < interleaved.fastq f.fastq r.fastq [compress]
#
# Deinterleaves a FASTQ file of paired reads into two FASTQ
# files specified on the command line. Optionally GZip compresses the output
# FASTQ files using pigz if the 3rd command line argument is the word "compress"
#
# Can deinterleave 100 million paired reads (200 million total
# reads; a 43Gbyte file), in memory (/dev/shm), in 4m15s (255s)
#
@mikeyk
mikeyk / gist:1329319
Created October 31, 2011 22:56
Testing storage of millions of keys in Redis
#! /usr/bin/env python
import redis
import random
import pylibmc
import sys
r = redis.Redis(host = 'localhost', port = 6389)
mc = pylibmc.Client(['localhost:11222'])
@taoliu
taoliu / bdg2bw
Last active March 22, 2024 21:00
bedGraph to bigWig
#!/bin/bash
# check commands: slopBed, bedGraphToBigWig and bedClip
which bedtools &>/dev/null || { echo "bedtools not found! Download bedTools: <http://code.google.com/p/bedtools/>"; exit 1; }
which bedGraphToBigWig &>/dev/null || { echo "bedGraphToBigWig not found! Download: <http://hgdownload.cse.ucsc.edu/admin/exe/>"; exit 1; }
which bedClip &>/dev/null || { echo "bedClip not found! Download: <http://hgdownload.cse.ucsc.edu/admin/exe/>"; exit 1; }
# end of checking
@max-sixty
max-sixty / config.kdl
Last active January 12, 2024 08:16
Zellij Config
// This Zellij config offers a more modal experience than the default. There are
// very few keybindings in the mode that you spend most of your time in, and we
// need to hit `C-space` to go into a mode where we navigate.
// The only keybindings in the normal mode are:
// - `C-space` to go into the tmux mode
// - `C-n` for a new pane
// - `C-t` for a new tab
// - `A-[` & `A-]` to go to the previous/next tab
// - `S-arrow` to navigate between panes
@cridenour
cridenour / gist:74e7635275331d5afa6b
Last active August 7, 2023 13:52
Setting up Vim as your Go IDE

Setting up Vim as your Go IDE

The final IDE

Intro

I've been wanting to do a serious project in Go. One thing holding me back has been a my working environment. As a huge PyCharm user, I was hoping the Go IDE plugin for IntelliJ IDEA would fit my needs. However, it never felt quite right. After a previous experiment a few years ago using Vim, I knew how powerful it could be if I put in the time to make it so. Luckily there are plugins for almost anything you need to do with Go or what you would expect form and IDE. While this is no where near comprehensive, it will get you writing code, building and testing with the power you would expect from Vim.

Getting Started

I'm assuming you're coming with a clean slate. For me this was OSX so I used MacVim. There is nothing in my config files that assumes this is the case.

@aurora
aurora / class.lua
Created November 11, 2010 10:51
class implementation for lua
function clone(object)
local dict = {}
local function clone(object)
if (type(object) ~= "table") then
return object
elseif (dict[object]) then
return dict[object]
end
@stevedonovan
stevedonovan / ml.lua
Created February 15, 2012 09:36
Microlight - a really compact set of general Lua functions
-----------------
-- Microlight - a very compact Lua utilities module
--
-- Steve Donovan, 2012; License MIT
-- @module ml
local ml = {}
--- String utilties.
-- @section string
@lh3
lh3 / 0.00README.md
Last active April 28, 2022 21:04
Mapping short reads with a ~50bp INDEL

This is a small experiment on the alignment of ~50bp INDELs. The query sequences are shown in 0.01.fq below, where seq_ori is a 204bp sequence extracted from the human reference genome, seq_del54 contains a 54bp deletion in the middle, seq_del84 contains a 84bp deletion in a 120bp read, and seq_ins40 contains a 40bp insertion in a 140bp read. These four short sequences were mapped to the human reference genome with Bowtie2, BWA-MEM, LAST, Novoalign, SNAP and Stampy with default settings. Non-default scoring functions were also tested for Bowtie2 (--rdg 5,1 --rfg 5,1), BWA-MEM (-A2 -E1) and LAST (-r2 -q4). The output by various mappers/settings can be found in this gist. The following table gives my summary:

Mapper Setting -84bp -54bp +40bp
BBMAP default Yes Yes Yes
Bowtie2 default No No No
Bowtie2 --rdg 5,1 --rfg 5,1 as insertion as insertion Yes
BWA-MEM default as split Yes Yes
BWA-MEM -A2 -E1 Yes Yes Yes
LAST default as split as split
@jmarshall
jmarshall / Dockerfile
Created September 21, 2018 14:23
Basic Dockerfile for fully-featured HTSlib/SAMtools/BCFtools
ARG ubuntu_version=latest
FROM ubuntu:${ubuntu_version}
USER root
RUN apt-get update && apt-get install -y \
build-essential \
curl \
git \
libbz2-dev \
@arq5x
arq5x / inheritance_scenarios.md
Last active March 28, 2022 21:45
mendelian violations
dad mom kid Inheritance description
HOM_REF HOM_REF HOM_REF Expected
HOM_REF HOM_REF HET Mendelian violation (plausible de novo)
HOM_REF HOM_REF HOM_ALT Mendelian violation (implausible de novo)
HOM_REF HOM_ALT HOM_REF Mendelian violation (uniparental disomy)
HOM_REF HOM_ALT HET Expected
HOM_REF HOM_ALT HOM_ALT Mendelian violation (uniparental disomy)
HOM_REF HET HOM_REF Expected
HOM_REF HET HET Expected