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 / 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 / mpibzip2_makefile
Last active April 26, 2016 22:42
Makefile for mpibzip2: How to compile on cluster machine running Cent OS 6
#### Parallel MPI BZIP2
## See man doc at http://compression.ca/mpibzip2/
### 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 http://serverfault.com/a/270825/149084
## pigz -dk -p 4 target.tar.gz | tar -xf
# remove -k to delete original file after decompression.
# Make file for MPI BZIP2
SHELL=/bin/sh
@dyndna
dyndna / get_oauth2_token.py
Last active April 28, 2016 19:37 — forked from burnash/get_oauth2_token.py
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
dyndna / entrez_ensg_conversion.R
Created April 29, 2016 23:22
Convert between Ensembl gene ID and Entrez gene id/symbol
#### Get gene annotations ####
# By Michael Love, http://www.bioconductor.org/help/workflows/rnaseqGene/
library("AnnotationDbi")
library("org.Hs.eg.db")
columns(org.Hs.eg.db)
convertIDs <- function( ids, from, to, db, ifMultiple=c("putNA", "useFirst")) {
stopifnot( inherits( db, "AnnotationDb" ) )
ifMultiple <- match.arg( ifMultiple )
@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 / 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 = ''