ModelOperations
Model operations are processed after the models are added. These components apply transformations to the coordinates of the particles. VLMP has both simple transformations, like rotation or fixing the position of the particle, and more complex ones, such as distributing models within a volume:
# Model Operations
"modelOperations":[{
"type":"rotation",
"parameters":{"axis":[1.0,0.0,0.0],
"angle":3.14,
"selection":"all"}},{
"type":"distributeRandomly",
"parameters":{"mode":{
"sphere":{
"radius":40.0,
"center":[0.0,0.0,0.0]
}
},
"avoidClashes":True,
"selection":"all"}}
]
As seen, in most cases, model operations require specifying a selection of particles to apply them. In the above example, the keyword “all” is used, which selects all particles added to the simulation. As mentioned, models can also define selections:
# Model Operations Selection
"modelOperations":[{
"type":"setCenterOfMassPosition",
"parameters":{"position":[0.0,0.0,0.0],
"selection":"dna basePairIndex 2"}}
]
In this case, we would fix the position of the center of mass formed by the particles of the model named “dna” that belong to the second base pair. Model operations can be combined, and like the rest of the components, their processing order is ensured.
The full list of model operations is as follows:
alignInertiaMomentAlongVector
- author
Pablo Ibáñez-Freire
Aligns the largest inertia moment of selected particles along a specified vector.
Name |
Description |
Type |
Default |
|---|---|---|---|
vector |
Vector along which to align the largest inertia moment. |
list of float |
Name |
Description |
Type |
|---|---|---|
selection |
Selection of particles to align. |
list of ids |
Example:
{
"type": "alignInertiaMomentAlongVector",
"parameters":{
"vector": [0.0, 0.0, 1.0],
"selection": "model1 chain A"
}
}
distributeRandomly
- author
Pablo Ibáñez-Freire
Distributes selected particles randomly within specified bounds.
Name |
Description |
Type |
Default |
|---|---|---|---|
mode |
Distribution mode, either ‘box’ or ‘sphere’. |
str |
box |
randomRotation |
Whether to apply random rotations to the particles. |
bool |
True |
avoidClashes |
Number of attempts to avoid particle clashes. If 0, clashes are not avoided. |
int |
0 |
Name |
Description |
Type |
|---|---|---|
selection |
Selection of particles to distribute. |
list of ids |
Example:
{
"type": "distributeRandomly",
"parameters":{
"mode": "sphere",
"avoidClashes": 100,
"randomRotation": True,
"selection": "model1 all"
}
}
rotation
- author
Pablo Ibáñez-Freire
Applies a rotation to selected particles around a specified axis.
Name |
Description |
Type |
Default |
|---|---|---|---|
angle |
Angle of rotation in radians. |
float |
|
axis |
Axis of rotation. |
list of float |
Name |
Description |
Type |
|---|---|---|
selection |
Selection of particles to rotate. |
list of ids |
Example:
{
"type": "rotation",
"parameters":{
"axis": [0.0, 0.0, 1.0],
"angle": 3.14159,
"selection": "model1 resid 1 to 10"
}
}
setCenterOfMassPosition
- author
Pablo Ibáñez-Freire
Sets the center of mass of a selection of particles to a specified position.
Name |
Description |
Type |
Default |
|---|---|---|---|
position |
Target position for the center of mass. |
list of float |
Name |
Description |
Type |
|---|---|---|
selection |
Selection of particles to move. |
list of ids |
Example:
{
"type": "setCenterOfMassPosition",
"parameters":{
"position": [0.0, 0.0, 0.0],
"selection": "model1 type A B C"
}
}
setContactDistance
- author
Pablo Ibáñez-Freire
Sets the contact distance between two selections of particles.
Name |
Description |
Type |
Default |
|---|---|---|---|
distance |
Target contact distance between the selections. |
float |
|
resolution |
Resolution for the contact distance adjustment. |
float |
0.1 |
Name |
Description |
Type |
Default |
|---|---|---|---|
inverse |
Whether to invert the direction of the contact. |
bool |
False |
Name |
Description |
Type |
|---|---|---|
reference |
Reference selection of particles. |
list of ids |
mobile |
Mobile selection of particles to be moved. |
list of ids |
Example:
{
"type": "setContactDistance",
"parameters":{
"distance": 5.0,
"resolution": 0.01,
"inverse": False,
"reference": "model1 type A",
"mobile": "model2 type B"
}
}
setParticleLowestPosition
- author
Pablo Ibáñez-Freire
Sets the lowest particle in the selection to a specified Z position.
Name |
Description |
Type |
Default |
|---|---|---|---|
position |
Z coordinate to set for the lowest particle. |
float |
Name |
Description |
Type |
Default |
|---|---|---|---|
radiusFactor |
Factor to multiply the radius by when considering it. |
float |
1.0 |
considerRadius |
Whether to consider particle radius when setting the position. |
bool |
False |
Name |
Description |
Type |
|---|---|---|
selection |
Selection of particles to consider. |
list of ids |
Example:
{
"type": "setParticleLowestPosition",
"parameters":{
"position": 0.0,
"considerRadius": True,
"radiusFactor": 1.1,
"selection": "model1 all"
}
}
setParticlePositions
- author
Pablo Ibáñez-Freire
Sets the positions of a group of particles to specified coordinates.
Name |
Description |
Type |
Default |
|---|---|---|---|
ids |
List of particle IDs to move. |
list of int |
|
positions |
List of new positions for the selected particles. |
list of list of float |
Example:
{
"type": "setParticlePositions",
"parameters":{
"positions": [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]],
"ids": [0, 1]
}
}
setParticleXYPosition
- author
Pablo Ibáñez-Freire
Sets the XY position of selected particles to a specified value.
Name |
Description |
Type |
Default |
|---|---|---|---|
position |
New XY position for the particles. |
list of float |
Name |
Description |
Type |
|---|---|---|
selection |
Selection of particles to move. |
list of ids |
Example:
{
"type": "setParticleXYPosition",
"parameters":{
"position": [1.0, 2.0],
"selection": "model1 type A"
}
}