moleculekit.representations module#

class moleculekit.representations.Representations(mol)#

Bases: object

Class that stores representations for Molecule.

Examples

>>> from moleculekit.molecule import Molecule
>>> mol = tryp.copy()
>>> mol.reps.add('protein', 'NewCartoon')
>>> print(mol.reps)                     
rep 0: sel='protein', style='NewCartoon', color='Name'
>>> mol.view() 
>>> mol.reps.remove() 
add(sel=None, style=None, color=None, frames=None, opacity=None)#

Adds a new representation for Molecule.

Parameters:
  • sel (str) – Atom selection string for the representation. See more here

  • style (str) – Representation style. See more here.

  • color (str or int) – Coloring mode (str) or ColorID (int). See more here.

  • frames (list) – List of frames to visualize with this representation. If None it will visualize the current frame only.

  • opacity (float) – Opacity of the representation. 0 is fully transparent and 1 is fully opaque.

append(reps)#
list()#

Lists all representations. Equivalent to using print.

remove(index=None)#

Removed one or all representations.

Parameters:

index (int) – The index of the representation to delete. If none is given it deletes all.