Skip to content

Instantly share code, notes, and snippets.

Moved to @sbamin

Samir B. Amin dyndna

Moved to @sbamin
Block or report user

Report or block dyndna

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
dyndna /
Created Jun 6, 2016
Slack delete files older than n days
import urllib
import urllib2
import time
import json
#Credit: and
# put oauth test token between ''
token = ''
dyndna /
Created May 11, 2016
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 / entrez_ensg_conversion.R
Created Apr 29, 2016
Convert between Ensembl gene ID and Entrez gene id/symbol
View entrez_ensg_conversion.R
#### Get gene annotations ####
# By Michael Love,
convertIDs <- function( ids, from, to, db, ifMultiple=c("putNA", "useFirst")) {
stopifnot( inherits( db, "AnnotationDb" ) )
ifMultiple <- match.arg( ifMultiple )
dyndna /
Last active Apr 28, 2016 — forked from burnash/
Simple command line script to fetch a Google API's access token.
This script will attempt to open your webbrowser,
perform OAuth 2 authentication and print your access token.
It depends on two libraries: oauth2client and gflags.
To install dependencies from PyPI:
$ pip install python-gflags oauth2client
dyndna / mpibzip2_makefile
Last active Apr 26, 2016
Makefile for mpibzip2: How to compile on cluster machine running Cent OS 6
View mpibzip2_makefile
#### Parallel MPI BZIP2
## See man doc at
### for .tar or tar.bz2 files,
## mpirun -np 4 mpibzip2 myfile.tar or mpirun -np 4 mpibzip2 myfile.tar.bz2
### for tar.gz files, see pigz at
## pigz -dk -p 4 target.tar.gz | tar -xf
# remove -k to delete original file after decompression.
# Make file for MPI BZIP2
dyndna /
Created Apr 24, 2016 — forked from cosimo/
Example of how to parse options with bash/getopt
# 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 / tensorflow_in_r_using_rpython.R
Created Mar 24, 2016 — forked from rasmusab/tensorflow_in_r_using_rpython.R
An example of building a TensorFlow model from R using rPython
View tensorflow_in_r_using_rpython.R
### An example of building a TensorFlow model from R using rPython ###
# For this script you need to
# 1. Have python 2.7 installed.
# 2. Install the rPython package in R.
# 3. Install Google's TensorFlow library as per these instructions:
### Here is how to setup and run a trivial TensorFlow model ###
# Load TensorFlow (I couldn't get this to work without setting sys.argv... )

Keybase proof

I hereby claim:

  • I am dyndna on github.
  • I am sbamin ( on keybase.
  • I have a public key whose fingerprint is FC90 E95D 5E01 4D54 26FF 1163 13B4 0CB3 1EAE A07B

To claim this, I am signing this object:

dyndna /
Last active Jun 26, 2016
gists for blog posts
# Wrapper to run docker based variant calling pipeline for GLASS consortium
# v1.0.2
# @sbamin @sethsa
# usage
show_help() {
cat << EOF
dyndna /
Created Jan 28, 2016
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.

You can’t perform that action at this time.