knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

Run raxml through outsider in R

Build Status

Randomized Axelerated Maximum Likelihood (RAxML): Phylogenetic Analysis and Post-Analysis of Large Phylogenies

Install and look up help

library(outsider)
module_install(repo = "dombennett/om..raxml")
#module_help(repo = "dombennett/om..raxml")

Partitioned DNA analysis

All demonstrations are taken from the RAxML "hands-on"

# ----
# Data
# ----
# example DNA
dna_phy <- "10 60
Cow       ATGGCATATCCCATACAACTAGGATTCCAAGATGCAACATCACCAATCATAGAAGAACTA
Carp      ATGGCACACCCAACGCAACTAGGTTTCAAGGACGCGGCCATACCCGTTATAGAGGAACTT
Chicken   ATGGCCAACCACTCCCAACTAGGCTTTCAAGACGCCTCATCCCCCATCATAGAAGAGCTC
Human     ATGGCACATGCAGCGCAAGTAGGTCTACAAGACGCTACTTCCCCTATCATAGAAGAGCTT
Loach     ATGGCACATCCCACACAATTAGGATTCCAAGACGCGGCCTCACCCGTAATAGAAGAACTT
Mouse     ATGGCCTACCCATTCCAACTTGGTCTACAAGACGCCACATCCCCTATTATAGAAGAGCTA
Rat       ATGGCTTACCCATTTCAACTTGGCTTACAAGACGCTACATCACCTATCATAGAAGAACTT
Seal      ATGGCATACCCCCTACAAATAGGCCTACAAGATGCAACCTCTCCCATTATAGAGGAGTTA
Whale     ATGGCATATCCATTCCAACTAGGTTTCCAAGATGCAGCATCACCCATCATAGAAGAGCTC
Frog      ATGGCACACCCATCACAATTAGGTTTTCAAGACGCAGCCTCTCCAATTATAGAAGAATTA"
# example partition
simpleDNApartition <- "DNA, p1=1-30
DNA, p2=31-60"
# Save as binary files
input_file <- file.path(tempdir(), 'dna.phy')
input_connection <- file(input_file, 'wb')
write(file = input_connection, x = dna_phy)
close(input_connection)
partition_file <- file.path(tempdir(), 'simpleDNApartition.txt')
partition_connection <- file(partition_file, 'wb')
write(file = partition_connection, x = simpleDNApartition)
close(partition_connection)


# -----
# RAxML
# -----
library(outsider)
# import function
raxml <- module_import(fname = 'raxml', repo = "dombennett/om..raxml")
# create folder to host results
results_dir <- file.path(tempdir(), 'raxml_example')
dir.create(results_dir)
# run raxml
# arglist = command arguments that would have been passed to command-line
# program.
# Note: R objects are allowed in the arglist, e.g. input_file
raxml(arglist = c('-m', 'GTRGAMMA', '-p', '12345', '-q', partition_file,
                  '-s', input_file, '-n', 'T21'), outdir = results_dir)
# clean-up
file.remove(input_file)
file.remove(partition_file)
unlink(results_dir, recursive = TRUE, force = TRUE)
# uninstall
module_uninstall(repo = 'dombennett/om..raxml')

Key arguments

Some key arguments for running the RAxMl program.

|Argument|Usage|Description| |--------|-----|-----------| |m |-m |Model to run, e.g. GTRGAMMA or GTRCAT| |p |-p # |Specify seed #| |s|-s file|Specify input file| |#|-# #|Specify # iterations| |n|-n name|Specify name of analysis| |q|-q file|Specify partition file|

Additionally, the R interface allows a user to specify an outdir where all the resulting files should be saved. By default, the outdir is the current working directory.

Other examples: from command-line to R

ML

```{bash, ml-shell, eval=FALSE}

command line

raxmlHPC -m BINGAMMA -p 12345 -s binary.phy -# 20 -n T5

```r
# R
raxml(arglist = c('-m', 'BINGAMMA', '-p', '12345', '-s', 'binary.phy', '-#',
'20', '-n', 'T5'))
Ordered morphological character matrix

```{bash, om-shell, eval=FALSE}

command line

raxmlHPC -p 12345 -m MULTIGAMMA -s multiState.phy -K ORDERED -n T12

```r
# R
raxml(arglist = c('-p', '12345', '-m', 'MULTIGAMMA', '-s', 'multiState.phy',
'-K', 'ORDERED', '-n', 'T12'))
Bootstrap

```{bash, bs-shell, eval=FALSE}

command line

raxmlHPC -m GTRCAT -p 12345 -f b -t RAxML_bestTree.T13 -z RAxML_bootstrap.T14 \ -n T15

```r
# R
raxml(arglist = c('-m', 'GTRCAT', '-p', '12345', '-f', 'b', '-t',
'RAxML_bestTree.T13', '-z', 'RAxML_bootstrap.T14', '-n', 'T15'))

Links

Find out more by visiting the RAxML's homepage

Please cite


An outsider module

Learn more at outsider website. Want to build your own module? Check out outsider.devtools website.



DomBennett/om..raxml documentation built on Jan. 21, 2020, 8:38 p.m.