1 ## clustal.R (2011-03-16)
3 ## Multiple Sequence Alignment with External Applications
5 ## Copyright 2011 Emmanuel Paradis
7 ## This file is part of the R-package `ape'.
8 ## See the file ../COPYING for licensing issues.
10 clustal <- function(x, pw.gapopen = 10, pw.gapext = 0.1,
11 gapopen = 10, gapext = 0.2, exec = NULL,
12 MoreArgs = "", quiet = TRUE)
16 if (os == "Linux") exec <- "clustalw"
17 if (os == "Darwin") exec <- "clustalw2"
18 if (os == "Windows") exec <- "C:/Program Files/ClustalW2/clustalw2"
22 system(paste(exec, "-help"))
23 return(invisible(NULL))
27 inf <- paste(d, "input_clustal.fas", sep = "/")
28 outf <- paste(d, "input_clustal.aln", sep = "/")
29 write.dna(x, inf, "fasta")
30 prefix <- c("-INFILE", "-PWGAPOPEN", "-PWGAPEXT", "-GAPOPEN", "-GAPEXT")
31 suffix <- c(inf, pw.gapopen, pw.gapext, gapopen, gapext)
32 opts <- paste(prefix, suffix, sep = "=", collapse = " ")
33 opts <- paste(opts, MoreArgs)
34 system(paste(exec, opts), ignore.stdout = quiet)
35 read.dna(outf, "clustal")
38 muscle <- function(x, exec = "muscle", MoreArgs = "", quiet = TRUE)
42 return(invisible(NULL))
46 inf <- paste(d, "input_muscle.fas", sep = "/")
47 outf <- paste(d, "output_muscle.fas", sep = "/")
48 write.dna(x, inf, "fasta")
49 opts <- paste("-in", inf, "-out", outf)
50 if (quiet) opts <- paste(opts, "-quiet")
51 opts <- paste(opts, MoreArgs)
52 system(paste(exec, opts))
53 read.dna(outf, "fasta")
56 tcoffee <- function(x, exec = "t_coffee", MoreArgs = "", quiet = TRUE)
60 return(invisible(NULL))
66 inf <- "input_tcoffee.fas"
67 write.dna(x, inf, "fasta")
68 opts <- paste(inf, MoreArgs)
69 if (quiet) opts <- paste(opts, "-quiet=nothing")
70 system(paste(exec, opts))
71 read.dna("input_tcoffee.aln", "clustal")