deformation_for_each_mode
Hi,
I want to perform deformation analysis for each mode separately. I am not sure if I do it correctly. I would be grateful for a simple yes or no :)
So, for mode 7, I should specify: defe7 <- deformation.nma(modes, mode.inds = 7) defsums <- rowSums(defe7$ei[,1:3])
Correct?
One things is not clear to me, what denote these digits in the branches[1:3]?
thanks
Comments (9)
-
-
The result of deformation analysis is already on each mode separately. Documentation specifies:
- ei : numeric matrix containing the energy contribution (E) from each atom (i; row-wise) at each mode index (column-wise).*
in other words, an NxM matrix where N is the number of atoms, and M the number of modes chosen. Access the deformation energies for mode 1 as
defe$ei[, 1]
Hope it helps.
-
Thanks for both of you. Works beautifully.
Please close the ticket.
-
- changed status to resolved
-
Hi,
I need to reopen this ticket, in order to clarify one thing.
Going back to our previous discussion, Lars mentioned that in order to access the deformation energies for mode 1, I should put "defe$ei[, 1]". And here is my question: does the mode index 1 refers to the first non-trivial mode, that is mode 7, or to the first trivial mode? I found in help that by default deformation is performed for the first 20 non-trivial ones, so I assume that "defe$ei[, 1]" refers to the first non-trivial mode, that is mode 7? Right?
-
help(deformation.nma)
says: By default the first 20 non-trivial modes are included in the calculation. -
Yes. I saw the help. The question is: whether "defe$ei[, 1]" refers to the first non-trivial mode, that is mode 7?
-
That depends on your input.
defe$ei[, 1]
contains the deformation energies calculated from the first mode specified in yourmode.inds
argument. So the answer is yes, if you use the default values for mode.inds, or the first element of mode.inds equals to 7. -
Ok. Great. Thats what I wanted to know.
You can close this ticket.
- Log in to comment
To my understanding of the function: No, it won't work. The output
defe7$ei
should be a one-column "matrix", and command likedefe7$ei[, 1:3]
will give a 'subscript out of bounds' error. You could calldefsums <- sum(defe7$ei)
or simply usedefe7$sums
.The bracket means access to the elements of a vector or matrix. For example,
ei[, 1:3]
(DON"T FORGET THE COMMA!) means: pick up all the values from the first to the third column in the matrix 'ei'.R beginners are strongly recommended go through some tutorials first, such as listed here: http://thegrantlab.org/bio3d/user-guide