unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#28802] [PATCH] gnu: Add paml.
@ 2017-10-12 21:56 Ricardo Wurmus
  2017-10-13  8:51 ` Ludovic Courtès
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Ricardo Wurmus @ 2017-10-12 21:56 UTC (permalink / raw)
  To: 28802; +Cc: Ricardo Wurmus

From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>

* gnu/packages/bioinformatics.scm (paml): New variable.
---
 gnu/packages/bioinformatics.scm | 50 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 9a47b076c..2de57d447 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -10085,3 +10085,53 @@ straight away.  Its main features are:
   and CHH context
 @end itemize\n")
     (license license:gpl3+)))
+
+(define-public paml
+  (package
+    (name "paml")
+    (version "4.9e")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://abacus.gene.ucl.ac.uk/software/"
+                                  "paml" version ".tgz"))
+              (sha256
+               (base32
+                "13zf6h9fiqghwhch2h06x1zdr6s42plsnqahflp5g7myr3han3s6"))
+              (modules '((guix build utils)))
+              ;; Remove Windows binaries
+              (snippet
+               '(begin
+                  (for-each delete-file (find-files "." "\\.exe$"))
+                  #t))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f ; there are no tests
+       #:make-flags '("CC=gcc")
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'configure
+           (lambda _
+             (substitute* "src/BFdriver.c"
+               (("/bin/bash") (which "bash")))
+             (chdir "src")
+             #t))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((tools '("baseml" "basemlg" "codeml"
+                            "pamp" "evolver" "yn00" "chi2"))
+                   (bin    (string-append (assoc-ref outputs "out") "/bin"))
+                   (docdir (string-append (assoc-ref outputs "out")
+                                           "/share/doc/paml"))
+                   (docs    '("Bismark_User_Guide.pdf"
+                              "RELEASE_NOTES.txt")))
+               (mkdir-p bin)
+               (for-each (lambda (file) (install-file file bin)) tools)
+               (copy-recursively "../doc" docdir)
+               #t))))))
+    (home-page "http://abacus.gene.ucl.ac.uk/software/paml.html")
+    (synopsis "Phylogentic analysis by maximum likelihood")
+    (description "PAML (for Phylogentic Analysis by Maximum Likelihood)
+contains a few programs for model fitting and phylogenetic tree reconstruction
+using nucleotide or amino-acid sequence data.")
+    ;; GPLv3 only
+    (license license:gpl3)))
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#28802] [PATCH] gnu: Add paml.
  2017-10-12 21:56 [bug#28802] [PATCH] gnu: Add paml Ricardo Wurmus
@ 2017-10-13  8:51 ` Ludovic Courtès
  2017-10-13  9:15 ` bug#28802: " Ricardo Wurmus
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2017-10-13  8:51 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: Ricardo Wurmus, 28802

Ricardo Wurmus <rekado@elephly.net> skribis:

> From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
>
> * gnu/packages/bioinformatics.scm (paml): New variable.

LGTM, thanks!

Ludo'.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#28802: [PATCH] gnu: Add paml.
  2017-10-12 21:56 [bug#28802] [PATCH] gnu: Add paml Ricardo Wurmus
  2017-10-13  8:51 ` Ludovic Courtès
@ 2017-10-13  9:15 ` Ricardo Wurmus
  2017-10-13  9:23 ` [bug#28802] " Ben Woodcroft
  2017-10-13 10:22 ` Roel Janssen
  3 siblings, 0 replies; 7+ messages in thread
From: Ricardo Wurmus @ 2017-10-13  9:15 UTC (permalink / raw)
  To: 28802-done


> +                   (docs    '("Bismark_User_Guide.pdf"
> +                              "RELEASE_NOTES.txt")))

I removed this, because it is not used.
“guix lint” does not complain, so I pushed it to master.

-- 
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#28802] [PATCH] gnu: Add paml.
  2017-10-12 21:56 [bug#28802] [PATCH] gnu: Add paml Ricardo Wurmus
  2017-10-13  8:51 ` Ludovic Courtès
  2017-10-13  9:15 ` bug#28802: " Ricardo Wurmus
@ 2017-10-13  9:23 ` Ben Woodcroft
  2017-10-13  9:35   ` Ricardo Wurmus
  2017-10-13 10:22 ` Roel Janssen
  3 siblings, 1 reply; 7+ messages in thread
From: Ben Woodcroft @ 2017-10-13  9:23 UTC (permalink / raw)
  To: Ricardo Wurmus, 28802; +Cc: Ricardo Wurmus

Hi Ricardo,

Thanks for the package.


On 13/10/17 07:56, Ricardo Wurmus wrote:
> +         (replace 'install
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let ((tools '("baseml" "basemlg" "codeml"
> +                            "pamp" "evolver" "yn00" "chi2"))
> +                   (bin    (string-append (assoc-ref outputs "out") "/bin"))
> +                   (docdir (string-append (assoc-ref outputs "out")
> +                                           "/share/doc/paml"))
> +                   (docs    '("Bismark_User_Guide.pdf"
> +                              "RELEASE_NOTES.txt")))
> +               (mkdir-p bin)
Since you've already pushed I didn't test out this package, but I notice 
that the above line is superfluous (though harmless).
ben

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#28802] [PATCH] gnu: Add paml.
  2017-10-13  9:23 ` [bug#28802] " Ben Woodcroft
@ 2017-10-13  9:35   ` Ricardo Wurmus
  0 siblings, 0 replies; 7+ messages in thread
