clauswilke / PeptideBuilder

A simple Python library to generate model peptides
MIT License
79 stars 30 forks source link

Purpose of generateRandomRotamers #29

Closed Seanny123 closed 4 years ago

Seanny123 commented 4 years ago

Not all sub-classes of Geo seem to implement it. Is there a reason for that? What is it's function/purpose?

clauswilke commented 4 years ago

This was needed in the research study for which we wrote this code: https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0080635

Different amino acids have different numbers of rotamers, and for amino acids that have a large number you may want to randomly sample in some cases:

Screen Shot 2020-03-28 at 12 46 47 PM

An argument could be made that all amino acids with rotamers should have random sampling available, but it's low on my priority list at this time. Nobody has asked for this feature, and it's unclear that anybody needs it.

clauswilke commented 4 years ago

Ah, I now see in your diff that some instances of generateRandomRotamers() have been commented out. I don't recall the reasoning, but would prefer to leave the commented out code as is (not remove it, not uncomment).

Maybe @mtien remembers?

mtien commented 4 years ago

Claus is right. The generateRandomRotamers() was used for a very specific purpose in the PLoS paper. I left it in there so that if anyone wanted to recapitulate the results they would be able to. Please feel free to delete it, but I think it's nice to keep it in as a documentation of a method. I strongly agree with Claus and I doubt most people will want to use this function.

clauswilke commented 4 years ago

Matthew, but do you know why some functions are commented out and others are not?

E.g.: This one, for Isoleucine, is commented out: https://github.com/clauswilke/PeptideBuilder/blob/ca65d058f0ab7ef24ae9efd1eaa0ebd22a153a85/PeptideBuilder/Geometry.py#L253-L258

This one, for Arginine, is not: https://github.com/clauswilke/PeptideBuilder/blob/ca65d058f0ab7ef24ae9efd1eaa0ebd22a153a85/PeptideBuilder/Geometry.py#L424-L429

I don't want to remove any functions that have been part of the published API for years. But the question is whether we should add the commented-out functions back in.

mtien commented 4 years ago

Ah. Do not put that function back in, you may delete it, but I did use the function in the original PLoS paper. Isoleucine's beta-carbon is a chiral center (http://www.biology.arizona.edu/biochemistry/problem_sets/aa/Isoleusine.html), so the random generation of dihedral angles to its rotamers should not be done.

mtien commented 4 years ago

Not sure why Leucine is commented out though, it's side chains geometry is not as restrictive as Isoleucine. I would say to for sure delete Isoleucine's generateRandomRotamers() and uncomment the function in Leucine, if you like.

clauswilke commented 4 years ago

Ah, so that's presumably also the case for Leucine, the other amino acid where it's been commented out? If so, I think the right way forward is to leave the commented-out code and add a comment to this effect, so people won't wonder in the future whether such a function should exist.