This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ape); | |
# like keep.tip, but you can keep internal nodes toooooo | |
keep.nodes <- function (phy, nds) { | |
# stats | |
Ntip <- length(phy$tip.label); | |
NEWROOT <- Ntip + 1; | |
Nnode <- phy$Nnode; | |
hasNL <- !is.null(phy$node.label); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(phangorn); | |
# check the monophyletic status of every genus in the tree `phy` | |
check_genus_monophyly <- function (phy) { | |
# get genera. assumes form: Genus_species_whatever | |
gens <- sort(unique(sub("_.*", "", phy$tip.label))); | |
n <- length(gens); | |
cat("Checking ", n, " genera for monophyly status.\n", sep=""); | |
# the number of descendant tips of the MRCA. preallocate for monotypic genera | |
ndec <- rep(1, n); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# report files greater than some size (default 100 MB) | |
# does so recursively starting at some dir (default pwd) | |
# to make executable, do: | |
# chmod +x find_large_files.sh | |
print_help () { | |
echo "Recursively find all files larger than some size" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# extract subtree induced from a set of tips | |
subtree.induced <- function (phy, tip) { | |
if (!inherits(phy, "phylo")) { | |
stop("object \"phy\" is not of class \"phylo\""); | |
} | |
Ntip <- length(phy$tip.label); | |
# convert to indices if strings passed in | |
if (is.character(tip)) { | |
idx <- match(tip, phy$tip.label); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run from BEASTv1.8.*/native | |
# will compile and install into ../lib/ | |
CC=gcc | |
CFLAGS=-O2 -funroll-loops | |
INCLUDES=-I${JAVA_HOME}/include/ -I${JAVA_HOME}/include/linux | |
all: libNucleotideLikelihoodCore.so libAminoAcidLikelihoodCore.so | |
.c.o: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## written by: | |
# Joseph W. Brown (josephwb, @j0sephwb) | |
# Klaus Schliep (KlausVigo, @Klaus_Schlp) | |
get_mrca_fast <- function(phy, tip) { | |
if (!inherits(phy, "phylo")) { | |
stop('object "phy" is not of class "phylo"'); | |
} | |
if (length(tip) < 2) { | |
return(NULL); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#NEXUS | |
[ *** NOTE (JWB) *** 1st character (all 0, except Dimorphodon_macronyx who was missing the char) in original matrix (Supp. Info. pdf) was a dummy character because TNT is zero-indexed?] | |
[ It has been deleted here so char indices of 'ordered' list line up. So this martix has 457 chars, while the (incorrect) published matrix has 458.] | |
Begin data; | |
Dimensions ntax=75 nchar=457; | |
[Format Datatype=Standard Missing=? Gap=-;] [MRBAYES] | |
Format Datatype=Standard SYMBOLS="0 1 2 3 4" Missing=? Gap=-; [PAUP] | |
MATRIX |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Simple makefile to compile BayesTraitsv3 ## | |
# | |
# Program info: | |
# BayesTraits V3.0 (Mar 14 2017) | |
# Mark Pagel and Andrew Meade | |
# www.evolution.reading.ac.uk | |
# | |
# source: http://www.evolution.rdg.ac.uk/BayesTraitsV3/BayesTraitsV3.html | |
# | |
# By default, compiles serial version. To compile threaded version, do: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gist copied from: https://gist.github.com/emhart/89fd49401bc9795d790ef47ca638726f | |
# for Ubuntu 18, had to do: | |
# sudo apt-get install portaudio19-dev | |
# before installing audio package | |
# might have to install these packages first | |
library("dplyr"); | |
library("audio"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Compile with: | |
* g++ -Wall -std=c++11 dummy.cpp -o dummy -O | |
* Run as: | |
* ./dummy -s *.txt | |
*/ | |
#include <iostream> | |
#include <string> | |
#include <fstream> | |
#include <vector> |
NewerOlder