deformation_for_each_mode

Issue #515 resolved
Former user created an issue

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)

  1. Xinqiu Yao

    To my understanding of the function: No, it won't work. The output defe7$ei should be a one-column "matrix", and command like defe7$ei[, 1:3] will give a 'subscript out of bounds' error. You could call defsums <- sum(defe7$ei) or simply use defe7$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

  2. Lars Skjærven

    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.

  3. karolk

    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?

  4. Lars Skjærven

    help(deformation.nma) says: By default the first 20 non-trivial modes are included in the calculation.

  5. karolk

    Yes. I saw the help. The question is: whether "defe$ei[, 1]" refers to the first non-trivial mode, that is mode 7?

  6. Lars Skjærven

    That depends on your input. defe$ei[, 1] contains the deformation energies calculated from the first mode specified in your mode.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.

  7. Log in to comment