Skip to content

Instantly share code, notes, and snippets.

View philippbayer's full-sized avatar

Philipp Bayer philippbayer

View GitHub Profile
@philippbayer
philippbayer / optima.sh
Last active January 25, 2016 09:16
optima
>cat /etc/*-release
Fedora release 23 (Twenty Three)
[more about Fedora I deleted]
>cat /proc/version
Linux version 4.3.3-301.fc23.x86_64 ([email protected]) (gcc version 5.3.1 20151207 (Red Hat 5.3.1-2) (GCC) ) #1 SMP Fri Jan 15 14:03:17 UTC 2016
>javac -version
javac 1.8.0_71
>java -version
openjdk version "1.8.0_71"
OpenJDK Runtime Environment (build 1.8.0_71-b15)
@philippbayer
philippbayer / problems.md
Last active February 11, 2016 04:31
Solution for weird Module::Build install bug under perl

Commands are:

cpan
install Module::Build

when makepl_arg etc. are set to a non-standard, local folder.

Error message is:

@philippbayer
philippbayer / gist:3c83b7131b3433e2c1e2
Created February 29, 2016 03:17
Masurca 01.install.sh
2016-02-29 13:13:28 +1000
./install.sh
++ pwd
+ ROOT=/tmp/masurca20160229-26095-1pbb98n/MaSuRCA-2.3.2b
+ '[' -z /gpfs1/homes/pbayer/.linuxbrew/Cellar/masurca/2.3.2b ']'
+ mkdir -p dist-bin
+ PATH=/home/pbayer/.rbenv/versions/2.3.0/bin:/gpfs1/homes/pbayer/.rbenv/libexec:/home/pbayer/.rbenv/plugins/ruby-build/bin:/gpfs1/homes/pbayer/.linuxbrew/bin:/gpfs1/homes/pbayer/.linuxbrew/sbin:/home/pbayer/.rbenv/shims:/90days/uqccha18/groupEnv/flashlite/scripts:/90days/uqccha18/groupEnv/flashlite/apps/bin:/90days/uqccha18/groupEnv/flashlite/bin:.:/home/pbayer/.linuxbrew/bin:/home/pbayer/.rbenv/bin:/home/pbayer/jre1.8.0_74/bin:/home/pbayer/localpython/bin:/home/pbayer/localperl/bin:/opt/openmpi/bin:/usr/lib64/qt-3.3/bin:/opt/torque-rcc/default/bin:/opt/torque-rcc/default/sbin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/bio/ncbi/bin:/opt/bio/mpiblast/bin:/opt/bio/EMBOSS/bin:/opt/bio/clustalw/bin:/opt/bio/tcoffee/bin:/opt/bio/hmmer/bin:/opt/bio/phylip/exe:/opt/bio/mrbayes:/opt/bio/fasta:/opt/bio/glim
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Linuxbrew/linuxbrew.git
HEAD: 4a4df9a4a4708e9a0ff2794802f270f86775a091
Last commit: 25 hours ago
HOMEBREW_PREFIX: /gpfs1/homes/pbayer/.linuxbrew
HOMEBREW_REPOSITORY: /gpfs1/homes/pbayer/.linuxbrew
HOMEBREW_CELLAR: /gpfs1/homes/pbayer/.linuxbrew/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://linuxbrew.bintray.com
CPU: 24-core 64-bit haswell
Kernel: Linux 2.6.32-431.11.2.el6.x86_64 x86_64 GNU/Linux
@philippbayer
philippbayer / getFirstLast10Rows.py
Created April 5, 2016 06:00
This tiny script takes bedtools (or similar) output and prints the first and last 10 rows for a contig
import Queue
import sys
# prints first 10 and last 10 rows for each contig
# does NOT guarantee that the first and 10 don't overlap (use uniq)
fh = open(sys.argv[1])
header = fh.readline()
q = Queue.Queue(10) # for the last elements
current_contig = ""
for line in fh:
<nav class="navbar-default menu">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand menu__brand" href="index.html">OpenSNP</a>
<button type="button" class="navbar-toggle" data-toggle='collapse' data-target='.navbar-collapse'>
<span class="sr-only">Toggle</span>
<span class='icon-bar'></span>
<span class='icon-bar'></span>
<span class='icon-bar'></span>
</button>
@philippbayer
philippbayer / UPGMA_books
Created June 9, 2016 13:27
A small example on how to use mash to make a wrong UPGMA tree
# download
wget http://www.gutenberg.org/cache/epub/2265/pg2265.txt -O Hamlet.txt
wget http://www.gutenberg.org/cache/epub/1120/pg1120.txt -o Caesar.txt
wget http://www.gutenberg.org/cache/epub/1120/pg1120.txt -O Caesar.txt
wget http://www.gutenberg.org/cache/epub/1121/pg1121.txt -O as_you_like_it.txt
wget http://www.gutenberg.org/cache/epub/1129/pg1129.txt -O macbeth.txt
wget http://www.gutenberg.org/files/5500/5500-0.txt -O Advancement_of_Learning.txt
wget http://www.gutenberg.org/cache/epub/2434/pg2434.txt -O New_Atlantis.txt
wget http://www.gutenberg.org/files/52190/52190-0.txt -O Ecce_homo.txt
@philippbayer
philippbayer / PMs.csv
Last active July 14, 2016 13:39
Source: https://en.wikipedia.org/wiki/List_of_Prime_Ministers_of_Australia (Status=2 died in office, or maybe abducted by Soviet submarines while swimming)
V1 Name Start End Status Length survObj
1 Sir Edmund Barton 1 January 1901 24 September 1903 1 996 996
2 John Gorton 10 January 1968 10 March 1971 1 1155 1155
3 William McMahon 10 March 1971 5 December 1972 1 636 636
4 Bob Hawke 11 March 1983 20 December 1991 1 3206 3206
5 John Howard 11 March 1996 3 December 2007 1 4284 4284
6 Malcolm Fraser 11 November 1975 11 March 1983 1 2677 2677
7 Ben Chifley 13 July 1945 19 December 1949 1 1620 1620
8 Andrew Fisher 13 November 1908 2 June 1909 1 201 201
9 Andrew Fisher 17 September 1914 27 October 1915 1 405 405
library(survival)
# to make the survobj (source: https://rstudio-pubs-static.s3.amazonaws.com/5588_72eb65bfbe0a4cb7b655d2eee0751584.html )
a = read.table("table2.csv",stringsAsFactors=F,sep=",")
a$survObj <- with(a, Surv(time, status == 1))
km <- survfit(survObj ~ 1, data = a, conf.type = "log-log")
plot(km)
State Land in km2 pop/km2 Fixed broadband per 100 people
Australia 7633565 3.14 27.9
Austria 82445 101 28.1
Belgium 30278 371 36.4
Canada 9093507 3.65 35.8
Chile 743812 22 14.6
Czech Republic 77247 133 28.6
Denmark 42434 131 41.9
Estonia 42388 29 28.5
Finland 303815 16.2 31.7