all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add crossmap.
@ 2015-02-26 15:38 Ricardo Wurmus
  2015-02-28 14:53 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Ricardo Wurmus @ 2015-02-26 15:38 UTC (permalink / raw
  To: Guix-devel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-gnu-Add-crossmap.patch --]
[-- Type: text/x-patch, Size: 7821 bytes --]

From e93da9b48bafbbfa56fe348cabad9e074eda63fb Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
Date: Thu, 26 Feb 2015 16:34:49 +0100
Subject: [PATCH] gnu: Add crossmap.

* gnu/packages/bioinformatics.scm (crossmap): New variable.
* gnu/packages/patches/crossmap-allow-system-pysam.patch: New file.
* gnu-system.am (dist_patch_DATA): Add it.
---
 gnu-system.am                                      |   1 +
 gnu/packages/bioinformatics.scm                    |  42 ++++++++
 .../patches/crossmap-allow-system-pysam.patch      | 113 +++++++++++++++++++++
 3 files changed, 156 insertions(+)
 create mode 100644 gnu/packages/patches/crossmap-allow-system-pysam.patch

diff --git a/gnu-system.am b/gnu-system.am
index e42e89a..a500ec7 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -375,6 +375,7 @@ dist_patch_DATA =						\
   gnu/packages/patches/cpio-CVE-2014-9112-pt5.patch		\
   gnu/packages/patches/cpio-gets-undeclared.patch		\
   gnu/packages/patches/cpufrequtils-fix-aclocal.patch		\
+  gnu/packages/patches/crossmap-allow-system-pysam.patch	\
   gnu/packages/patches/cssc-gets-undeclared.patch               \
   gnu/packages/patches/cssc-missing-include.patch               \
   gnu/packages/patches/clucene-contribs-lib.patch               \
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 1103d92..749d0a0 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -272,6 +272,48 @@ gapped, local, and paired-end alignment modes.")
      "CLIPper is a tool to define peaks in CLIP-seq datasets.")
     (license license:gpl2)))
 
