Permalink
Browse files

Unification of misopy and pysplicing under one setuppy

  • Loading branch information...
1 parent 437375c commit 35ce05540d1f08582a1298bfa4436e74cb827fbe @yarden committed Dec 25, 2011
Showing with 108 additions and 6 deletions.
  1. +1 −0 .gitignore
  2. +3 −0 MANIFEST.in
  3. +2 −2 Makefile
  4. +0 −1 misopy/module_availability.py
  5. +0 −3 pysplicing/MANIFEST.in
  6. +102 −0 setup.py
View
@@ -1,3 +1,4 @@
+*~
*.pyc
splicing_0.1.tar.gz
pysplicing-0.1.tar.gz
View
@@ -0,0 +1,3 @@
+include pysplicing/include/*
+include pysplicing/src/f2c/*
+include pysplicing/src/lapack/*
View
@@ -44,8 +44,8 @@ PSRC6 = $(wildcard pysplicing/src/*.c) $(wildcard pysplicing/include/*.h) \
Pythonpackage: pysplicing-0.1.tar.gz
-pysplicing-0.1.tar.gz: $(PSRC3) $(PSRC4) $(PSRC5) $(PSRC6) pysplicing/setup.py pysplicing/MANIFEST.in
- rm -f pysplicing/MANIFEST
+pysplicing-0.1.tar.gz: $(PSRC3) $(PSRC4) $(PSRC5) $(PSRC6) pysplicing/setup.py MANIFEST.in
+ rm -f MANIFEST
cd pysplicing && python setup.py sdist -d ..
pysplicing/src/%.c: src/%.c
@@ -36,7 +36,6 @@ def check_module_availability(required_modules):
# parser.add_option("--add-modules", dest="add_modules", action="store_true", default=False,
# help="Try to add modules using the 'modules' system.")
# (options, args) = parser.parse_args()
-
required_modules = ['numpy', 'scipy', 'simplejson', 'matplotlib',
'pysam']
View
@@ -1,3 +0,0 @@
-include include/*
-include src/f2c/*
-include src/lapack/*
View
102 setup.py
@@ -0,0 +1,102 @@
+from distutils.core import setup, Extension
+import distutils.ccompiler
+import glob
+import os
+import sys
+
+## Test for functions, with a hack to suppress compiler warnings.
+cc = distutils.ccompiler.new_compiler()
+defines = []
+if cc.has_function('rintf(1.0);rand', includes=['math.h', 'stdlib.h'],
+ libraries=['m']):
+ defines.append(('HAVE_RINTF', '1'))
+if cc.has_function('finite(1.0);rand', includes=['math.h', 'stdlib.h']):
+ defines.append(('HAVE_FINITE', '1'))
+if cc.has_function('expm1(1.0);rand', includes=['math.h', 'stdlib.h'],
+ libraries=['m']):
+ defines.append(('HAVE_EXPM1', '1'))
+if cc.has_function('rint(1.0);rand', includes=['math.h', 'stdlib.h'],
+ libraries=['m']):
+ defines.append(('HAVE_RINT', '1'))
+if cc.has_function('double log2(double) ; log2(1.0);rand',
+ includes=['math.h', 'stdlib.h'], libraries=['m']):
+ defines.append(('HAVE_LOG2', '1'))
+if cc.has_function('logbl(1.0);rand', includes=['math.h', 'stdlib.h'],
+ libraries=['m']):
+ defines.append(('HAVE_LOGBL', '1'))
+if cc.has_function('snprintf(0, 0, "");rand',
+ includes=['stdio.h', 'stdlib.h']):
+ defines.append(('HAVE_SNPRINTF', '1'))
+if cc.has_function('log1p(1.0);rand', includes=['math.h', 'stdlib.h'],
+ libraries=['m']):
+ defines.append(('HAVE_LOG1P', '1'))
+if cc.has_function('double round(double) ; round(1.0);rand',
+ includes=['math.h', 'stdlib.h'], libraries=['m']):
+ defines.append(('HAVE_ROUND', '1'))
+if cc.has_function('double fmin(double, double); fmin(1.0,0.0);rand',
+ includes=['math.h', 'stdlib.h'], libraries=['m']):
+ defines.append(('HAVE_FMIN', '1'))
+
+# new -- prefix for pysplicing
+pysplicing_dir = 'pysplicing'
+
+# new
+splicingsources = glob.glob(os.path.join(pysplicing_dir, 'src', '*.c'))
+lapacksources = glob.glob(os.path.join(pysplicing_dir, 'src', 'lapack', '*.c'))
+f2csources = glob.glob(os.path.join(pysplicing_dir, 'src', 'f2c', '*.c'))
+
+#old
+#splicingsources = glob.glob(os.path.join('src', '*.c'))
+#lapacksources = glob.glob(os.path.join('src/lapack', '*.c'))
+#f2csources = glob.glob(os.path.join('src/f2c', '*.c'))
+
+sources = splicingsources + lapacksources + f2csources
+
+#new
+include_dirs = [os.path.join(pysplicing_dir, 'include'),
+ os.path.join(pysplicing_dir, 'src', 'lapack'),
+ os.path.join(pysplicing_dir, 'src', 'f2c')]
+#old
+#include_dirs = ['include', 'src/lapack', 'src/f2c']
+
+splicing_extension = Extension('pysplicing.pysplicing', sources,
+ include_dirs=include_dirs,
+ define_macros=defines)
+
+
+long_description = open('README').read()
+
+if sys.version_info > (3, 0):
+ options["use_2to3"] = True
+
+setup(name = 'misopy',
+ version = '0.1',
+ description = 'Mixture of Isoforms model (MISO) for isoform quantitation using RNA-Seq',
+ long_description = long_description,
+# license = 'MIT License',
+ author = 'Yarden Katz,Gabor Csardi',
+ author_email = 'gcsardi@stat.harvard.edu,yarden@mit.edu',
+ url = 'http://genes.mit.edu/burgelab/miso/',
+ ext_modules = [splicing_extension],
+# pymodules = ['misopy', 'pysplicing.pysplicing'],
+ package_dir = {'pysplicing': 'pysplicing/pysplicing'},
+ packages = ['misopy', 'pysplicing'],
+ # Required modules
+ install_requires=[
+# "matplotlib >= 1.1.0",
+ "matplotlib",
+ "numpy >= 1.5.0",
+ "scipy >= 0.9.0",
+ "pysam >= 0.5.0"
+ ],
+ platforms = 'ALL',
+ keywords = ['biology', 'genetics', 'alternative splicing', 'RNA-Seq'],
+ classifiers = [
+ 'Development Status :: 4 - Beta',
+ 'Intended Audience :: Science/Research',
+ 'Programming Language :: C',
+ 'Programming Language :: Python',
+ 'Topic :: Scientific/Engineering :: Bio-Informatics'
+ ]
+ )
+

0 comments on commit 35ce055

Please sign in to comment.