Tutorial:Selecting subsets of atoms
NOTE: TUTORIAL WRITING IN PROGRESS DO NOT FOLLOW THIS
This is an example on how to select atoms and residues with MSL, following the example program example_selecting_atoms_and_residues.cpp in the examples/ subdirectory.
Complete source of example_selecting_atoms_and_residues
Background
MSL objects can be selected if they inherit the "Selectable" object.
Selection By Name:
Can select based on selection flags that are inside each Atom. By default every atom has an "all" selection flag set.
You can create selection flags for atoms by: 1. Using Atom object: a.setSelectionFlag("foobar") 2. Using AtomSelection object: as.select("foobar, chain A")
Selection By Property:
Chain A: as.select("chain A")
To compile
% make bin/example_selecting_atoms_and_residues
To run the program
Go to the main directory and run the command (note, the location of the exampleFiles subdirectory needs to be provided as an argument)
% bin/example_selecting_atoms_and_residues exampleFiles
Program description
- Read a PDB file.
60 System container;
61 if (!container.readPdb(file)) {
// reading failed, error handling code here
68 }