You are here

How to integrate Rosetta code to my program?

4 posts / 0 new
Last post
How to integrate Rosetta code to my program?
#1

Hi.

I am a beginner with Rosetta, and was wondering if I can link its code (like any other library) to my program and use/call especial modules of it in my code. I can't decide it by reading the documentation on the website... Seems Rosetta isn't meant to be used in this way...

I'm specifically after the scoring functions (to calculate energies among atoms of a residue and also pairwise energies between each pair of residues). One option for me is to implement the terms of the energy function, and the other is using an existing library. Which one do you recommend?
My programming lang. is c++.

I appreciate your help in advance.

-LSG

Post Situation: 
Tue, 2011-06-28 07:18
Lsg

You should be able to link against Rosetta as a library. I'm aware that some groups have worked on using Rosetta as a library linked into some other program, but I'm not sure how much success they had. FoldIT and PyRosetta both use the C++ libraries in this fashion, but those are both in-house, and put together with a lot of inside knowledge. I don't know how to go about doing the linking.

Phenix uses Rosetta but I'm pretty sure that's by making system calls to Rosetta executables.

I will point out that if you just want the scorefunctions, you don't have to build the protocols (the largest) library to get it. The scorefunction and all of the classic terms are in the core library.

Tue, 2011-06-28 07:29
smlewis

We have experimented with linking directly to Rosetta in Phenix using Boost.Python - pretty similar to what PyRosetta does, but custom-made. It was relatively easy to link to the libraries; just look for .so files in the build/ subdirectory, and add them to the standard linker call (for our purposes, I added "-lbasic -lnumeric -lutility -lObjexxFCL -lcppdb -lsqlite3 -devel -lcore.1 -lcore.2 -lcore.3 -lcore.4 -lcore.5", which may be overkill but definitely works). If you have linker issues, you can move the .so objects to a more central location, or build them as static libraries (.a files) instead - look at the build documentation for details.

Re-implementing the energy function is a huge undertaking and could easily take years. It is not simply a matter of coding the published equations and reading in the database files; there is a considerable amount of empirical knowledge embedded in the source code which is not documented elsewhere as far as I can tell. It should be relatively straightforward to call Rosetta methods to calculate residue energies, judging by the PyRosetta manual. I'm not sure about pairwise energies, however.

Thu, 2011-06-30 10:25
nechols

nechols: I can help you pare down your linking list if you explain to me which pieces you need. I assume you've got a developer version already since we hadn't yet split core into sub-libraries for 3.2. I don't understand what the -devel flag is doing - -ldevel doesn't make sense (wont' compile without -lprotocols)...

lsg, w/r/t the scorefunction: If you want to score a Pose object, it will be easy to use Rosetta as a library. If you don't have a Rosetta Pose, though, directly using the scorefunction will be challenging; you'll have to call the terms individually and with not-that-friendly syntax. You'd need to implement ScoreFunction::operator() and subfunctions eval_***() to not use Pose as the interface; you may need to reimplement deeper to get away from the Rosetta Residue object as well. A workaround to consider is passing your structures through a PDB-formatted string into Rosetta for scoring (Rosetta can convert the PDB to a Pose object before scoring).

Thu, 2011-06-30 11:27
smlewis