+(define-public crossmap
+  (package
+    (name "crossmap")
+    (version "0.1.6")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/crossmap/CrossMap-"
+                                  version ".tar.gz"))
+              (sha256
+               (base32
+                "163hi5gjgij6cndxlvbkp5jjwr0k4wbm9im6d2210278q7k9kpnp"))
+              ;; patch has been sent upstream already
+              (patches (list
+                        (search-patch "crossmap-allow-system-pysam.patch")))
+              (modules '((guix build utils)))
+              ;; remove bundled copy of pysam
+              (snippet
+               '(delete-file-recursively "lib/pysam"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:python ,python-2
+       #:phases
+       (alist-cons-after
+        'unpack 'set-env
+        (lambda _ (setenv "CROSSMAP_USE_SYSTEM_PYSAM" "1"))
+        %standard-phases)))
+    (inputs
+     `(("python-numpy" ,python2-numpy)
+       ("python-pysam" ,python2-pysam)
+       ("zlib" ,zlib)))
+    (native-inputs
+     `(("python-cython" ,python2-cython)
+       ("python-nose" ,python2-nose)
+       ("python-setuptools" ,python2-setuptools)))
+    (home-page "http://crossmap.sourceforge.net/")
+    (synopsis "Convert genome coordinates between assemblies")
+    (description
+     "CrossMap is a program for conversion of genome coordinates or annotation
+files between different genome assemblies.  It supports most commonly used
+file formats including SAM/BAM, Wiggle/BigWig, BED, GFF/GTF, VCF.")
+    (license license:gpl2+)))
+
 (define-public flexbar
   (package
     (name "flexbar")
diff --git a/gnu/packages/patches/crossmap-allow-system-pysam.patch b/gnu/packages/patches/crossmap-allow-system-pysam.patch
new file mode 100644
index 0000000..a16f901
--- /dev/null
+++ b/gnu/packages/patches/crossmap-allow-system-pysam.patch
@@ -0,0 +1,113 @@
+diff --git a/setup.py b/setup.py
+--- a/setup.py	2015-02-26 15:28:49.771189185 +0100
++++ b/setup.py	2015-02-26 15:55:03.440327752 +0100
+@@ -19,6 +19,15 @@
+ except:
+ 	have_numpy = False
+ 
++try:
++	import pysam
++	if os.environ['CROSSMAP_USE_SYSTEM_PYSAM']:
++		have_pysam = True
++	else:
++		have_pysam = False
++except ImportError:
++	have_pysam = False
++
+ if platform.system()=='Windows':
+ 	print >> sys.stderr, "Sorry, Windows platform is not supported!"
+ 	sys.exit()
+@@ -165,49 +174,50 @@
+ 	
+ 	
+ 	#================= pysam samtools ====================
+-	extensions.append(Extension(
+-    	"pysam.csamtools",              
+-		csamtools_sources + [ "lib/pysam/%s" % x for x in ("pysam_util.c", )] +\
+-		glob.glob( os.path.join( "lib/samtools", "*.pysam.c" )) +\
+-		os_c_files + \
+-		glob.glob( os.path.join( "lib/samtools", "*", "*.pysam.c" ) ),
+-		library_dirs=[],
+-		include_dirs=[ "lib/samtools", "lib/pysam" ] + include_os,
+-		libraries=[ "z", ],
+-		language="c",
+-		define_macros = [('_FILE_OFFSET_BITS','64'),('_USE_KNETFILE','')], 
+-    ))
+-
+-	extensions.append(Extension(
+-		"pysam.ctabix",                   
+-		tabix_sources + [ "lib/pysam/%s" % x for x in ( "tabix_util.c", )] +\
+-		os_c_files + \
+-		glob.glob( os.path.join( "lib/tabix", "*.pysam.c" ) ),
+-		library_dirs=[],
+-		include_dirs=[ "lib/tabix", "lib/pysam" ] + include_os,
+-		libraries=[ "z", ],
+-		language="c",
+-		define_macros = [('_FILE_OFFSET_BITS','64'),
+-                     ('_USE_KNETFILE','')], 
+-    ))
+-
+-	extensions.append(Extension(
+-		"pysam.TabProxies",               
+-		tabproxies_sources + os_c_files,
+-		library_dirs=[],
+-		include_dirs= include_os,
+-		libraries=[ "z", ],
+-		language="c",
+-    ))
+-
+-	extensions.append(Extension(
+-		"pysam.cvcf",                   
+-		cvcf_sources + os_c_files,
+-		library_dirs=[],
+-		include_dirs= ["lib/tabix",] + include_os,
+-		libraries=[ "z", ],
+-		language="c",
+-    ))
++        if not have_pysam:
++                extensions.append(Extension(
++                        "pysam.csamtools",              
++                        csamtools_sources + [ "lib/pysam/%s" % x for x in ("pysam_util.c", )] +\
++                        glob.glob( os.path.join( "lib/samtools", "*.pysam.c" )) +\
++                        os_c_files + \
++                        glob.glob( os.path.join( "lib/samtools", "*", "*.pysam.c" ) ),
++                        library_dirs=[],
++                        include_dirs=[ "lib/samtools", "lib/pysam" ] + include_os,
++                        libraries=[ "z", ],
++                        language="c",
++                        define_macros = [('_FILE_OFFSET_BITS','64'),('_USE_KNETFILE','')], 
++                ))
++
++                extensions.append(Extension(
++                        "pysam.ctabix",                   
++                        tabix_sources + [ "lib/pysam/%s" % x for x in ( "tabix_util.c", )] +\
++                        os_c_files + \
++                        glob.glob( os.path.join( "lib/tabix", "*.pysam.c" ) ),
++                        library_dirs=[],
++                        include_dirs=[ "lib/tabix", "lib/pysam" ] + include_os,
++                        libraries=[ "z", ],
++                        language="c",
++                        define_macros = [('_FILE_OFFSET_BITS','64'),
++                                         ('_USE_KNETFILE','')], 
++                ))
++
++                extensions.append(Extension(
++                        "pysam.TabProxies",               
++                        tabproxies_sources + os_c_files,
++                        library_dirs=[],
++                        include_dirs= include_os,
++                        libraries=[ "z", ],
++                        language="c",
++                ))
++
++                extensions.append(Extension(
++                        "pysam.cvcf",                   
++                        cvcf_sources + os_c_files,
++                        library_dirs=[],
++                        include_dirs= ["lib/tabix",] + include_os,
++                        libraries=[ "z", ],
++                        language="c",
++                ))
+ 
+ 
+ 	return extensions     
-- 
2.1.0

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

* Re: [PATCH] gnu: Add crossmap.
  2015-02-26 15:38 [PATCH] gnu: Add crossmap Ricardo Wurmus
@ 2015-02-28 14:53 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2015-02-28 14:53 UTC (permalink / raw
  To: Ricardo Wurmus; +Cc: Guix-devel

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

> From e93da9b48bafbbfa56fe348cabad9e074eda63fb Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
> Date: Thu, 26 Feb 2015 16:34:49 +0100
> Subject: [PATCH] gnu: Add crossmap.
>
> * gnu/packages/bioinformatics.scm (crossmap): New variable.
> * gnu/packages/patches/crossmap-allow-system-pysam.patch: New file.
> * gnu-system.am (dist_patch_DATA): Add it.

[...]

> diff --git a/gnu/packages/patches/crossmap-allow-system-pysam.patch b/gnu/packages/patches/crossmap-allow-system-pysam.patch
> new file mode 100644
> index 0000000..a16f901
> --- /dev/null
> +++ b/gnu/packages/patches/crossmap-allow-system-pysam.patch

Please add a comment at the top of this file explaining what it does and
what its upstream status is.

OK to commit with this change.

Thanks,
Ludo’.

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

end of thread, other threads:[~2015-02-28 14:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-26 15:38 [PATCH] gnu: Add crossmap Ricardo Wurmus
2015-02-28 14:53 ` Ludovic Courtès

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.