OpenStructure
Public Member Functions
EditorBase Class Reference

#include <editor_base.hh>

Inherited by ICSEditor, and XCSEditor.

Public Member Functions

ChainHandle InsertChain (const String &chain_name)
 
ChainHandle InsertChain (const String &chain_name, ChainHandle chain, bool deep=false)
 
Inserting, removing and modifying order of residues

Append residue to the end of the chain

Append residue with residue key

ResidueHandle AppendResidue (ChainHandle chain, const ResidueKey &k)
 
ResidueHandle AppendResidue (ChainHandle chain, const ResidueKey &k, const ResNum &num)
 
ResidueHandle AppendResidue (ChainHandle chain, ResidueHandle residue, bool deep=false)
 
ResidueHandle InsertResidueBefore (ChainHandle chain, int index, const ResNum &num, const ResidueKey &k)
 
ResidueHandle InsertResidueAfter (ChainHandle chain, int index, const ResNum &num, const ResidueKey &k)
 

Adding/removing atoms

EntityHandle ent_
 
EditMode mode_
 
AtomHandle InsertAtom (ResidueHandle residue, const String &name, const geom::Vec3 &pos, const String &ele="", Real occupancy=1.0, Real b_factor=0.0, bool is_hetatm=false)
 
AtomHandle InsertAtom (ResidueHandle residue, AtomHandle atom)
 
AtomHandle InsertAltAtom (ResidueHandle residue, const String &name, const String &alt_group, const geom::Vec3 &pos, const String &ele="", Real occ=1.0, Real b_factor=0.0)
 
AtomHandle InsertAltAtom (ResidueHandle residue, AtomHandle atom, const String &alt_group)
 
void AddAltAtomPos (const String &group, const AtomHandle &atom, const geom::Vec3 &position, Real occ=1.0, Real b_factor=0.0)
 
BondHandle Connect (const AtomHandle &first, const AtomHandle &second)
 
BondHandle Connect (const AtomHandle &first, const AtomHandle &second, unsigned char bond_order)
 
BondHandle Connect (const AtomHandle &first, const AtomHandle &second, Real len, Real theta, Real phi)
 
BondHandle Connect (const AtomHandle &first, const AtomHandle &second, Real len, Real theta, Real phi, unsigned char bond_order)
 
void RenameResidue (ResidueHandle res, const String &new_name)
 
void SetResidueNumber (ResidueHandle res, const ResNum &num)
 
void RenameChain (ChainHandle chain, const String &new_name)
 
void SetChainType (ChainHandle chain, const ChainType type)
 
void SetChainDescription (ChainHandle chain, const String desc)
 
void DeleteAllAtoms (ResidueHandle res)
 
void DeleteAtom (const AtomHandle &atom)
 
void DeleteAtoms (const AtomHandleList &atoms)
 
void DeleteBond (const BondHandle &bond)
 
void DeleteBonds (const BondHandleList &bonds)
 
TorsionHandle AddTorsion (const String &name, const AtomHandle &a1, const AtomHandle &a2, const AtomHandle &a3, const AtomHandle &a4)
 
void DeleteChain (const ChainHandle &chain)
 
void DeleteResidue (const ResidueHandle &residue_handle)
 
void ReorderResidues (const ChainHandle &chain)
 
void ReorderAllResidues ()
 
void RenumberAllResidues (int start, bool keep_spacing)
 
void RenumberChain (ChainHandle chain, const ResNumList &new_numbers)
 
void RenumberChain (const ChainHandle &chain, int start, bool keep_spacing)
 
EditMode GetMode () const
 
EntityHandle GetEntity () const
 
void RenameAtom (AtomHandle atom, const String &new_name)
 
void Prune ()
 
 EditorBase (const EntityHandle &ent, EditMode mode)
 
void UpdateTrace ()
 

Detailed Description

base class for entity editors

Entities, chains, residues and atoms are assembled and modified via editors. Editors are usually used as one of the concrete subclasses of EditorBase: XCSEditor and ICSEditor. The former operates on the external carthesian coordinate system while the latter operates on the internal coordinate system. To create a new editor, use EntityHandle::EditXCS() and EntityHandle::EditICS(), respectively.

For an introduction to the concept of editors go here

Definition at line 46 of file editor_base.hh.

Constructor & Destructor Documentation

◆ EditorBase()

EditorBase ( const EntityHandle ent,
EditMode  mode 
)
protected

Member Function Documentation

◆ AddAltAtomPos()

