I am testing out the bio3d package in R (Windows) and encountered a rather general problem:
The “seqaln” function in bio3d tries to issue the following system command:
#cmd = "muscle -in C:\\Users\\derek\\AppData\\Local\\Temp\\RtmpUSXJCb\\file756f52c9 -out c:/pdb/temp.fas -seqtype protein"
system(shQuote(cmd))
As far as I can tell, nothing happened. However, once I removed the “shQuote”, the function – seqaln – worked as expected. All shQuote does is added a pair of “” around the command:
"\"C:/_utils/muscle.exe -in C:\\Users\\kfoo\\AppData\\Local\\Temp\\RtmpUSXJCb\\file756f52c9 -out c:/pdb/temp.fas -seqtype protein\""
Is there something wrong with using shQuote?
Thanks!
The problem is that you are applying
shQuote()to a character string that contains both a command and it’s arguments. None of the examples inshQuote()does that, and neither should you!The following doesn’t work, for the same reason that
\"echo HelloWorld\"fails when typed directly at Windows’cmdcommand line:Instead, you should do the following:
Or, if both your command and its argument may contain spaces, you can use
shQuote()like this: