GLYLIB  0.3.0b
get_moiety_selection_assembly.c File Reference
#include "mylib.h"
#include "molecules.h"
Include dependency graph for get_moiety_selection_assembly.c:

Go to the source code of this file.

Functions

assembly get_moiety_selection_assembly (ensemble *E, int nMS, moiety_selection *MS)

Detailed Description

Returns an assembly pointing to the selections indicated by the entries in a set of moiety_selections.

If two different moiety_selections overlap (select some of the same items), the assembly will not contain redundant entries. For example, if residue A is selected twice in one moiety selection or if it is selected in more than one moiety, the assembly returned will contain one pointer to residue A. If choosing by name, and multiple residues are named "A", there will only be one pointer to each residue of that name no matter how many times "A" is specified as a selection.

Note that a negative moiety_selection does not unselect -- it merely specifies a selection by saying "select all except". Use the function (not written yet) called remove_moiety_selection_from_assembly to unselect items.

The assembly will consist only of pointers to any members any classes represented in the moiety selection. For example, if a moiety selection contains residues A, B and C, there will be pointers to A, B and C, but not to any of the atoms contained within those residues. However, if the moiety selections also contain explicit mention of atoms from any of those residues, the assembly will also contain pointers to those atoms explicitly mentioned. It is up to some other function to prune or clean up or expand, etc.

NOTES:

  • This function will set all the moli's for the residues and atoms and the mi member in the molecule structure. It will not check to see if you had something else there first. If you need to keep some information other than the standard indices, find somewhere else to put it.
  • The entries in the assembly will be ordered as the order in the original ensemble. For example, if the moiety_selection chooses residues number 5, 250, 48, 2 and 143, the assembly will contain pointers to residues number 2, 5, 48, 143 and 250, in that order.
  • If residues spanning different molecules are selected, the assembly will not group them by molecule. They will be in one long list of residue pointers. You can use the moli entries to determine membership in a particular molecule, if needed.
  • Of course, name, number or index entries in MS must exactly match names, numbers and/or indices of entries in E. If not, however, the function will not complain. It simply will not add selections to the assembly where it does not find a match.
  • Of course, the moiety_selection should not contain any uninitialized or members.

Definition in file get_moiety_selection_assembly.c.


Function Documentation

< counters

< Flag used for setting negative selections

< Number of molecule pointers needed for assembly

< Number of residue pointers needed for assembly

< Number of atom pointers needed for assembly

< the assembly to return

< the indices for holding selections

Walk through each m, r, a of the ensemble. Look for matches.

If there is a match, change the corresponding index in IA to equal one. Don't check to see whether it is already one -- that doesn't matter.

For each positive moiety_selection passed to the function

For each negative moiety_selection passed to the function

Definition at line 51 of file get_moiety_selection_assembly.c.

References residue::a, assembly::a, residue_tree_index::ai, moiety_selection::ai, ensemble_tree_index::m, assembly::m, ensemble::m, ensemble_tree_index::mi, moiety_selection::mi, mywhine(), residue_tree_index::na, residue::na, assembly::na, moiety_selection::nai, moiety_selection::naN, moiety_selection::nan, ensemble_tree_index::nm, assembly::nm, ensemble::nm, moiety_selection::nmi, moiety_selection::nmN, moiety_selection::nmn, molecule_tree_index::nr, molecule::nr, assembly::nr, moiety_selection::nri, moiety_selection::nrn, moiety_selection::nrN, molecule_tree_index::r, molecule::r, assembly::r, molecule_tree_index::ri, and moiety_selection::ri.

Here is the call graph for this function:

 All Classes Files Functions Variables Typedefs Defines