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

Run trimal with outsider in R

Build Status

TRIMAL: Automated removal of spurious sequences or poorly aligned regions from a multiple sequence alignment

Install and look up help

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

The module provides two functions trimal, the main program for trimming alignments, and readal, a convenience tool for converting alignments into different file formats.

Examples

Both functions have two arguments:

The arglist function must be a character vector. For example, a call to a command-line program, like ...

command -xarg file --yarg --zarg=p1

Would be in R ...

command(arglist=c('-xarg', file, '--yarg', '--zarg=p1'))

All the arguments indicated with the -h flag for both trimal and readal can be specified in the above way.

trimal

library(outsider)
# import
trimal <- module_import('trimal', repo = 'dombennett/om..trimal')
# help
trimal('-h')

# Real Example
# download
wd <- file.path(tempdir(), 'trimal_example')
if (!dir.exists(wd)) {
  dir.create(wd)
}
alignment_file <- file.path(wd, 'example_alignment.fasta')
url <- 'https://raw.githubusercontent.com/DomBennett/om..trimal/master/example_alignment.fasta'
download.file(url = url, destfile = alignment_file)
# run trimal with automated1 method
trimal(arglist = c('-in', alignment_file, '-out', 'trimal_results.fasta',
                   '-automated1', '-fasta'), outdir = wd)

# verify
list.files(wd)
if('wd' %in% ls() && dir.exists(wd)) {
  unlink(x = wd, recursive = TRUE, force = TRUE)
}

readal

library(outsider)
# import
readal <- module_import('readal', repo = 'dombennett/om..trimal')
# help
readal('-h')

# Real Example
# download
wd <- file.path(tempdir(), 'readal_example')
if (!dir.exists(wd)) {
  dir.create(wd)
}
alignment_file <- file.path(wd, 'example_alignment.fasta')
url <- 'https://raw.githubusercontent.com/DomBennett/om..trimal/master/example_alignment.fasta'
download.file(url = url, destfile = alignment_file)
# get info
readal(arglist = c('-in', alignment_file, '-info'), outdir = wd)
# convert to phylip
readal(arglist = c('-in', alignment_file, '-out', 'example_alignment.phylip',
                   '-phylip_m10'), outdir = wd)

# verify
list.files(wd)
if('wd' %in% ls() && dir.exists(wd)) {
  unlink(x = wd, recursive = TRUE, force = TRUE)
}
module_uninstall(repo = "dombennett/om..trimal")

Links

Find out more by visiting the trimAL homepage.

Please cite


An outsider module

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



DomBennett/om..trimal documentation built on Jan. 22, 2020, 1:01 p.m.