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 / docker_fix_centos.md
Created April 7, 2015 01:05
[Solved] docker does not run on cent os 6.6

Issue:

Upon sudo service docker start, docker daemon fails to start with tail /var/log/docker showing following error:

time="2015-04-07T00:28:43Z" level="info" msg="+job serveapi(unix:///var/run/docker.sock)" 
time="2015-04-07T00:28:43Z" level="info" msg="WARNING: You are running linux kernel version 2.6.32-504.12.2.el6.x86_64, which might be unstable running docker. Please upgrade your kernel to 3.8.0." 
time="2015-04-07T00:28:43Z" level="info" msg="Listening for HTTP on unix (/var/run/docker.sock)" 
time="2015-04-07T00:28:45Z" level="fatal" msg="Error loading device metadata file .tmp529617825" 
@dyndna
dyndna / circos_install_ubuntu_1404.md
Last active May 7, 2016 15:21
Install circos on ubuntu 14.04 LTS
sudo cp /etc/bluetooth/main.conf /etc/bluetooth/main.conf.OLD
sudo nano /etc/bluetooth/main.conf

#Search for the entry:
InitiallyPowered = true

#and change the value to:
InitiallyPowered = false
@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/
@dyndna
dyndna / bed_to_gtf_pcawg14_gtf.md
Created May 21, 2015 19:05
bed to gtf conversion for PCAWG14 extended set of annotations

bed to gtf conversion for syn3606092 file, rnaseq.gc19_extNc.bed was done as follows:

Ref.: http://onetipperday.blogspot.com/2012/08/convert-bed-to-gtf.html

#wget http://hgdownload.cse.ucsc.edu/admin/exe/linux.x86_64/bedToGenePred
#wget http://hgdownload.cse.ucsc.edu/admin/exe/linux.x86_64/genePredToGtf
<workdir>/scripts/bedToGenePred rnaseq.gc19_extNc.bed rnaseq.gc19_extNc.btgp.genepred
<workdir>/scripts/genePredToGtf file rnaseq.gc19_extNc.btgp.genepred rnaseq.gc19_extNc.gptg.gtf
@dyndna
dyndna / diskstats.sh
Last active December 9, 2015 17:19
disk usage summary per user
#!/bin/bash
# Find disk usage per base directory, per user
# http://unix.stackexchange.com/a/77509/28675
# http://stackoverflow.com/a/32533111/1243763
BASEDIR="$1"
MYTIME="$(date +%d%b%y_%H%M%S%Z)"
if [ -z "$BASEDIR" ] || [ ! -d "$BASEDIR" ]; then
@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 / 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

Keybase proof

I hereby claim:

  • I am dyndna on github.
  • I am sbamin (https://keybase.io/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
dyndna / tensorflow_in_r_using_rpython.R
Created March 24, 2016 20:28 — forked from rasmusab/tensorflow_in_r_using_rpython.R
An example of building a TensorFlow model from R using rPython
### 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:
# http://www.tensorflow.org/get_started/os_setup.md#binary_installation
### Here is how to setup and run a trivial TensorFlow model ###
# Load TensorFlow (I couldn't get this to work without setting sys.argv... )