Skip to content

Instantly share code, notes, and snippets.

View carlosp420's full-sized avatar

Carlos Peña carlosp420

  • Lima
View GitHub Profile
@carlosp420
carlosp420 / remove_rates.sh
Last active October 12, 2015 04:08
remove rate parameter of trees from BEAST runs
egrep '\[?\&?\w+\.rate=[0-9]{1,3}\.[0-9]{1,20}E?-?[0-9]{0,4},?\]?'
sed -e 's/\[\?&\?\w\+\.\w\+\.\?rate=[0-9]\{1,3\}\.[0-9]\{1,20\}E\?-\?[0-9]\{0,4\},\?\]\?//g' tree_file.tree > slim_tree_file.tree
sed -r 's/\[?&?\w+\.rate=[0-9]{1,3}\.[0-9]{1,20}E?-?[0-9]{0,4},?\]?//g'
@carlosp420
carlosp420 / sort_by_tip.label
Created October 8, 2012 11:36
R: sort a data.frame of taxon names according to tip labels of phylogeny
tax <- read.csv("richness.csv"); # col.names => "exemplar", "n.tax", "taxon"
tax[match(phy$tip.label, tax$exemplar),]