Skip to content

Instantly share code, notes, and snippets.

View mbreese's full-sized avatar

Marcus Breese mbreese

  • Indiana University
  • Cincinnati, OH
View GitHub Profile
@mbreese
mbreese / expand_vep_vcf.py
Created February 21, 2018 14:29
Given a VCF file annotated with VEP, expand the VEP "CSQ" INFO field to add INFO fields for all annotations
#!/usr/bin/env python
import sys
prefix="VEP_"
vep_info_name = "CSQ"
def parse_info_format(line):
###INFO=<ID=CSQ,Number=.,Type=String,Description="Consequence annotations from Ensembl VEP. Format: Allele|Consequence|IMPACT|SYMBOL|Gene|Feature_type|...">
@mbreese
mbreese / db.sql
Created January 30, 2018 15:56
Add a new user to Postgres
CREATE ROLE db_user LOGIN ENCRYPTED PASSWORD 'secret-password' NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION;
CREATE DATABASE db_name WITH OWNER db_user;
GRANT ALL PRIVILEGES ON DATABASE db_name TO db_user;
@mbreese
mbreese / build-tmux.sh
Last active February 15, 2025 18:34
HOWTO build a statically linked tmux in one script (downloads and builds dependencies from source)
#!/bin/bash
TARGETDIR=$1
if [ "$TARGETDIR" = "" ]; then
TARGETDIR=$(python -c 'import os; print os.path.realpath("local")')
fi
mkdir -p $TARGETDIR
libevent() {
curl -LO https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz
tar -zxvf libevent-2.0.22-stable.tar.gz
@mbreese
mbreese / docker-heredoc-snippet
Last active June 12, 2023 21:28
Running docker with a HEREDOC to script the commands to run inside the container.
docker run -v /Users/mbreese/tmp:/tmp1 -w /tmp1 -i centos:7 /bin/bash -s <<EOF
date > foo
echo 'foo' >> foo
cat /etc/redhat-release >> foo
whoami >> foo
EOF
@mbreese
mbreese / gist:c79150b6d504ff0cf7ff
Created May 9, 2014 05:42
Using modules to version your processing pipeline

Environmental Modules

Environment Modules is a utility that has been used to manage executables and paths for high-performance computing clusters for multiple decades (1991!). The basic idea is that you can use modules to adapt your processing environment (and $PATH) to make sure that your environment is consistent. Importantly, this allows system administrators the ability to install and maintain multiple versions of software for different users. This tool can also be used to effectively manage your bioinformatics processing pipelines to ensure consistent analysis runs. For example, if you have a set of samples that will need to be analyzed consistently over a long time span, you could use modules to make sure that the same version of a program is used throughout the entire experiment while letting you use newer versions for different experiments.

Installation

If you are running your samples on a computing cluster, chances are you are already using modules to configure your environment (add progra

@mbreese
mbreese / gist:4634262
Last active December 11, 2015 17:28
gitorious ldap config for connecting to Active Directory
production:
disable_default: true
methods:
- adapter: Gitorious::Authentication::LDAPAuthentication
server: 10.1.?.?
port: 389
base_dn: DC=domain,DC=org
# bind_username: binduser
# bind_password: binduserpass
user_filter: