openff.toolkit.topology.TopologyVirtualParticle

class openff.toolkit.topology.TopologyVirtualParticle(virtual_site, virtual_particle, topology_molecule, topology_virtual_site)[source]
__init__(virtual_site, virtual_particle, topology_molecule, topology_virtual_site)[source]

Methods

__init__(virtual_site, virtual_particle, ...)

atom(index)

Get the atom at a specific index in this TopologyVirtualParticle

from_bson(serialized)

Instantiate an object from a BSON serialized representation.

from_dict(d)

Static constructor from dictionary representation.

from_json(serialized)

Instantiate an object from a JSON serialized representation.

from_messagepack(serialized)

Instantiate an object from a MessagePack serialized representation.

from_pickle(serialized)

Instantiate an object from a pickle serialized representation.

from_toml(serialized)

Instantiate an object from a TOML serialized representation.

from_xml(serialized)

Instantiate an object from an XML serialized representation.

from_yaml(serialized)

Instantiate from a YAML serialized representation.

to_bson()

Return a BSON serialized representation.

to_dict()

Convert to dictionary representation.

to_json([indent])

Return a JSON serialized representation.

to_messagepack()

Return a MessagePack representation.

to_pickle()

Return a pickle serialized representation.

to_toml()

Return a TOML serialized representation.

to_xml([indent])

Return an XML representation.

to_yaml()

Return a YAML serialized representation.

Attributes

atoms

Get the TopologyAtoms involved in this TopologyVirtualParticle.

molecule

Get the reference Molecule that this TopologyVirtualParticle belongs to.

topology_molecule

Get the TopologyMolecule that this TopologyVirtualSite belongs to.

topology_parent_atom_index

Returns the index of the 'parent' atom as determined by the virtual site type in the topology.

topology_particle_index

Get the index of this particle in its parent Topology.

type

Get the type of this virtual site

virtual_particle

Get the reference VirtualParticle for this TopologyVirtualParticle.

virtual_site

Get the reference VirtualSite for this TopologyVirtualSite.

property molecule

Get the reference Molecule that this TopologyVirtualParticle belongs to.

Returns

openff.toolkit.topology.molecule.Molecule

property virtual_site

Get the reference VirtualSite for this TopologyVirtualSite.

Returns

an openff.toolkit.topology.molecule.VirtualSite

property virtual_particle

Get the reference VirtualParticle for this TopologyVirtualParticle.

Returns

an openff.toolkit.topology.molecule.VirtualSite

property type

Get the type of this virtual site

Returns

str (The class name of this virtual site)

atom(index)[source]

Get the atom at a specific index in this TopologyVirtualParticle

Parameters

index (int) – The index of the atom in the reference VirtualParticle to retrieve

Returns

TopologyAtom

property atoms

Get the TopologyAtoms involved in this TopologyVirtualParticle. :returns: iterator of openff.toolkit.topology.TopologyAtom

property topology_molecule

Get the TopologyMolecule that this TopologyVirtualSite belongs to.

Returns

openff.toolkit.topology.TopologyMolecule

property topology_particle_index

Get the index of this particle in its parent Topology.

Returns

idx (int) – The index of this particle in its parent topology.

property topology_parent_atom_index: int

Returns the index of the ‘parent’ atom as determined by the virtual site type in the topology.

to_dict()[source]

Convert to dictionary representation.

classmethod from_dict(d)[source]

Static constructor from dictionary representation.

classmethod from_bson(serialized)

Instantiate an object from a BSON serialized representation.

Specification: http://bsonspec.org/

Parameters

serialized (bytes) – A BSON serialized representation of the object

Returns

instance (cls) – An instantiated object

classmethod from_json(serialized)

Instantiate an object from a JSON serialized representation.

Specification: https://www.json.org/

Parameters

serialized (str) – A JSON serialized representation of the object

Returns

instance (cls) – An instantiated object

classmethod from_messagepack(serialized)

Instantiate an object from a MessagePack serialized representation.

Specification: https://msgpack.org/index.html

Parameters

serialized (bytes) – A MessagePack-encoded bytes serialized representation

Returns

instance (cls) – Instantiated object.

classmethod from_pickle(serialized)

Instantiate an object from a pickle serialized representation.

Warning

This is not recommended for safe, stable storage since the pickle specification may change between Python versions.

Parameters

serialized (str) – A pickled representation of the object

Returns

instance (cls) – An instantiated object

classmethod from_toml(serialized)

Instantiate an object from a TOML serialized representation.

Specification: https://github.com/toml-lang/toml

Parameters

serlialized (str) – A TOML serialized representation of the object

Returns

instance (cls) – An instantiated object

classmethod from_xml(serialized)

Instantiate an object from an XML serialized representation.

Specification: https://www.w3.org/XML/

Parameters

serialized (bytes) – An XML serialized representation

Returns

instance (cls) – Instantiated object.

classmethod from_yaml(serialized)

Instantiate from a YAML serialized representation.

Specification: http://yaml.org/

Parameters

serialized (str) – A YAML serialized representation of the object

Returns

instance (cls) – Instantiated object

to_bson()

Return a BSON serialized representation.

Specification: http://bsonspec.org/

Returns

serialized (bytes) – A BSON serialized representation of the objecft

to_json(indent=None)

Return a JSON serialized representation.

Specification: https://www.json.org/

Parameters

indent (int, optional, default=None) – If not None, will pretty-print with specified number of spaces for indentation

Returns

serialized (str) – A JSON serialized representation of the object

to_messagepack()

Return a MessagePack representation.

Specification: https://msgpack.org/index.html

Returns

serialized (bytes) – A MessagePack-encoded bytes serialized representation of the object

to_pickle()

Return a pickle serialized representation.

Warning

This is not recommended for safe, stable storage since the pickle specification may change between Python versions.

Returns

serialized (str) – A pickled representation of the object

to_toml()

Return a TOML serialized representation.

Specification: https://github.com/toml-lang/toml

Returns

serialized (str) – A TOML serialized representation of the object

to_xml(indent=2)

Return an XML representation.

Specification: https://www.w3.org/XML/

Parameters

indent (int, optional, default=2) – If not None, will pretty-print with specified number of spaces for indentation

Returns

serialized (bytes) – A MessagePack-encoded bytes serialized representation.

to_yaml()

Return a YAML serialized representation.

Specification: http://yaml.org/

Returns

serialized (str) – A YAML serialized representation of the object