libRosetta Users Guide

Introduction

What is libRosetta?

libRosetta provides a robust, object-oriented framework of components for Rosetta that are intended to replace its inner array and procedural core that was brought over from its Fortran 77 origins and cannot continue to scale as the complexity of Rosetta grows. The goals for this initial libRosetta phase were to provide a solid representation of molecular conformations and the ability to efficiently score those conformations. While some components remain to be completed (DNA and ligand support, specifically) these goals have been achieved. This system is being integrated into Rosetta to work with the kinematics and optimization components and should be active by mid-2007.

libRosetta Components

libRosetta contains components for the entities that Rosetta uses: Atom, Bond, BondAngle, TorsionAngle, Residue, Centroid, Molecule, Polymer, Protein, AminoAcid, DNA, NucleicAcid, and so forth. These component provide the data and services Rosetta uses to carry out its computations. libRosetta versions of Rosetta algorithms are simplified by being written to the abstract class interfaces and letting the objects perform the correct operations for their type. The components also take care of a lot of bookkeeping and validate their internal state to reduce the opportunities for bugs.

In addition to the primary conformational components libRosetta has services that use those components including i/o (PDB reader and writer) and scoring and other services Rosetta needs such as a program options package.

The Classes section provides an overview of the components and their class design.

Least Surprise

libRosetta is designed around the principle of least surprise so that services have obvious, non-cryptic names that are consistent across components. Here are some libRosetta calls that shouldn't be too surprising:

   distance( aa1[ CA ], aa2[ CA ] )
   distance_squared( aa1[ N ], aa2[ N ] )
   polymer.n_residue()
   protein.n_residue()    ==     protein.n_amino_acid()
   dna.n_residue()        ==     dna.n_nucleic_acid()
   protein.psi( i )
   protein[ i ].n_atom()           // Number of atoms in residue i
   AminoAcid & aa( protein[ i ] )  // Shorthand ref for residue i
   aa.n_atom()                     // Same thing
   atom.is_heavy()
   atom.is_donor()
   atom.lj_radius()

Common Tasks

Here's one way to loop over all atoms in a residue that should feel familiar:

   // Loop over atoms by index
   for ( Size i = 1, e = aa.n_atom(); i <= e; ++i ) {
      Atom & atom( aa.atom( i ) );
      // Use Atom atom
   }

You can loop over most collections by iterator or index in libRosetta: each has its benefits.

A sampling of useful code fragments is provided in the Common Tasks section.

Demos

While libRosetta is built to integrate into Rosetta, simple tasks can be performed by stand-alone libRosetta applications, which is useful for testing and writing small demo applications. Here are some small demo applications:

Services

To find out what services an object provides you look at its interface, declared in the header files of the object's class and base classes. To see the services of Protein, look at Protein.hh, Polymer.hh, and Molecule.hh. A sample interface is shown on the Source Code page.

Tour of the Source Code

The libRosetta source is layered for modularity and separates interface from implementation strictly. While this has many benefits it spreads the source out over a directory tree and in many files, which can make it hard to know where to look for things. The Source section gives a tour of the source and the Classes section describes the classes and their hierarchies.

The doxygen-generated documentation or a good editor/IDE with project browsing support are a good way to explore the interfaces and find out what services are available for each component.

Why Doesn't libRosetta Do X?

The agile development process means that services tend to get added to libRosetta as we extend its support. If you don't find the service you need for migrating your research or module to libRosetta please contact the developers so that we can add the needed support. libRosetta is designed for extensibility: just because a service is not yet implemented does not mean we forgot it and we may already be planning to add it.

Support | ©2007 Rosetta Commons