Patchwork [2/4] gnu: Add ncbi-tools.

login
register
mail settings
Submitter Ben Woodcroft
Date Dec. 3, 2016, 10:38 a.m.
Message ID <20161203103901.27770-2-donttrustben@gmail.com>
Download mbox | patch
Permalink /patch/18151/
State New
Headers show

Comments

Ben Woodcroft - Dec. 3, 2016, 10:38 a.m.
* gnu/packages/bioinformatics.scm (ncbi-tools): New variable.
---
 gnu/packages/bioinformatics.scm | 62 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)
Ricardo Wurmus - Dec. 3, 2016, 7:19 p.m.
Hi Ben,

thank you for the patch!

> * gnu/packages/bioinformatics.scm (ncbi-tools): New variable.
> ---
>  gnu/packages/bioinformatics.scm | 62 +++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 62 insertions(+)

[…]

> +       #:phases
> +       (modify-phases %standard-phases
> +         (delete 'configure)
> +         (add-after 'unpack 'patch-sources
> +            (lambda _

Indentation here is a little too far.  The opening paren is usually
aligned with the first “d” off “add-after”.

> +              (for-each (lambda (file)
> +                          (substitute* file
> +                            (("NCBI_MAKE_SHELL = .*")
> +                             (string-append
> +                              "NCBI_MAKE_SHELL = "
> +                              (which "sh")
> +                              "\n"))))
> +                        (find-files "platform" ".*mk"))

Here I’d use

    (substitute* (find-files "platform" ".*mk")
      …)

“substitute*” can take a list of files.  That’s nicer than using
“for-each” here.

> +              (substitute* "make/ln-if-absent"
> +                (("set path=\\(/usr/bin /bin\\)") ""))
> +              #t))
> +         (replace 'build
> +            (lambda _

Same as above; it’s a little too far to the right.

> +              (chdir "..")
> +              (zero? (system* "ncbi/make/makedis.csh"))))
> +         (replace 'install
> +           (lambda* (#:key outputs #:allow-other-keys)

And the same here.

> +             (let* ((out (assoc-ref outputs "out"))
> +                    (bin (string-append out "/bin"))
> +                    (man (string-append out "/share/man/man1")))
> +               (for-each (lambda (file)
> +                           (install-file
> +                            (string-append "ncbi/build/" file) bin)
> +                           (install-file
> +                            (string-append "ncbi/doc/man/" file ".1") man))
> +                         ;; XXX: TODO: Install and test other binaries.
> +                         (list "tbl2asn"))
> +               #t))))))
> +    (native-inputs
> +     `(("csh" ,tcsh)
> +       ("pkg-config" ,pkg-config)
> +       ("coreutils" ,coreutils)))
> +    (home-page "https://www.ncbi.nlm.nih.gov/IEB/ToolBox/MainPage/index.html")
> +    (synopsis "NCBI-related tools")
> +    (description "The United States of America @dfn{National Center for
> +Biotechnology Information} (NCBI) Software Development Toolkit is for the
> +production and distribution of GenBank, Entrez, BLAST and related NCBI
> +services.")
> +    (license license:public-domain)))
> +

Okay with these changes.  Thank you!
Marius Bakke - Dec. 3, 2016, 7:30 p.m.
Ben Woodcroft <donttrustben@gmail.com> writes:

> * gnu/packages/bioinformatics.scm (ncbi-tools): New variable.
> ---
>  gnu/packages/bioinformatics.scm | 62 +++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 62 insertions(+)
>
> diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
> index 415024f..961f0b2 100644
> --- a/gnu/packages/bioinformatics.scm
> +++ b/gnu/packages/bioinformatics.scm
> @@ -80,6 +80,7 @@
>    #:use-module (gnu packages readline)
>    #:use-module (gnu packages ruby)
>    #:use-module (gnu packages serialization)
> +  #:use-module (gnu packages shells)
>    #:use-module (gnu packages statistics)
>    #:use-module (gnu packages tbb)
>    #:use-module (gnu packages tex)
> @@ -4340,6 +4341,67 @@ simultaneously.")
>         ("ngs-sdk" ,ngs-sdk)))
>      (synopsis "Java bindings for NGS SDK")))
>  
> +(define-public ncbi-tools
> +  (package
> +    (name "ncbi-tools")
> +    (version "20160908")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append "ftp://ftp.ncbi.nih.gov/toolbox/ncbi_tools/old/"
> +                           version "/ncbi.tar.gz"))

I'm getting a timeout on this, though it works in a browser. However
this server is apparently also available over HTTPS, which is better.

> +       (file-name (string-append name "-" version ".tar.gz"))
> +       (sha256
> +        (base32
> +         "1252s4fw41w5yalz9b50pvzvkiyjfcgy0isw1qgmg0v66bp49khz"))))
> +    (build-system gnu-build-system)
> +    (arguments
> +     `(#:tests? #f ; There are no tests.
> +       #:phases
> +       (modify-phases %standard-phases
> +         (delete 'configure)
> +         (add-after 'unpack 'patch-sources
> +            (lambda _
> +              (for-each (lambda (file)
> +                          (substitute* file
> +                            (("NCBI_MAKE_SHELL = .*")
> +                             (string-append
> +                              "NCBI_MAKE_SHELL = "
> +                              (which "sh")
> +                              "\n"))))
> +                        (find-files "platform" ".*mk"))
> +              (substitute* "make/ln-if-absent"
> +                (("set path=\\(/usr/bin /bin\\)") ""))
> +              #t))
> +         (replace 'build
> +            (lambda _
> +              (chdir "..")
> +              (zero? (system* "ncbi/make/makedis.csh"))))
> +         (replace 'install
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (bin (string-append out "/bin"))
> +                    (man (string-append out "/share/man/man1")))
> +               (for-each (lambda (file)
> +                           (install-file
> +                            (string-append "ncbi/build/" file) bin)
> +                           (install-file
> +                            (string-append "ncbi/doc/man/" file ".1") man))
> +                         ;; XXX: TODO: Install and test other binaries.
> +                         (list "tbl2asn"))
> +               #t))))))
> +    (native-inputs
> +     `(("csh" ,tcsh)
> +       ("pkg-config" ,pkg-config)
> +       ("coreutils" ,coreutils)))
> +    (home-page "https://www.ncbi.nlm.nih.gov/IEB/ToolBox/MainPage/index.html")
> +    (synopsis "NCBI-related tools")
> +    (description "The United States of America @dfn{National Center for
> +Biotechnology Information} (NCBI) Software Development Toolkit is for the
> +production and distribution of GenBank, Entrez, BLAST and related NCBI
> +services.")
> +    (license license:public-domain)))

The files in regexp/ are released under a custom license found in
regexp/doc/LICENSE. Also corelib/regex.{c.h} are GPL2+.

algo/blast/core/boost_erf.c is covered by boost1.0, and
connect/parson.{c,h} are MIT. Some files in connect/mitsock seems to be
covered by an early variant of the 2-clause BSD.

Other files have unclear license terms such as those in
corelib/morefiles, though they seem sufficiently free for the
non-copyleft procedure. LGTM with these updates!

> +
>  (define-public ncbi-vdb
>    (package
>      (name "ncbi-vdb")
> -- 
> 2.10.2

Patch

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 415024f..961f0b2 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -80,6 +80,7 @@ 
   #:use-module (gnu packages readline)
   #:use-module (gnu packages ruby)
   #:use-module (gnu packages serialization)
+  #:use-module (gnu packages shells)
   #:use-module (gnu packages statistics)
   #:use-module (gnu packages tbb)
   #:use-module (gnu packages tex)
@@ -4340,6 +4341,67 @@  simultaneously.")
        ("ngs-sdk" ,ngs-sdk)))
     (synopsis "Java bindings for NGS SDK")))
 
+(define-public ncbi-tools
+  (package
+    (name "ncbi-tools")
+    (version "20160908")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "ftp://ftp.ncbi.nih.gov/toolbox/ncbi_tools/old/"
+                           version "/ncbi.tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "1252s4fw41w5yalz9b50pvzvkiyjfcgy0isw1qgmg0v66bp49khz"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f ; There are no tests.
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (add-after 'unpack 'patch-sources
+            (lambda _
+              (for-each (lambda (file)
+                          (substitute* file
+                            (("NCBI_MAKE_SHELL = .*")
+                             (string-append
+                              "NCBI_MAKE_SHELL = "
+                              (which "sh")
+                              "\n"))))
+                        (find-files "platform" ".*mk"))
+              (substitute* "make/ln-if-absent"
+                (("set path=\\(/usr/bin /bin\\)") ""))
+              #t))
+         (replace 'build
+            (lambda _
+              (chdir "..")
+              (zero? (system* "ncbi/make/makedis.csh"))))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin"))
+                    (man (string-append out "/share/man/man1")))
+               (for-each (lambda (file)
+                           (install-file
+                            (string-append "ncbi/build/" file) bin)
+                           (install-file
+                            (string-append "ncbi/doc/man/" file ".1") man))
+                         ;; XXX: TODO: Install and test other binaries.
+                         (list "tbl2asn"))
+               #t))))))
+    (native-inputs
+     `(("csh" ,tcsh)
+       ("pkg-config" ,pkg-config)
+       ("coreutils" ,coreutils)))
+    (home-page "https://www.ncbi.nlm.nih.gov/IEB/ToolBox/MainPage/index.html")
+    (synopsis "NCBI-related tools")
+    (description "The United States of America @dfn{National Center for
+Biotechnology Information} (NCBI) Software Development Toolkit is for the
+production and distribution of GenBank, Entrez, BLAST and related NCBI
+services.")
+    (license license:public-domain)))
+
 (define-public ncbi-vdb
   (package
     (name "ncbi-vdb")