https://github.com/brentthorne/posterdown
https://github.com/rstudio/pagedown
https://github.com/GerkeLab/betterposter
#Make sure wkhtmltopdf is installed to the path... | |
#Set the working directory | |
mainDir <- getwd() | |
targetFiles <- list.files(pattern = "html", recursive = T, full.names = T) | |
dir.create("0_HTML") | |
targetFilesUpdated <- sub('/0_', "_", targetFiles, fixed = TRUE) | |
targetFilesUpdated <- sub('./', '0_HTML/', targetFilesUpdated) | |
file.rename(targetFiles, targetFilesUpdated) |
library(taxize) | |
library(ape) | |
gen<-unique(unlist(lapply(strsplit(GenBank_Accession_Table$Taxon,' '), function(x)x[[1]][1]))) | |
taxonomy<-do.call(rbind,pblapply(gen, function(x){ | |
tryCatch({ | |
tax_name(query = x, get = c('family',"superfamily"), db = "ncbi") | |
}, error=function(e){}) |
Instructions from Brian (https://github.com/bomeara/phydocker/blob/master/Dockerfile) | |
cd /usr/local/ | |
sudo mkdir pathd8download | |
cd pathd8download | |
sudo wget http://www2.math.su.se/PATHd8/PATHd8.zip | |
sudo unzip PATHd8.zip | |
sudo cc PATHd8.c -O3 -lm -o PATHd8 | |
sudo cp PATHd8 /usr/local/bin/PATHd8 |
#Fasttree tree constraint in R | |
#http://www.microbesonline.org/fasttree/constrained.html | |
#Packages | |
library(ape) | |
library(phylobase) | |
library(adephylo) | |
library(bio3d) | |
library(pbapply) |
library(phytools) | |
# fullNew = path to tree files | |
trees<-lapply(seq_along(fullNew), function(x){ | |
cat(x,'_',fullNew[x], '\n') | |
k<-grep('#NEXUS', readLines(fullNew[x])) | |
#initialize | |
library(shiny) | |
library(ggplot2) | |
library(purrr) | |
library(dplyr) | |
#example data | |
data(iris) |
set.seed(123) # make reproducible | |
M = 10000 # Number of posterior samples | |
N = 20 | |
# sample the IV | |
x = rnorm(N, 10, 5) | |
# regression model for DVs | |
y = 100 + 3*x + rnorm(N,0,10) | |
## Delete missing data (3 in each) |
annotate_rainbow_letters<-function(ggbasePlot, string, initialx, y, letterDistance, | |
wordDistance,uppcaseadditionalDistance){ | |
spup<-strsplit(string, split = "")[[1]] | |
uppLett<-grepl("^[[:upper:]]+$", spup) | |
dostanceVector<-ifelse(spup == " ", wordDistance, letterDistance) | |
if(any(uppLett)){ | |
for(i in 1:length(which(uppLett))){ |
##Not my functions but slighly mod for my use | |
patchify2<-function(x, distance, p4s, givedist=TRUE) { | |
# x: a binary Raster layer (0 or NA for background, and 1 for areas to be clumped) | |
# distance: the neighbourhood distance. Patches that occur within this distance of | |
# one another will be clumped. This should be in the units of the CRS given | |
# in p4s. If this is zero, the function will identify patches defined by | |
# 8-connectivity (i.e. queen's case). | |
# p4s: an equal-area projection appropriate for the region. This will be used when |