Question

I am working on a bioinformatics project and trying to run a module named pycogent in python 2.7. My objective is to create an ancestral sequence from a file composed of aligned 16s Fastq sequences.

My python code is as follows:

from cogent import LoadSeqs
aln = LoadSeqs('FullStrep.fasta')
lf.setAlignment(aln)
lf.optimise(show_progress=False, local=True)
ancestors = lf.likelyAncestralSeqs()
print ancestors

However, I am getting the following error messages.

Traceback (most recent call last):
  File "/Users/paulfryling/Desktop/Mypythonproj/pycogentancestor", line 1, in <module>
    from cogent import LoadSeqs
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/cogent/__init__.py", line 5, in <module>
    import numpy
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/__init__.py", line 137, in <module>
    import add_newdocs
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/add_newdocs.py", line 9, in <module>
    from numpy.lib import add_newdoc
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/lib/__init__.py", line 4, in <module>
    from type_check import *
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/lib/type_check.py", line 8, in <module>
    import numpy.core.numeric as _nx
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/__init__.py", line 5, in <module>
    import multiarray
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so, 2): no suitable image found.  Did find:
    /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so: no matching architecture in universal wrapper
>>> 

Any help or direction would be GREATLY appreciated.

Best Regards,

Paul

Was it helpful?

Solution

The problem you have is that you don't some of PyCogent's dependencies, and it has quite a few of them, but if you have the following three, you will be able to use pretty much everything.

The first thing you need to do to install is Python**, since you are in Mac OS X select the current OS version you are using:

Next thing you will need is NumPy, which you can download similarly from here:

Next you will need to install Matplotlib:

Once you have all these, you will need to install the PyCogent libraries, to do so:

  1. Download and unzip this file into your computer.

  2. From the terminal go to the folder where this file was downloaded, and inside PyCogent folder, run the following commands:


python setup.py build
sudo python setup.py install

And that should be all.

If you needed to, you can install the optional installs.

** Although there is one Python installed in your computer probably, it is better to make sure you have the Python from Python.org since it will also be compatible with Matplotlib, another of the dependencies of PyCogent.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top