knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
trimal with outsider in RTRIMAL: Automated removal of spurious sequences or poorly aligned regions from a multiple sequence alignment
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.
Both functions have two arguments:
arglist: character vector of arguments to be passed to the programoutdir: File location where all resulting files will be returnedThe 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.
trimallibrary(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) }
readallibrary(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")
Find out more by visiting the trimAL homepage.

An outsider module
Learn more at outsider website.
Want to build your own module? Check out outsider.devtools website.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.