Colloid shapes¶
Overview
hoobas.GenShape.shape |
Generic object describing the shape of a colloid in hoobas. |
Details
Genshape provides classes to represent colloid shapes in hoobas.
-
class
hoobas.GenShape.PdbProtein(surf_plane=None, lattice=None, properties=None, filename=None, units=None)[source]¶ Provides a class to import PDB protein files into hoobas in a simple fashion
Methods :
parse_pdb_protein(filename = None) will load a protein from a pdb file. Calculates mass, moment of inertia. If filename is left to none, assumes legacy filename behavior.
add_shell(key, shell_name = None) parses the keys in the pdb list and adds a shell representation of the parsed keys. Giving it a name allows to bind stuff onto the shell
set_ext_shell_grafts(ext_obj, num = None, linker_bond_type = None, shell_name = None) binds num ext_objs onto the shell with name shell_name. A bond of linker_bond_type is added between the shell and external object
pdb_build_table() needs to be called once all shells / grafts are set
-
add_shell(key, qualifier=None)[source]¶ Adds a shell to the protein object. Able to key multiple commands onto the same shell
self.flags[‘shell’] is defined as a list of [ shell_name, positions, [dictionaries] ], this backtracks all previous shells to make sure that no particle is added twice. It is possible to create an empty shell
Parameters: - key –
- qualifier – qualifier to describe the current set of shell beads, this can be any class that is then compared
with a supplied qualifier during the add_grafts if required. The add_graft can also be supplied with a lambda function that has a key arguement ‘qualifier’ that will receive this paramter. :return:
-
-
class
hoobas.GenShape.ProteinResidueCG(surf_plane=None, lattice=None, properties=None, filename=None, filters=None, CG_model=None)[source]¶
-
class
hoobas.GenShape.SquareRod(Num, surf_plane=None, lattice=None, properties=None, SideOverLength=None)[source]¶
-
class
hoobas.GenShape.TruncatedTetrahedron(ratio=0.5, spacing=0.05, properties=None)[source]¶ Creates a truncated tetrahedron
V4 V1. . . .
V5….V6 . V4 .
. . . . . .
. . . V5 …. V6 .
Side View-> V2…………V3 Top View-> V2 … … . .V3
-
class
hoobas.GenShape.shape(properties=None, units=None)[source]¶ Generic object describing the shape of a colloid in hoobas. The object has a shape.table array which contains points representing the shape. New shapes can easily be added by adding new objects inheriting the shape class
self.flags is a dictionary for building directives, which can be set by using shape.set_properties
properties is a dict object for additional properties useful for non-trivial cases (read xyz / pdb parsed files): ‘normalized’ : set to either True or False, defines if the shape is a geometric representation (eg cube) or a finite size object (eg protein)
‘surface’ : used by normalized shapes to calculate surface of an object ‘density’ : used by normalized shapes to calculate mass ‘volume’ : used by normalized shapes to calculate volume properties (eg mass) ‘mass’ : mass of the object, mainly used for proteins, overrides the density*volume value ‘size’ : scaling factor for normalized shapes
Constructor : :param surf_plane : rotation to give every object to match given z axis crystal axis :param lattice : used to specify crystal lattice in conjuction with surf_plane :param properties : dictionary used to set flags :param units: units to be used by the shape.
General methods :
set_properties : sets the additional properties required for building such as density, mass, etc.
Other internals :
Bonded types : self.internal_bonds is a list of length N, containing N bonds in the form of [i, j, r0, type] self.internal_angles is a list of length N, containing N angle potentials in the form [i, j, k, theta0, type]
Rigid body characteristics : self.Itensor is the inertia tensor of the shape, in the form of 1 x 3 values for principal axis self.quaternion is the quaternion of the shape, relating the supplied table to the inertia tensor principal axis
-
get_N_idx(N, **sortargs)[source]¶ gets the N smallest indexes of norm values in self.table calculates offsets so whatever is defined in self.additional_points is not taken into account.
This is made for geometric shapes, but can be used for other things.
:param N number of largest norm values to return :return list of indexes
-