Skip to content

Instantly share code, notes, and snippets.

View philippbayer's full-sized avatar

Philipp Bayer philippbayer

View GitHub Profile
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 83 columns, instead of 8 in line 2.
,EGY,LIB,MOR,TUN,BER,KAZ,KYR,MON,TAJ,TUK,UZB,CHI,JAP,KOR,TAI,KHA,YAK,KOY,BUR,TUV,ALT,EVE,OSS,RUS,MAY,THA,VIE,ARM,AZE,GEO,IRA,IRQ,JOR,KUW,LEB,PAL,DRZ,UAE,SAU,SYR,TUR,YEM,AUS,FRA,GER,SWZ,BEL,CZE,HUN,POL,SVK,SLO,UKR,DEN,EST,FIN,ICE,LAT,LIT,NOR,SWE,ITA,POR,SPA,BAS,ALB,BOS,BUL,GRE,ROM,ENG,SCO,IRE,LBK,RSK,SCG,BAK,SMK,BBK,SKK,GBK,AK
EGY,,0.01245,0.01319,0.00715,0.01008,0.03598,0.04494,0.06238,0.02335,0.02131,0.02084,0.05501,0.08637,0.07495,0.05289,0.03737,0.13086,0.14389,0.08129,0.10776,0.07019,0.1663,0.03793,0.03947,0.06878,0.05801,0.06368,0.0804,0.03544,0.02624,0.0175,0.0209,0.00809,0.01159,0.01931,0.0171,0.01289,0.00961,0.02313,0.04929,0.04464,0.01231,0.03044,0.0473,0.0644,0.03228,0.03649,0.03676,0.03025,0.03565,0.03031,0.03195,0.02504,0.03857,0.05281,0.03815,0.03736,0.03553,0.02851,0.04302,0.0349,0.03529,0.02309,0.04521,0.05932,0.02248,0.03886,0.03379,0.03181,0.05633,0.04491,0.03865,0.03903,0.03998,-0.01375,0.02018,-0.00498,0.0263,0.02453,0.01804,0.03597,0.01239
LIB,0.01261,,0.00932,0.00794,0.00925,0.03915,0.047
Turkish French Central Asians German Bulgarian British Finnish Greek
Turkish 0.9509 0.9989 0.9503 0.9584 0.9994 0.9756 0.9506
French 0.0504 0.9502 0.9991 0.9923 0.9508 0.9277 0.9994
Central Asians 0.0011 0.051 0.9498 0.9577 0.9988 0.9753 0.9501
German 0.051 0.0009 0.0515 0.9918 0.9504 0.9273 0.9992
Bulgarian 0.0425 0.0077 0.0432 0.0082 0.9585 0.9352 0.9923
British 0.0006 0.0504 0.0012 0.0508 0.0424 0.9756 0.9507
Finnish 0.0247 0.0751 0.025 0.0755 0.067 0.0247 0.9276
Greek 0.0507 0.0006 0.0511 0.0008 0.0078 0.0506 0.0752
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
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)
@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
@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
<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 / 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:
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 / 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