From: Ricardo Wurmus @ 2017-10-13  9:35 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: 28802


Hi Ben,

> On 13/10/17 07:56, Ricardo Wurmus wrote:
>> +         (replace 'install
>> +           (lambda* (#:key outputs #:allow-other-keys)
>> +             (let ((tools '("baseml" "basemlg" "codeml"
>> +                            "pamp" "evolver" "yn00" "chi2"))
>> +                   (bin    (string-append (assoc-ref outputs "out") "/bin"))
>> +                   (docdir (string-append (assoc-ref outputs "out")
>> +                                           "/share/doc/paml"))
>> +                   (docs    '("Bismark_User_Guide.pdf"
>> +                              "RELEASE_NOTES.txt")))
>> +               (mkdir-p bin)
> Since you've already pushed I didn't test out this package, but I notice 
> that the above line is superfluous (though harmless).

I removed the “docs” definition before pushing.

-- Ricardo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#28802] [PATCH] gnu: Add paml.
  2017-10-12 21:56 [bug#28802] [PATCH] gnu: Add paml Ricardo Wurmus
                   ` (2 preceding siblings ...)
  2017-10-13  9:23 ` [bug#28802] " Ben Woodcroft
@ 2017-10-13 10:22 ` Roel Janssen
  2017-10-13 13:25   ` Ricardo Wurmus
  3 siblings, 1 reply; 7+ messages in thread
From: Roel Janssen @ 2017-10-13 10:22 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: Ricardo Wurmus, 28802


Ricardo Wurmus writes:

> From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
>
> * gnu/packages/bioinformatics.scm (paml): New variable.
> ---
>  gnu/packages/bioinformatics.scm | 50 +++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 50 insertions(+)
>
> diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
> index 9a47b076c..2de57d447 100644
> --- a/gnu/packages/bioinformatics.scm
> +++ b/gnu/packages/bioinformatics.scm
> @@ -10085,3 +10085,53 @@ straight away.  Its main features are:
>    and CHH context
>  @end itemize\n")
>      (license license:gpl3+)))
> +
> +(define-public paml
> +  (package
> +    (name "paml")
> +    (version "4.9e")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append "http://abacus.gene.ucl.ac.uk/software/"
> +                                  "paml" version ".tgz"))
> +              (sha256
> +               (base32
> +                "13zf6h9fiqghwhch2h06x1zdr6s42plsnqahflp5g7myr3han3s6"))
> +              (modules '((guix build utils)))
> +              ;; Remove Windows binaries
> +              (snippet
> +               '(begin
> +                  (for-each delete-file (find-files "." "\\.exe$"))
> +                  #t))))
> +    (build-system gnu-build-system)
> +    (arguments
> +     `(#:tests? #f ; there are no tests
> +       #:make-flags '("CC=gcc")
> +       #:phases
> +       (modify-phases %standard-phases
> +         (replace 'configure
> +           (lambda _
> +             (substitute* "src/BFdriver.c"
> +               (("/bin/bash") (which "bash")))
> +             (chdir "src")
> +             #t))
> +         (replace 'install
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let ((tools '("baseml" "basemlg" "codeml"
> +                            "pamp" "evolver" "yn00" "chi2"))
> +                   (bin    (string-append (assoc-ref outputs "out") "/bin"))
> +                   (docdir (string-append (assoc-ref outputs "out")
> +                                           "/share/doc/paml"))
> +                   (docs    '("Bismark_User_Guide.pdf"
> +                              "RELEASE_NOTES.txt")))
> +               (mkdir-p bin)
> +               (for-each (lambda (file) (install-file file bin)) tools)
> +               (copy-recursively "../doc" docdir)
> +               #t))))))
> +    (home-page "http://abacus.gene.ucl.ac.uk/software/paml.html")
> +    (synopsis "Phylogentic analysis by maximum likelihood")
> +    (description "PAML (for Phylogentic Analysis by Maximum Likelihood)
> +contains a few programs for model fitting and phylogenetic tree reconstruction
> +using nucleotide or amino-acid sequence data.")
> +    ;; GPLv3 only
> +    (license license:gpl3)))

I guess I'm too late already.  I had a similar patch, but the program
uses the data files it ships with, and expects them to be in the same
location.  So this patch seems incomplete to me.

Anyway.. it has already been pushed.

Kind regards,
Roel Janssen

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#28802] [PATCH] gnu: Add paml.
  2017-10-13 10:22 ` Roel Janssen
@ 2017-10-13 13:25   ` Ricardo Wurmus
  0 siblings, 0 replies; 7+ messages in thread
From: Ricardo Wurmus @ 2017-10-13 13:25 UTC (permalink / raw)
  To: Roel Janssen; +Cc: Ricardo Wurmus, 28802


Hi Roel,

> I guess I'm too late already.  I had a similar patch, but the program
> uses the data files it ships with, and expects them to be in the same
> location.  So this patch seems incomplete to me.

Oh, that’s too bad.  Do you have a test case we could use to verify that
the tools work correctly after installation?

It doesn’t seem to be easy to fix this, as variables in which file names
are stored are size-restricted, and as they are copied around multiple
times it is difficult to ensure that our patch wouldn’t break things.

Here’s an untested draft of the new phases, but I suspect this would
take a lot more work:

--8<---------------cut here---------------start------------->8---
       (modify-phases %standard-phases
         (replace 'configure
           (lambda _
             (substitute* "src/BFdriver.c"
               (("/bin/bash") (which "bash")))
             (let ((share (string-append (assoc-ref outputs "out")
                                         "/share/paml/")))
               (substitute* ""
                 (("aaRatefile = dat/jones.dat"
                   (string-append "aaRatefile = "
                                  share "jones.dat"))))
               (substitute* '("src/yn00.c"
                              "src/baseml.c"
                              "src/basemlg.c"
                              "src/pamp.c"
                              "src/codeml.c"
                              "src/mcmctree.c"
                              "src/BFdriver.c")
                 (("ctlf\\[...?\\] ?= ?\"(yn00|pamp|baseml|codeml|mcmctree).ctl\"" _ file)
                  (string-append "ctlf[PATH_MAX]=\""
                                 share file ".ctl\"")))
               (substitute* "src/codeml.c"
                 (("strcpy\\(com.daafile, \"jones.dat\"\\)")
                  (string-append "strcpy(com.daafile, \""
                                 share "jones.dat\")")))
               (substitute* "src/evolver.c"
                 (("char \\*MCctlf0\\[\\]=\\{\"MCbase.dat\",\"MCcodon.dat\",\"MCaa.dat\"\\}")
                  (string-append "char *MCctlf0[]={"
                                 (string-join
                                  (map (lambda (f)
                                         (string-append "\"" share f "\""))
                                       '("MCbase.dat" "MCcodon.dat" "MCaa.dat"))
                                  ",")
                                 "}"))))
             (chdir "src")
             #t))
         (replace 'install
           (lambda* (#:key outputs #:allow-other-keys)
             (let ((tools '("baseml" "basemlg" "codeml"
                            "pamp" "evolver" "yn00" "chi2"))
                   (bin    (string-append (assoc-ref outputs "out") "/bin"))
                   (docdir (string-append (assoc-ref outputs "out")
                                          "/share/doc/paml"))
                   (share  (string-append (assoc-ref outputs "out")
                                          "/share/paml"))
                   (data   (append (find-files ".." "\\.(ctl|dat)$")
                                   (find-files "../dat" "\\.dat$"))))
               (mkdir-p bin)
               (for-each (lambda (file) (install-file file bin)) tools)
               (for-each (lambda (file) (install-file file share)) data)
               (copy-recursively "../doc" docdir)
               #t))))
--8<---------------cut here---------------end--------------->8---

The alternative is to just install the data files to $out/share/paml and
expect users to copy them to their current working directory.  That
seems to work.

I prefer this over patching the code, which is much too invasive.

What do you think?

-- Ricardo

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-10-13 13:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-12 21:56 [bug#28802] [PATCH] gnu: Add paml Ricardo Wurmus
2017-10-13  8:51 ` Ludovic Courtès
2017-10-13  9:15 ` bug#28802: " Ricardo Wurmus
2017-10-13  9:23 ` [bug#28802] " Ben Woodcroft
2017-10-13  9:35   ` Ricardo Wurmus
2017-10-13 10:22 ` Roel Janssen
2017-10-13 13:25   ` Ricardo Wurmus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).