Skip to content

Instantly share code, notes, and snippets.

View philippbayer's full-sized avatar

Philipp Bayer philippbayer

View GitHub Profile
@philippbayer
philippbayer / plotGenomeDensity.R
Created February 6, 2018 03:53
Plots normalised genome densities
library(karyoploteR)
library(RColorBrewer)
# napus lengths
napus_v81 <- toGRanges(data.frame(chr=c('chrA01','chrA02','chrA03','chrA04','chrA05','chrA06','chrA07','chrA08','chrA09','chrA10','chrC01','chrC02','chrC03','chrC04','chrC05','chrC06','chrC07','chrC08','chrC09'), start=rep(1, 19), end=c(31163449,31341976,39488917,23309377,28601536,31899769,28903434,21742161,46718920,19955111,47954326,58662067,71849897,61044541,52720299,44607073,52496478,46289801,60205298)))
zs11 <- toGRanges(data.frame(chr=c('chrA01','chrA02','chrA03','chrA04','chrA05','chrA06','chrA07','chrA08','chrA09','chrA10','chrC01','chrC02','chrC03','chrC04','chrC05','chrC06','chrC07','chrC08','chrC09'), start=rep(1, 19), end=c(35822560,35332831,49139118,23556787,31473443,36080979,27426921,27741902,45944924,22217279,50776418,68396430,80379030,70552673,44144642,45505716,62442588,46347055,51699380)))
napus_v4 <- toGRanges(data.frame(chr=c('chrA01','chrA02','chrA03','chrA04','chrA05','chrA06','chrA07','chrA08','chrA09','chrA10','chrC01','chrC02',
import subprocess
run_command = 'find . -maxdepth 2 -name evm.out'
process = subprocess.Popen(run_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
for c in iter(lambda: process.stdout.readline(), ''):
out = open(c.rstrip().replace('.out','_nonRNARemoved.out'), 'w')
this_gene = []
for line in open(c.rstrip()):
if line.startswith('!!'):
@philippbayer
philippbayer / different_read_lengths.txt
Created September 28, 2017 02:49
SRA libraries for B. oleracea and rapa where len(R1) != len(R2)
Oleracea/fastq/SRR1212999_1.fastq has different read lengths, 100 and 99
Oleracea/fastq/SRR1213000_1.fastq has different read lengths, 100 and 99
Oleracea/fastq/SRR1212998_1.fastq has different read lengths, 100 and 99
Oleracea/fastq/SRR1213087_1.fastq has different read lengths, 100 and 0
Rapa/fastq/SRR1777752_1.fastq has different read lengths, 71 and 76
Rapa/fastq/SRR496614_1.fastq has different read lengths, 156 and 142
Rapa/fastq/SRR396843_1.fastq has different read lengths, 156 and 142
Rapa/fastq/SRR385951_1.fastq has different read lengths, 156 and 142
Rapa/fastq/SRR385948_1.fastq has different read lengths, 106 and 92
Rapa/fastq/SRR385947_1.fastq has different read lengths, 156 and 142
Using /usr/local/rvm/gems/ruby-2.3.3
Version : 5.1.8
Date : 2017-09-05 02:49:06 +0000
Instance: 28fG3dSd (nginx/1.12.1 Phusion_Passenger/5.1.8)
{
"thread1" : {
"active_client_count" : 58,
"active_clients" : {
"1-156" : {
@philippbayer
philippbayer / phytools.R
Created July 4, 2017 08:34
Phytools barplot
library(phytools)
library(RColorBrewer)
tree <- read.newick('./tree.txt')
a <- read.table('r_genes.csv', head=T, stringsAsFactors = F, row.names = 1)
plotTree.barplot(tree,a, args.plotTree=list(fsize=0.7), args.barplot=list(col=brewer.pal(length(colnames(a)),'Set3'), legend.text=T, xpd=T,args.legend=list(horiz=F, x=400, y=35, cex=0.7, ncol=2)))
@philippbayer
philippbayer / orthofinder.md
Last active July 28, 2017 03:05
orthofinder on magnus/zeus/zythos

Install dlcpar:

wget https://www.cs.hmc.edu/~yjw/software/dlcpar/pub/sw/dlcpar-1.0.tar.gz
tar xzvf dlcpar-1.0.tar.gz

Then, inside the new folder dlcpar-1.0, I made a local installation of dlcpar in my home directory using python setup.py install --user

Git clone orthofinder somewhere:

git clone https://github.com/davidemms/OrthoFinder.git

@philippbayer
philippbayer / with_limited_success.js
Created April 13, 2017 03:01
A Greasemonkey script that adds ', with limited success' to paper titles. Currently only at PLoS because it was the easiest.
// ==UserScript==
// @name , with limited success
// @namespace mine
// @description Adds ', with limited success' to titles of papers. Currently only PLoS supported
// @include *.plos.org/*article*
// @version 1
// @grant none
// ==/UserScript==
var els = document.getElementById("artTitle");
2017-04-10 16:23:49 +1000
../configure
--disable-debug
--disable-dependency-tracking
--disable-silent-rules
--prefix=/RDS/Q0196/linuxbrew/Cellar/glibc/2.19
--enable-obsolete-rpc
--without-selinux
--with-binutils=/RDS/Q0196/linuxbrew/opt/binutils/bin

Keybase proof

I hereby claim:

  • I am philippbayer on github.
  • I am philippbayer (https://keybase.io/philippbayer) on keybase.
  • I have a public key whose fingerprint is E41F F2CB 71D2 FF38 8877 F44A A666 93B7 3175 9E39

To claim this, I am signing this object:

@philippbayer
philippbayer / silverlight.txt
Last active September 24, 2016 14:21
Getting Pipelight/Silverlight to work on Fedora24
# This is how I got to get Pipelight for Stan/Netflix etc. to work under Fedora 24, Kernel 4.7.3-200.fc24.x86_64
sudo rpm -i http://sourceforge.net/projects/mscorefonts2/files/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm
# Download Silverlight - link may change, see http://pipelight.net/cms/install/compile-pipelight.html
wget https://bitbucket.org/mmueller2012/pipelight/get/v0.2.8.1.tar.gz
tar xzvf v0.2.8.1.tar.gz
cd mmueller2012-pipelight-8a1bdc6c254f
# Install some prerequisites