void AddAltAtomPos ( const String group,
const AtomHandle atom,
const geom::Vec3 position,
Real  occ = 1.0,
Real  b_factor = 0.0 
)

Add alternative atom position.

Parameters
groupis the name of the alternative atom position group. If no group of that name exists, it will be created.
atomis the atom handle the additional location belongs to. It is required that the atom has been inserted via InsertAltAtom, If the atom is a conventional atom without alternative location, a Error will be thrown.
positionis the alternative position
occ
b_factor
See also
EditorBase::InsertAltAtom(), ResidueHandle

◆ AddTorsion()

TorsionHandle AddTorsion ( const String name,
const AtomHandle a1,
const AtomHandle a2,
const AtomHandle a3,
const AtomHandle a4 
)

Add named torsion to entity.

◆ AppendResidue() [1/3]

ResidueHandle AppendResidue ( ChainHandle  chain,
const ResidueKey k 
)

◆ AppendResidue() [2/3]

ResidueHandle AppendResidue ( ChainHandle  chain,
const ResidueKey k,
const ResNum num 
)

◆ AppendResidue() [3/3]

ResidueHandle AppendResidue ( ChainHandle  chain,
ResidueHandle  residue,
bool  deep = false 
)

◆ Connect() [1/4]

BondHandle Connect ( const AtomHandle first,
const AtomHandle second 
)

connect two atoms with bond

If there is already a bond between the two atoms, no new bond is created. Instead, the already existing bond is returned.

◆ Connect() [2/4]

BondHandle Connect ( const AtomHandle first,
const AtomHandle second,
Real  len,
Real  theta,
Real  phi 
)

◆ Connect() [3/4]

BondHandle Connect ( const AtomHandle first,
const AtomHandle second,
Real  len,
Real  theta,
Real  phi,
unsigned char  bond_order 
)

◆ Connect() [4/4]

BondHandle Connect ( const AtomHandle first,
const AtomHandle second,
unsigned char  bond_order 
)

◆ DeleteAllAtoms()

void DeleteAllAtoms ( ResidueHandle  res)

Delete all atoms of residue.

All associated torsions and bonds will also be removed

◆ DeleteAtom()

void DeleteAtom ( const AtomHandle atom)

Delete specific atom from this residue.

All associated torsions and bonds will also be removed as well.

Parameters
atomis the atom to remove. If no such atom exists, this method will have no effect

◆ DeleteAtoms()

void DeleteAtoms ( const AtomHandleList atoms)

\ brief Delete a set of atoms

All associated torsions and bonds will be removed as well

◆ DeleteBond()

void DeleteBond ( const BondHandle bond)

\ brief Delete bond

Parameters
bondIs the bond to remove. If no such bond exists, this method will have no effect

◆ DeleteBonds()

void DeleteBonds ( const BondHandleList bonds)

\ brief Delete a set of bond

Parameters
bondsbonds to remove. If no such bonds exist, this method will have no effect

◆ DeleteChain()

void DeleteChain ( const ChainHandle chain)

delete chain

all associated atoms, residues, torsions and bonds will also be deleted.

◆ DeleteResidue()

void DeleteResidue ( const ResidueHandle residue_handle)

Delete residue.

Atoms, bonds and torsions involving this residue are removed as well

See also
ChainHandle::DeleteResidue, DeleteAtom

◆ GetEntity()

EntityHandle GetEntity ( ) const
inline

\ brief return entity this editor works on

Definition at line 327 of file editor_base.hh.

◆ GetMode()

EditMode GetMode ( ) const
inline

Get edit mode of editor.

Definition at line 324 of file editor_base.hh.

◆ InsertAltAtom() [1/2]

AtomHandle InsertAltAtom ( ResidueHandle  residue,
AtomHandle  atom,
const String alt_group 
)

Insert new atom with alternative position indicator.

All informations will be copied over from atom, except bonds

◆ InsertAltAtom() [2/2]

AtomHandle InsertAltAtom ( ResidueHandle  residue,
const String name,
const String alt_group,
const geom::Vec3 pos,
const String ele = "",
Real  occ = 1.0,
Real  b_factor = 0.0 
)

Insert new atom with alternative position indicator.

See also
EditorBase::AddAltAtomPos(), ResidueHandle

◆ InsertAtom() [1/2]

AtomHandle InsertAtom ( ResidueHandle  residue,
AtomHandle  atom 
)

Insert new atom.

Inserts new atom with all properties from the provided atom handle.

Parameters
residueis the parent residue
atomfrom which all informations will be copied over to the newly created atom
Returns
the newly created AtomHandle

