R {ape} clustal cannot find clustalw2

954 Views Asked by At

I am a beginner in R.

I would like to use R clustal function in package ape to process my DNA sequence, so I can us {pegas} to perform further analysis.

However, when I first try the example provided in the manual:

clustal(woodmouse, pw.gapopen = 1, pw.gapext = 1, exec = "clustalw2")

But I got an error message:

/bin/sh: clustalw2: command not found
Error in file(file, "r") : cannot open the connection. In addition: Warning massage: In file(file, "r") : cannot open file '/var/folders/vm/fzyykk3x21g55fdvpctj7s900000gn/T//Rtmp0RjsMr/input_clustal.aln' :No such file or directory

I would like to know how to fix this problem? By the way, the OS I use is Mac OS 10.9. Thank you.

1

There are 1 best solutions below

0
On

Make sure that you have clustalw2 installed. Download *.msi from here:

http://www.clustal.org/download/current/

Then run

require(ape) fix(clustal)

Make sure that the following part of the clustal function:

shortPathName("C:/Program Files/ClustalW2/clustalw2.exe")

...matches the placement of clustalw2.exe in your system perfectly. Also exhange all the "/" with "\".

Hope that works - worked for me...