Skip to content

Instantly share code, notes, and snippets.

View dyndna's full-sized avatar
💤
Moved to @sbamin

Samir B. Amin dyndna

💤
Moved to @sbamin
View GitHub Profile
@dyndna
dyndna / slack_delfiles.py
Created June 6, 2016 22:16
Slack delete files older than n days
import urllib
import urllib2
import time
import json
#Credit: https://gist.github.com/jackcarter/d86808449f0d95060a40 and
# https://gist.github.com/jackcarter/d86808449f0d95060a40#gistcomment-1755139
# put oauth test token between ''
token = ''
@dyndna
dyndna / goglass.sh
Last active June 26, 2016 19:48
gists for blog posts
#!/bin/bash
# Wrapper to run docker based variant calling pipeline for GLASS consortium
# v1.0.2
# @sbamin @sethsa
# usage
show_help() {
cat << EOF
@dyndna
dyndna / parse-options.sh
Created April 24, 2016 23:45 — forked from cosimo/parse-options.sh
Example of how to parse options with bash/getopt
#!/bin/bash
#
# Example of how to parse short/long options with 'getopt'
#
OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n 'parse-options' -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
echo "$OPTS"
@dyndna
dyndna / kallisto_install_fixes.md
Created May 11, 2016 02:52
Fix for errors on installing kallisto - cmake, GLIBCXX, GCC, LD LIBRARY PATHS

Install kallisto on HPC

cd kallisto-0.42.5/build
cmake ..

-- The C compiler identification is GNU 4.4.7 -- The CXX compiler identification is GNU 4.4.7 -- Check for working C compiler: /usr/bin/cc

@dyndna
dyndna / merge_bams_add_RG_CO_in_bam_header.md
Created January 28, 2016 23:36
Merge bam files using samtools merge, add @rg and @co tags in merged header file.

merge bams file and add @RG and @CO

Let's say you have two bam files from two different runs you need to merge.

  1. bam1_batch1.bam
  2. bam1_batch2.bam

Using samtools view -H <bamfile>, get @RG information for each of two bams. I usually get ID, DT and PL info. from bam header and then add SM (sample tag) tag using following script. You can run this script before samtools merge command in your PBS script.

@dyndna
dyndna / docker_config_dns_fix.md
Created May 20, 2015 21:12
Docker build "Could not resolve 'archive.ubuntu.com'" apt-get fails to install anything

Docker build "Could not resolve 'archive.ubuntu.com'" apt-get fails to install anything

In Ubuntu Precise 12.04 LTS, after executing docker build command, e.g., docker build -t myimages/pcawg3_1 -f ./icgc_rnaseq_align/, build engine may halt at step 1: apt-get with errors similar to Could not resolve 'archive.ubuntu.com'. This is occurring most likely because of inability of docker ubuntu image to resolve apt-get urls with default Google DNS.

To resolve this issue: [Ref. http://stackoverflow.com/a/24991137]

  1. Uncomment following line in /etc/default/docker, and preferably replace Google DNS with those from your own ISP:

DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"

  1. Restart docker by sudo service docker restart or service restart command for other platforms.
  2. Reissue docker build, and add no-cache=true flag to force docker image fetch new DNS, e.g., docker build --no-cache=true -t myimages/pcawg3_2 -f ./icgc_rnaseq_align/