Betaine

mbuild_polybuild.cg_monomers.betaine.Betaine

class mbuild_polybuild.cg_monomers.betaine.Betaine(backbone_length=1, spacer_backbone=2, spacer_ion=1, polar_backbone=False, cap_group=False)[source]

Bases: Compound

A generalized representation of a betaine monomer.

Ports

  • up: Connection with one side of the monomer.

  • down: Connection with another side of the monomer.

Parameters:
  • backbone_length (int, optional, default=1) – Number of beads in the backbone chain of a monomer. This chain is perpendicular to the pendent group close to the center.

  • spacer_backbone (int, optional, default=2) – Number of backbone groups between the cation and backbone chain.

  • spacer_ion (int, optional, default=1) – Number of backbone groups between the cation and terminal anion.

  • polar_backbone (bool, optional, default=False) – If true, a polar group “_P” is added to the base of the pendent where it meets the chain.

  • cap_group (bool, optional, default=False) – Remove the “down” port for the monomer to create a capping monomer.

Examples

>>> from mbuild_polybuild.cg_monomers.betaine import Betaine
>>> betaine = Betaine(backbone_length=2, spacer_backbone=3)
>>> betaine.visualize()

Betaine.box

Get the box of the Compound.

Betaine.center

Get the cartesian center of the Compound based on its Particles.

Betaine.charge

Return the total charge of a compound.

Betaine.element

Get the element of the Compound.

Betaine.mass

Return the total mass of a compound.

Betaine.maxs

Return the maximum x, y, z coordinate of any particle in this compound.

Betaine.mins

Return the mimimum x, y, z coordinate of any particle in this compound.

Betaine.n_bonds

Return the total number of bonds in the Compound.

Betaine.n_direct_bonds

Return the number of bonds a particle is directly involved in.

Betaine.n_particles

Return the number of Particles in the Compound.

Betaine.periodicity

Get the periodicity of the Compound.

Betaine.pos

Get the position of the Compound.

Betaine.root

Get the Compound at the top of self's hierarchy.

Betaine.xyz

Return all particle coordinates in this compound.

Betaine.xyz_with_ports

Return all particle coordinates in this compound including ports.

Betaine.add(new_child[, label, containment, ...])

Add a part to the Compound.

Betaine.add_bond(particle_pair[, bond_order])

Add a bond between two Particles.

Betaine.all_ports()

Return all Ports referenced by this Compound and its successors.

Betaine.ancestors()

Generate all ancestors of the Compound recursively.

Betaine.available_ports()

Return all unoccupied Ports referenced by this Compound.

Betaine.bonds([return_bond_order])

Return all bonds in the Compound and sub-Compounds.

Betaine.check_for_overlap(excluded_bond_depth)

Check if a compound contains overlapping particles.

Betaine.condense([inplace])

Condense the hierarchical structure of the Compound to the level of molecules.

Betaine.direct_bonds([graph_depth])

Return a list of particles that this particle bonds to.

Betaine.energy_minimize([forcefield, steps, ...])

Perform an energy minimization on a Compound.

Betaine.flatten([inplace])

Flatten the hierarchical structure of the Compound.

Betaine.freud_generate_bonds(name_a, name_b, ...)

Add Bonds between all pairs of types a/b within [dmin, dmax].

Betaine.from_gmso(topology[, coords_only, ...])

Convert a GMSO Topology to mBuild Compound.

Betaine.from_parmed(structure[, ...])

Extract atoms and bonds from a pmd.Structure.

Betaine.from_pybel(pybel_mol[, use_element, ...])

Create a Compound from a Pybel.Molecule.

Betaine.from_trajectory(traj[, frame, ...])

Extract atoms and bonds from a md.Trajectory.

Betaine.generate_bonds(name_a, name_b, dmin, ...)

Add Bonds between all pairs of types a/b within [dmin, dmax].

Betaine.get_boundingbox([pad_box])

Compute the bounding box of the compound.

Betaine.get_smiles()

Get SMILES string for compound.

Betaine.is_independent()

Return True if there is no bond between particles of the Compound to an external Compound.

Betaine.min_periodic_distance(xyz0, xyz1)

Vectorized distance calculation considering minimum image.

Betaine.particles([include_ports])

Return all Particles of the Compound.

Betaine.particles_by_element(element)

Return all Particles of the Compound with a specific element.

Betaine.particles_by_name(name)

Return all Particles of the Compound with a specific name.

Betaine.particles_in_range(compound, dmax[, ...])

Find particles within a specified range of another particle.

Betaine.print_hierarchy([print_full, index, ...])

Print the hierarchy of the Compound.

Betaine.referenced_ports()

Return all Ports referenced by this Compound.

Betaine.remove(objs_to_remove[, reset_labels])

Remove children from the Compound cleanly.

Betaine.remove_bond(particle_pair)

Delete a bond between a pair of Particles.

Betaine.reset_labels()

Reset Compound labels so that substituents and ports are renumbered, indexed from port[0] to port[N], where N-1 is the number of ports.

Betaine.rotate(theta, around)

Rotate Compound around an arbitrary vector.

Betaine.rotate_dihedral(bond, phi)

Rotate a dihedral about a central bond.

Betaine.save(filename[, include_ports, box, ...])

Save the Compound to a file.

Betaine.spin(theta, around[, anchor])

Rotate Compound in place around an arbitrary vector.

Betaine.successors()

Yield Compounds below self in the hierarchy.

Betaine.to_freud()

Betaine.to_gmso(**kwargs)

Create a GMSO Topology from a mBuild Compound.

Betaine.to_hoomdsnapshot(**kwargs)

Create a HOOMD-Blue snapshot from an mBuild Compound.

Betaine.to_intermol([molecule_types])

Create an InterMol system from a Compound.

Betaine.to_networkx([names_only])

Create a NetworkX graph representing the hierarchy of a Compound.

Betaine.to_parmed([box, title, residues, ...])

Create a ParmEd Structure from a Compound.

Betaine.to_pybel([box, title, residues, ...])

Create a pybel.Molecule from a Compound.

Betaine.to_rdkit()

Create an RDKit RWMol from an mBuild Compound.

Betaine.to_smiles([backend])

Create a SMILES string from an mbuild compound.

Betaine.to_trajectory([include_ports, ...])

Convert to an md.Trajectory and flatten the compound.

Betaine.translate(by)

Translate the Compound by a vector.

Betaine.translate_to(pos)

Translate the Compound to a specific position.

Betaine.update_coordinates(filename[, ...])

Update the coordinates of this Compound from a file.

Betaine.visualize([show_ports, backend, ...])

Visualize the Compound using py3dmol (default) or nglview.