On Mon, 9 Aug 2010 09:37:14 -0700 (PDT)
Dave <[email protected]> wrote:
> Thanks jf, that worked:
>
> (ns msms
> (:gen-class)
> (:use [clojure.contrib.shell-out :only (sh)]))
>
> (defn get-msms-pts-OSX
> [{pdb-file :pdb-file density :density radius :radius :as all :or
> {density "1.0" radius "1.5"}}]
> (if (contains? all :pdb-file)
> (sh "bash" :in (str "/Users/daviddreisigmeyer/msms_MacOSX_2.6.1/
> pdb_to_xyzr " pdb-file
> " >
> /Users/daviddreisigmeyer/lisps/clojure/dpa/src/hold.xyzr && "
> "msms.MacOSX.2.6.1"
> " -if
> /Users/daviddreisigmeyer/lisps/clojure/dpa/src/hold.xyzr"
> " -of
> /Users/daviddreisigmeyer/lisps/clojure/dpa/src/hold -
> no_header -density "
> density " -probe_radius " radius " && "
> "rm -f
> /Users/daviddreisigmeyer/lisps/clojure/dpa/src/hold.xyzr"
> "
> /Users/daviddreisigmeyer/lisps/clojure/dpa/src/hold.face"))
> (println "No pdb-file provided in get-msms-pts-OSX.")))
>
> Without the && in the system call:
>
> (defn get-msms-pts-OSX
> [{pdb-file :pdb-file density :density radius :radius :as all :or
> {density "1.0" radius "1.5"}}]
> (if (contains? all :pdb-file)
> ((sh "bash" :in (str "/Users/daviddreisigmeyer/msms_MacOSX_2.6.1/
^
You've got an extra open paren here, so it's trying to use the value
returned by "sh" (presumably a string) as a function - which fails
with this message:
> java.lang.String cannot be cast to clojure.lang.IFn
>
> Here it would only call the first command. If I added a println
> statement
>
> (defn get-msms-pts-OSX
> ((println "Hi")
^
Same problem. In this case, println returns a null, so the error is:
> No message.
> [Thrown class java.lang.NullPointerException]
>
> Can you see why this would be?
<mike
--
Mike Meyer <[email protected]> http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en