Examples on how to manioulate the atom struct in various ways

(For a full list of importing and exporting functions, go to List_general_functions and the List_all_functions

Contents

Manipulation of the atom struct

The atom struct variable is an indexed Matlab struct variable that stores molecule attributes like atomtype names, moleculeID's, atomID's, coordinates and more as indexed fields in the atom struct. A brief list of functions that can be used to maniulate the atom is seen below.

  1. bond_valence_atom(atom,Box_dim,varargin) % This function tries to calculate the bond valence values according to the bond valence method
  2. copy_atom(atom,atomtype,new_atomtype,new_resname,trans_vec,varargin) % This function copies and translates atoms in the atom struct
  3. find_bonded_atom(atom,bond_matrix,label1,label2) % This function tries to find all bonds between the atomtype1 and atomtype2.
  4. frac2atom(atom,Box_dim,angleparam,angletype) % This function transforms fractional coordinates to cartesian
  5. frame2atom(atom,traj,frame,Box_dim,varargin) % This function extracts a frame to the trajectory matrix
  6. keep_atom(atom,resname) % keep_atom.m - This removes all but resname
  7. keep_resname(atom,resnames) % keep_resname.m - This removes all but the resnames
  8. reorder_atom(atom,atomlist) % This function reorders the atoms in the atom struct
  9. replace_atom(new_atom,prev_atom,molid_index) % This function replaces molid's in an atom struct with a new (single molid) atom struct by placing the latters COM in the formers place
  10. scale_atom(atom,scale_vec,Box_dim,Resname) % This function scales the coordinates in the atom struct
  11. sigma_vdw(Atom_label) % This function fetches the sigma radius parameter, originally taken from the link below from 'A cartography of the van der Waals territories' Santiago Alvarez doi:10.1039/c3dt50599e
  12. slice_atom(atom,limits,invert) % This function checks if the coordinates for each time record in XYZ_data is within the specified limits, and if not sets the x,y,z to nan,nan,nan.
  13. slice_triclinic_atom(atom,limits,invert) % This function slices the atoms into the triclinic box.
  14. sort_atom(atom) % sort_atom.m - This section orders to atoms with respect to z
  15. update_atom(atom) % This function updates the molid index and the atoms index in the atom struct
  16. vmd(atom,Box_dim) % This function plots the atom struct
  17. wrap_atom(atom,Box_dim) % This wraps the atoms into the orthogonal box
  18. xyz2atom(XYZ_labels,XYZ_data,Box_dim,resname,in_atom) % This function can be used to add XYZ data (like from a .xyz structure file)to the atom struct format
  19. rename_type(atom,atomtype,new_atomtype,varargin) % This function renames atoms in the atom
  20. properties_atom(atom,Box_dim,varargin) % This function fetches various properties of the atoms in the atom struct, using for instance the bond valence method and for instance the radii originally taken from below Revised effective ionic radii and systematic studies of interatomic distances in halides and chalcogenides. R. D. Shannon Acta Cryst. (1976) A32, 751-767.
  21. overwrite_atom(In_atom,atomtype,resname) % This function overwrites the atom struct information with new information