[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Helper functions



Daniel Russel wrote:
- Is Residue just an example of a member of a hierarchy, or would chains and proteins be treated differently?
A tree node is a tree node. It can happen to also have some biological function, but that is orthogonal to being a hierarchy node.

I think you misunderstood my question. The wiki page has a description of what attributes a Residue has, but nothing about chains or proteins, so I was just trying to ascertain whether you just put in Residue as an example (and just haven't done chains/proteins yet) or whether you think they should be treated specially. I think your answer means the former, yes?

- How would you deal with references to particle IDs to turned-off particles? "PI" is just an Int variable, right?
Check if the particle is turned on or off? Seems the same as with any other system.

Well, sure, but let's say I have a rigid body containing 500 atoms. It has 7 attributes - the xyz of its center of mass, and an orientation quaternion. These would both have to be updated if particles were added to or removed from the rigid body. By making these 'dumb' attributes, the only way to do that is to do the update every time you want to use the rigid body, which seems inefficient to me. In contrast, a ParticleContainer object could have a method to add/remove particles, so that it could do the update when necessary.

- If I wanted to pull out every atom in residue 1, I'd really have to scan through every single particle to figure out which ones a) have a residue attribute and b) have it = 1 ? That seems inefficient.
You would find the particle for residue 1 and get "child_0", "child_1"...
I don't think you should ever have to scan through all particles (and, personally, I don't think you should be able to as it would encourage bad habits).

Ah, I see - it wasn't clear to me from the wiki page. Then my concerns here are 1) you have the information in two locations, so you will need to do consistency checks to make sure that the child/parent pointers all point to the right thing; 2) that seems grossly inefficient - imagine a container with 10000 atoms, doing the string concatenation and formatting to get child_0 through child_9999, then the hashtable lookup, as opposed to just iterating through a std::vector<int>.

	Ben
--
                      http://salilab.org/~ben/
"It is a capital mistake to theorize before one has data."
	- Sir Arthur Conan Doyle