imp icon indicating copy to clipboard operation
imp copied to clipboard

Documentation about PairScores vs Restraints etc

Open cgreenberg opened this issue 10 years ago • 5 comments

There doesn't appear to be any documentation explaining what a PairScore (or TripletScore etc), why you would use it, and under what situations, which solution could be faster.

cgreenberg avatar Jun 06 '14 08:06 cgreenberg

I guess a part of the issue is that these are auto-generated classes (from tools/build/make_container.py and tools/build/container_templates/*) so their specific per class documentation is problematic. I can try to add something and let's iterate over this together...

About when to use which - since these are abstract classes, it seems less a matter of efficiency and more whether you are evaluating over singletons, pairs of particles, triplets etc. - efficiency information should probably appear in child non-abstract classes (e.g. score_functor::DistancePairScore, which is documented a bit better)

Barak

On Fri, Jun 6, 2014 at 1:31 AM, Charles Greenberg [email protected] wrote:

There doesn't appear to be any documentation explaining what a PairScore (or TripletScore etc), why you would use it, and under what situations, which solution could be faster.

— Reply to this email directly or view it on GitHub https://github.com/salilab/imp/issues/800.

Barak

barakr avatar Jun 06 '14 17:06 barakr

Added some documentation in commit a5aac82bf5 https://github.com/salilab/imp/commit/a5aac82bf524ebd46f3d067542bb901b1adbee07 . Charles, could you review / edit and close issue?

On Fri, Jun 6, 2014 at 10:14 AM, Barak Raveh [email protected] wrote:

I guess a part of the issue is that these are auto-generated classes (from tools/build/make_container.py and tools/build/container_templates/*) so their specific per class documentation is problematic. I can try to add something and let's iterate over this together...

About when to use which - since these are abstract classes, it seems less a matter of efficiency and more whether you are evaluating over singletons, pairs of particles, triplets etc. - efficiency information should probably appear in child non-abstract classes (e.g. score_functor::DistancePairScore, which is documented a bit better)

Barak

On Fri, Jun 6, 2014 at 1:31 AM, Charles Greenberg < [email protected]> wrote:

There doesn't appear to be any documentation explaining what a PairScore (or TripletScore etc), why you would use it, and under what situations, which solution could be faster.

— Reply to this email directly or view it on GitHub https://github.com/salilab/imp/issues/800.

Barak

Barak

barakr avatar Jun 06 '14 17:06 barakr

That's helpful, but I guess I'm thinking something that should belong in a developer guide or maybe just the wiki. Advice on the various options for creating restraints and pairscores, and how you can take advantage of optimizations. E.g., isn't it faster to use a bunch of PairScores with a PairRestraint rather than creating many individual restraints? That's what Daniel used to say. Also, do these optimizations apply to TripletScores etc....

cgreenberg avatar Jun 06 '14 18:06 cgreenberg

You have write access to both the wiki and the docs. So feel free to benchmark and then write said docs. ;)

In general things will be more computationally efficient the fewer objects you have... but it's more efficient for the developer to be able to mix and match things in a Python script rather than to have to write special-case restraints all the time. So like all things, it depends.

Anything that applies to Pair* also applies to Triplet* and Quad*.

benmwebb avatar Jun 06 '14 18:06 benmwebb

Yeah for sure that'd be helpful (PredicatePairRestraint is useful for that btw cause it allows scoring by type, and yes, there are equivalent versions for triplets etc). But I admit to still by fully understand the entirety of the tradeoffs here. Another major component for efficiency are the containers and the filters (eg ClosePairContainer, ExclusiveConsecutivePairFilter and it's corresponding Container, etc)

On Jun 6, 2014, at 11:07 AM, Charles Greenberg [email protected] wrote:

That's helpful, but I guess I'm thinking something that should belong in a developer guide or maybe just the wiki. Advice on the various options for creating restraints and pairscores, and how you can take advantage of optimizations. E.g., isn't it faster to use a bunch of PairScores with a PairRestraint rather than creating many individual restraints? That's what Daniel used to say. Also, do these optimizations apply to TripletScores etc....

— Reply to this email directly or view it on GitHub.

barakr avatar Jun 06 '14 18:06 barakr

Current API docs appear adequate. May make sense to address this a little in a tutorial though.

benmwebb avatar Dec 05 '22 22:12 benmwebb