Coder Social home page Coder Social logo

biocommons / uta-align Goto Github PK

View Code? Open in Web Editor NEW
5.0 4.0 6.0 358 KB

C-based Needleman-Wunsch and Smith-Waterman alignment algorithms with a Python interface.

License: Apache License 2.0

Makefile 4.61% Python 12.38% Perl 1.06% Cython 81.51% Shell 0.43%
bioinformatics sequence-alignment sequences

uta-align's Introduction

This project exists only to ensure that the top-level biocommons namespace is correctly declared as a namespace package.

This trivial package was pushed to pypi in order to reserve the biocommons namespace (contributions are welcome!).

Steps:

pyvenv venv
source venv/bin/activate
pip install wheel
python setup.py register
python setup.py sdist bdist bdist_egg bdist_wheel upload

uta-align's People

Contributors

andreasprlic avatar bioinformed avatar ecalifornica avatar reece avatar zzwiesler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

uta-align's Issues

uta-align is no longer pip installable

Describe the bug

pip install uta-align results in errors related to cpdef and cdef.

To Reproduce

Steps to reproduce the behavior:

snafu$ cd /tmp
snafu$ python3.11 -m venv venv
snafu$ source venv/bin/activate
(venv) snafu$ pip install uta-align
Looking in indexes: https://pypi.shr.myome.info/simple
Collecting uta-align
  Downloading uta-align-0.2.0.tar.gz (268 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 268.1/268.1 kB 5.0 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [54 lines of output]
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      INSERTION.inverse     = DELETION
      DELETION.inverse      = INSERTION
      SEQ_MATCH.inverse     = SEQ_MATCH
      SEQ_MISMATCH.inverse  = SEQ_MISMATCH
      
      cpdef tuple BAM_OPS = (MATCH, INSERTION, DELETION, SKIPPED, SOFT_CLIP, HARD_CLIP, PADDING, SEQ_MATCH, SEQ_MISMATCH)
            ^
      ------------------------------------------------------------
      
      uta_align/align/cigar_utils.pyx:62:6: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      # Create mapping from ord(char_op) to op
      _temp_map = [None]*256
      for _op in BAM_OPS:
          _temp_map[_op.code] = _op
      
      cpdef tuple BAM_OP_CHAR_MAP = tuple(_temp_map)
            ^
      ------------------------------------------------------------
      
      uta_align/align/cigar_utils.pyx:69:6: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
      Compiling uta_align/align/algorithms.pyx because it changed.
      Compiling uta_align/align/cigar_utils.pyx because it changed.
      [1/2] Cythonizing uta_align/align/algorithms.pyx
      [2/2] Cythonizing uta_align/align/cigar_utils.pyx
      Traceback (most recent call last):
        File "/tmp/venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/tmp/venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-n92a3hee/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-n92a3hee/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-n92a3hee/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 52, in <module>
        File "/tmp/pip-build-env-n92a3hee/overlay/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1154, in cythonize
          cythonize_one(*args)
        File "/tmp/pip-build-env-n92a3hee/overlay/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: uta_align/align/cigar_utils.pyx
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

Expected behavior

Successful pip installation

Update uta-align for Python 3.6+

uta-align doesn't work on 3.7 (at least), and may not work on 3.6. This prevents us from making a new release. (#6)

The goal of this issue is just to get it working again on 3.6 and 3.7. Subsequent issues will deal with testing (#8) and packaging (#9).

Update tests to use pytest

Tests are currently written with nose. Investigate rewriting tests with pytest for consistency with other biocommons packages.

Assuming no technical difficulties, do it.
If difficult, report here and we'll skip.

Get a release

Hi Reece,

could we get a release of this? I'd like to update the UTA dependencies for this...

Thanks!

PyString_FromStringAndSize conversion for python3

Because of the way python3 disambiguates strings and bytes, the PyString_FromStringAndSize import no longer works when this repository is called in a python3 environment.

I believe that, depending on the context, PyUnicode_FromStringAndSize or PyBytes_FromStringAndSize must be used instead.

Implement travis-based testing

Currently, testing is invoked manually before uploading manually (hopefully!).
After testing is updated in #8 , implement travis-ci.

verify installation and test execution in uta-align

Originally reported by Reece Hart (Bitbucket: reece, GitHub: reece) in biocommons/uta-align #2
Migrated by bitbucket-issue-migration on 2016-07-12 17:12:43


This is based on some recent troubles with Ubuntu 14.10.

Specific issues seen:

  • pip install uta-align fails because the tarball doesn't include cy_distribute (apparently). pip install hg+http://.. works fine.
  • Once installed, I was unable to import the package to use it. (More correctly: import succeeded, but none of the methods appeared to exist.) This is probably user error, but should be verified.
  • During the above, I got this:
In [1]: from   uta_align.align.algorithms  import align, needleman_wunsch_altshul_erikson
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-1-8c95048bc088> in <module>()
----> 1 from   uta_align.align.algorithms  import align, needleman_wunsch_altshul_erikson

/home/reece/projects/biocommons/uta-align/csamfile.pxd in init uta_align.align.algorithms (uta_align/align/algorithms.c:13854)()

AttributeError: 'module' object has no attribute 'PileupProxy'

In [2]: from   uta_align.align.algorithms  import align, needleman_wunsch_altshul_erikson
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-2-8c95048bc088> in <module>()
----> 1 from   uta_align.align.algorithms  import align, needleman_wunsch_altshul_erikson

ImportError: cannot import name align
  • And, documentation is sorely needed. Creating issue #3.

Problem installing uta-align on OS X

Originally reported by pkaleta (Bitbucket: pkaleta, GitHub: pkaleta) in biocommons/uta-align #1
Migrated by bitbucket-issue-migration on 2016-07-12 17:12:43


I'm encountering this problem when trying to install uta-align on Mac OS X:

clang -Wl,-x -undefined dynamic_lookup -L/usr/local/lib -L/usr/local/opt/sqlite/lib build/temp.macosx-10.9-x86_64-2.7/uta_align/align/cigar_utils.o /Users/piotr/.virtualenvs/uta/lib/python2.7/site-packages/pysam/libchtslib.so /Users/piotr/.virtualenvs/uta/lib/python2.7/site-packages/pysam/csamfile.so -o build/lib.macosx-10.9-x86_64-2.7/uta_align/align/cigar_utils.so -dynamiclib -undefined dynamic_lookup -shared -Wl,-headerpad_max_install_names -Wl,-install_name,/Users/piotr/.virtualenvs/uta/lib/python2.7/site-packages/uta_align-0.1.0-py2.7-macosx-10.9-x86_64.egg/uta_align/align/cigar_utils.so

ld: can't link with bundle (MH_BUNDLE) only dylibs (MH_DYLIB) file '/Users/piotr/.virtualenvs/uta/lib/python2.7/site-packages/pysam/libchtslib.so' for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

error: command 'clang' failed with exit status 1

Full pip output attached.

The problem is that on darwin, .so files (bundles) cannot be statically linked during compilation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.