Welcome, Guest. Please Login
YaBB - Yet another Bulletin Board
 
  HomeHelpSearchLogin  
 
[ANNOUNCEMENT] HyPhy as a library (Read 3871 times)
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
[ANNOUNCEMENT] HyPhy as a library
Apr 28th, 2008 at 8:34pm
 
Dear HyPhy users,

There has been some interest in having HyPhy available as a 'headless' library that could be plugged into scripting languages and other code. I have created a source distribution that (thanks to the excellent SWIG package) can be compiled as a shared library and used as modules for other languages (the included link has bindings for R and Python). Other languages such as Perl and Java can be easily added. The distro can be had from Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login


This is a preliminary version and has only been tested on Mac OS X. Please let me know if you get it to work on other platforms. Windows will be difficult and because it is not may not be easy as it should be to compile DLLs with open source tools), Linux should work out of the box. Take a look at the README and included basic examples.

I welcome all and any comments and feedback.

Cheers,
Sergei
Back to top
 

Associate Professor
Division of Infectious Diseases
Division of Biomedical Informatics
School of Medicine
University of California San Diego
WWW WWW  
IP Logged
 
jamescotton
YaBB Newbies
*
Offline



Posts: 28
London
Gender: male
Re: [ANNOUNCEMENT] HyPhy as a library
Reply #1 - Jun 4th, 2009 at 3:35am
 
Hi Sergei - i've had a quick look go at building this library on a Ubuntu machine.

An easy problem to fix was that line 16 of setup.py has '_Hyphy' when it should be '_HyPhy' for case-sensitive file systems. I also needed to install a new version of libcurl.. the library then seems to build okay, but when I try running the example, I get an error:

Quote:
james@james-desktop:~/Desktop/HyPhyLibrary/Examples/Python$ python BasicHyPhy.py
Traceback (most recent call last):
 File "BasicHyPhy.py", line 4, in <module>
   import os, HyPhy
 File "/usr/lib/python2.5/site-packages/HyPhy/__init__.py", line 51, in <module>
   THYPHY_TYPE_COUNT = _HyPhy.THYPHY_TYPE_COUNT
AttributeError: 'module' object has no attribute 'THYPHY_TYPE_COUNT'


When I try and build the R library on the same machine, the build fails with an error message:

Quote:
LibraryModules/Source/THyPhy_R.o: file not recognized: File format not recognized
collect2: ld returned 1 exit status
make: *** [LibraryModules/R/HyPhy.so] Error 1
R library written to /home/james/Desktop/HyPhyLibrary/LibraryModules/R/HyPhy.so
Finished


I don't know anything about SWIG, and don't really use python much, so I'm not well qualified to try and fix these,. it could be something really obvious, but I hope these reports help. It would be really exciting to have hyphy available in R - in particular it might make it really easy to do Bayesian inference under some of the rich models that hyphy makes possible.

Thanks for this! - I'm surprised it hasn't attracted much attention - although I only just noticed the post.

Yours,
James
Back to top
 

James Cotton&&School of Biological and Chemical Sciences&&Queen Mary, University of London&&+44 (0)207 882 3645&&j.a.cotton@qmul.ac.uk&&Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login
WWW WWW  
IP Logged
 
jamescotton
YaBB Newbies
*
Offline



Posts: 28
London
Gender: male
Re: [ANNOUNCEMENT] HyPhy as a library
Reply #2 - Jun 4th, 2009 at 3:45am
 
After posting the above message, I found the problem with building the R library - the tgz file you post ships with a pre-compiled

Quote:
-rw-r--r-- james/james  142096 2008-04-27 23:54 HyPhyLibrary/LibraryModules/Source/THyPhy_R.o


which the shell script tries to link into the executable. I'm guessing this is a mac os x object file, which explains the problem. If you kill this file, before building, then everything builds fine, and the example R script runs happily.

Exciting! - it'll take me a while to work out what I can do beyond just executing batch files, but thanks for this.

James
Back to top
 

James Cotton&&School of Biological and Chemical Sciences&&Queen Mary, University of London&&+44 (0)207 882 3645&&j.a.cotton@qmul.ac.uk&&Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login
WWW WWW  
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: [ANNOUNCEMENT] HyPhy as a library
Reply #3 - Jun 5th, 2009 at 5:20pm
 
Dear James,

Let me know if you run into any further issues.

Cheers,
Sergei
Back to top
 

Associate Professor
Division of Infectious Diseases
Division of Biomedical Informatics
School of Medicine
University of California San Diego
WWW WWW  
IP Logged