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
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
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); | |
OlderNewer