unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Add pbtranscript-tofu.
@ 2015-03-20 13:49 Ricardo Wurmus
  2015-03-24  9:23 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Ricardo Wurmus @ 2015-03-20 13:49 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 799 bytes --]

Hi Guix,

attached is a patch to add a couple of transcriptome analysis scripts.
I had to use the git downloader because the releases are unusable: they
are really old and only contain the scripts but no longer the setup.py
script.

The git clone also isn't that nice; I had to delete some clutter after
unpacking and fix the permissions on the python scripts or else
installation would fail.

About the name: "pbtranscript(-tofu)" is the correct name, whereas
"cDNA_primer" is not, even though the repository is named "cDNA_primer".

This patch depends on three other packages:

- python2-pbcore:
  http://lists.gnu.org/archive/html/guix-devel/2015-03/msg00573.html

- python2-h5py:
  http://lists.gnu.org/archive/html/guix-devel/2015-03/msg00532.html

- python2-bx-python:
  attached

~~ Ricardo


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-python2-bx-python.patch --]
[-- Type: text/x-patch, Size: 2182 bytes --]

From 39f77a513b2505d2a9658f6f9ed40f24a6b93dfd Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
Date: Wed, 18 Mar 2015 14:39:42 +0100
Subject: [PATCH 1/2] gnu: Add python2-bx-python.

* gnu/packages/bioinformatics.scm (python2-bx-python): New variable.
---
 gnu/packages/bioinformatics.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index a8592d0..4ab6054 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -289,6 +289,41 @@ and more accurate.  BWA-MEM also has better performance than BWA-backtrack for
 70-100bp Illumina reads.")
     (license license:gpl3+)))
 
+(define-public python2-bx-python
+  (package
+    (name "python2-bx-python")
+    (version "0.7.2")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://pypi.python.org/packages/source/b/bx-python/bx-python-"
+                    version ".tar.gz"))
+              (sha256
+               (base32
+                "0ld49idhc5zjdvbhvjq1a2qmpjj7h5v58rqr25dzmfq7g34b50xh"))
+              (modules '((guix build utils)))
+              (snippet
+               '(substitute* "setup.py"
+                  ;; remove dependency on outdated "distribute" module
+                  (("^from distribute_setup import use_setuptools") "")
+                  (("^use_setuptools\\(\\)") "")))))
+    (build-system python-build-system)
+    (arguments
+     `(#:tests? #f ;tests fail because test data are not included
+       #:python ,python-2))
+    (inputs
+     `(("python-numpy" ,python2-numpy)
+       ("zlib" ,zlib)))
+    (native-inputs
+     `(("python-nose" ,python2-nose)
+       ("python-setuptools" ,python2-setuptools)))
+    (home-page "http://bitbucket.org/james_taylor/bx-python/")
+    (synopsis "Tools for manipulating biological data")
+    (description
+     "bx-python provides tools for manipulating biological data, particularly
+multiple sequence alignments.")
+    (license license:expat)))
+
 (define-public clipper
   (package
     (name "clipper")
-- 
2.1.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-gnu-Add-pbtranscript-tofu.patch --]
[-- Type: text/x-patch, Size: 3428 bytes --]

From 42c865d2c29b7c68e81580de98997266112d6cd9 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
Date: Fri, 20 Mar 2015 14:36:38 +0100
Subject: [PATCH 2/2] gnu: Add pbtranscript-tofu.

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

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 4ab6054..46ce4f4 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -20,6 +20,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system python)
@@ -738,6 +739,59 @@ that a read originated from a particular isoform.")
 files and writing bioinformatics applications.")
     (license license:bsd-3)))
 
+(define-public pbtranscript-tofu
+  (package
+    (name "pbtranscript-tofu")
+    (version "0.4.1-c7bbd5472")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/PacificBiosciences/cDNA_primer.git")
+                    (commit "c7bbd54720df578777743d687ceaf6b4f6d4919e")))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "148xkzi689c49g6fdhckp6mnmj2qhjdf1j4wifm6ja7ij95d7fxx"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:python ,python-2
+       ;; With standard flags, the install phase attempts to create a zip'd
+       ;; egg file, and fails with an error: 'ZIP does not support timestamps
+       ;; before 1980'
+       #:configure-flags '("--single-version-externally-managed"
+                           "--record=pbtranscript-tofu.txt")
+       #:phases
+       (alist-cons-after
+        'unpack 'enter-directory-and-clean-up
+        (lambda _
+          (chdir "pbtranscript-tofu/pbtranscript/")
+          ;; Delete clutter
+          (delete-file-recursively "dist/")
+          (delete-file-recursively "setuptools_cython-0.2.1-py2.6.egg/")
+          (delete-file-recursively "pbtools.pbtranscript.egg-info")
+          (delete-file "Cython-0.20.1.tar.gz")
+          (delete-file "setuptools_cython-0.2.1-py2.7.egg")
+          (delete-file "setuptools_cython-0.2.1.tar.gz")
+          (delete-file "setup.cfg")
+          ;; files should be writable for install phase
+          (for-each (lambda (f) (chmod f #o755))
+                    (find-files "." "\\.py")))
+        %standard-phases)))
+    (inputs
+     `(("python-cython" ,python2-cython)
+       ("python-numpy" ,python2-numpy)
+       ("python-bx-python" ,python2-bx-python)
+       ("python-pbcore" ,python2-pbcore)))
+    (native-inputs
+     `(("python-nose" ,python2-nose)
+       ("python-setuptools" ,python2-setuptools)))
+    (home-page "https://github.com/PacificBiosciences/cDNA_primer")
+    (synopsis "Analyze transcriptome data generated with the Iso-Seq protocol")
+    (description
+     "pbtranscript-tofu contains scripts to analyze transcriptome data
+generated using the PacBio Iso-Seq protocol.")
+    (license license:bsd-3)))
+
 (define-public rseqc
   (package
     (name "rseqc")
-- 
2.1.0


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

* Re: [PATCH] Add pbtranscript-tofu.
  2015-03-20 13:49 [PATCH] Add pbtranscript-tofu Ricardo Wurmus
@ 2015-03-24  9:23 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2015-03-24  9:23 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

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

> From 39f77a513b2505d2a9658f6f9ed40f24a6b93dfd Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
> Date: Wed, 18 Mar 2015 14:39:42 +0100
> Subject: [PATCH 1/2] gnu: Add python2-bx-python.
>
> * gnu/packages/bioinformatics.scm (python2-bx-python): New variable.

LGTM.

> From 42c865d2c29b7c68e81580de98997266112d6cd9 Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
> Date: Fri, 20 Mar 2015 14:36:38 +0100
> Subject: [PATCH 2/2] gnu: Add pbtranscript-tofu.
>
> * gnu/packages/bioinformatics.scm (pbtranscript-tofu): New variable.

[...]

> +    (version "0.4.1-c7bbd5472")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://github.com/PacificBiosciences/cDNA_primer.git")
> +                    (commit "c7bbd54720df578777743d687ceaf6b4f6d4919e")))

To avoid mistakes in the future, I would do:

  (let ((commit "c7bbd5472"))
    (package
      (version (string-append "0.4.1." commit))
      (source (origin ...
                (commit commit)))
      ;; ...
      ))

Also, I think 0.4.1.c7bbd5472 is slightly nicer than 0.4.1-c7bbd5472.

Other than that LGTM.

Thanks!

Ludo’.

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

end of thread, other threads:[~2015-03-24  9:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-20 13:49 [PATCH] Add pbtranscript-tofu Ricardo Wurmus
2015-03-24  9:23 ` Ludovic Courtès

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).