◆ InsertAtom() [2/2]

AtomHandle InsertAtom ( ResidueHandle  residue,
const String name,
const geom::Vec3 pos,
const String ele = "",
Real  occupancy = 1.0,
Real  b_factor = 0.0,
bool  is_hetatm = false 
)

Insert new atom.

Insert new atom and add it to residue. For atoms with alternative atom locations use ResidueHandle::InsertAltAtom().

Parameters
residueis the parent residue
nameis the atom name. While free to choose a name, it is adviced to properly name the residues according to IUPAC rules as several algorithms as well as most builders in the conop module rely on proper naming.
posis the position of the atom in global coordinates
ele
occupancy
b_factor
is_hetatm

◆ InsertChain() [1/2]

ChainHandle InsertChain ( const String chain_name)

create new chain

create new chain and attach it to entity.

Parameters
chain_nameThe chain name. Can be an arbitrary String. However, if you intend to use the PDB export funtionality, the chain_name should be a single letter, preferably in the range A-Z.
Returns
The newly created chain handle

◆ InsertChain() [2/2]

ChainHandle InsertChain ( const String chain_name,
ChainHandle  chain,
bool  deep = false 
)

create new chain

create new chain with properties of a provided chain handle and attach it to entity.

Parameters
chain_nameThe chain name. Can be an arbitrary String. However, if you intend to use the PDB export funtionality, the chain_name should be a single letter, preferably in the range A-Z.
chainThe newly created chain will take over all generic attached to this handle.
deepIf set to true, all residues and atoms of chain will be completely copied into the created chain. No bonds and angles are added.
Returns
The newly created chain handle

◆ InsertResidueAfter()

ResidueHandle InsertResidueAfter ( ChainHandle  chain,
int  index,
const ResNum num,
const ResidueKey k 
)

insert residue into chain

This method is identical to InsertResidueBefore() but inserts the residue after the specified position

See also
InsertResidueBefore

◆ InsertResidueBefore()

ResidueHandle InsertResidueBefore ( ChainHandle  chain,
int  index,
const ResNum num,
const ResidueKey k 
)

◆ Prune()

void Prune ( )

Removes all residues and chains in the attached entity that don't contain any atoms.

◆ RenameAtom()

void RenameAtom ( AtomHandle  atom,
const String new_name 
)

change the name of the atom to the new name

◆ RenameChain()

void RenameChain ( ChainHandle  chain,
const String new_name 
)

◆ RenameResidue()

void RenameResidue ( ResidueHandle  res,
const String new_name 
)

◆ RenumberAllResidues()

void RenumberAllResidues ( int  start,
bool  keep_spacing 
)

renumber residues of all chains

Parameters
startResidues of every chain will be renumbered, whereas the first residue gets the residue number start.
keep_spacingIf set to false, residues will continously be renumbered ongoing from start. Otherwise the spacings between the residues are kept.

◆ RenumberChain() [1/2]

void RenumberChain ( ChainHandle  chain,
const ResNumList new_numbers 
)

◆ RenumberChain() [2/2]

void RenumberChain ( const ChainHandle chain,
int  start,
bool  keep_spacing 
)

renumber residues of one chain

Parameters
chainAll residues of this chain will be renumbered according to the parameters start and keep_spacing
startResidues of given chain will be renumbered, whereas the first residue gets the residue number start.
keep_spacingIf set to false, residues will continously be renumbered ongoing from start. Otherwise the spacings between the residues are kept.

◆ ReorderAllResidues()

void ReorderAllResidues ( )

reorder residues of all chains based on their residue number

◆ ReorderResidues()

void ReorderResidues ( const ChainHandle chain)

reorder residues of given chain based on their residue number

◆ SetChainDescription()

void SetChainDescription ( ChainHandle  chain,
const String  desc 
)

Assign a description to a chain.

Parameters
chainchain to assign to
descdescription

◆ SetChainType()

void SetChainType ( ChainHandle  chain,
const ChainType  type 
)

Assign type of chain according to ChainType.

Parameters
chainchain to assign to
typetype of the chain

◆ SetResidueNumber()

void SetResidueNumber ( ResidueHandle  res,
const ResNum num 
)

◆ UpdateTrace()

void UpdateTrace ( )
protected

Field Documentation

◆ ent_

EntityHandle ent_
protected

Definition at line 339 of file editor_base.hh.

◆ mode_

EditMode mode_
protected

Definition at line 340 of file editor_base.hh.


The documentation for this class was generated from the following file: