UnityMol  1.0.25beta
UMol.API.APIPython Class Reference
Inheritance diagram for UMol.API.APIPython:

Public Member Functions

IEnumerator waitOf ()
 
void setPosScaleRot (Vector3 pos, Vector3 scale, Vector3 rot, Vector3 centerOfRotation)
 

Static Public Member Functions

static void ExecuteCommand (string command)
 Allow to call python API commands and record them in the history from C# More...
 
static UnityMolStructure load (string filePath, bool readHetm=true)
 Load a local molecular file (pdb/mmcif/gro/mol2/sdf/xyz formats) More...
 
static UnityMolStructure fetch (string PDBId, bool usemmCIF=true, bool readHetm=true)
 Fetch a remote molecular file (pdb or mmcif zipped) This function calls showDefault() and centerOnStructure() More...
 
static void showHideHydrogensInSelection (string selName, bool? shouldShow=null)
 Show/Hide hydrogens in representations of the provided selection This only works for lines, hyperball and sphere representations More...
 
static void showHideSideChainsInSelection (string selName)
 Show/Hide side chains in representations of the current selection This only works for lines, hyperball and sphere representations only More...
 
static void showHideBackboneInSelection (string selName)
 Show/Hide backbone in representations of the current selection This only works for lines, hyperball and sphere representations only More...
 
static void setModel (string structureName, int modelId)
 Set the current model of the structure This function is used by ModelPlayers.cs to read the models of a structure like a trajectory More...
 
static void loadTraj (string structureName, string path)
 Load a trajectory for a loaded structure It creates a XDRFileReader in the corresponding UnityMolStructure and a TrajectoryPlayer More...
 
static void unloadTraj (string structureName)
 Unload a trajectory for a specific structure More...
 
static void loadDXmap (string structureName, string path)
 Load a density map for a specific structure This function creates a DXReader instance in the UnityMolStructure More...
 
static void unloadDXmap (string structureName)
 Unload the density map for the structure More...
 
static void readJSONFieldlines (string structureName, string path)
 Read a json file and display fieldLines for the specified structure More...
 
static void unloadJSONFieldlines (string structureName)
 Remove the json file for fieldlines stored in the currentModel of the specified structure More...
 
static int getStructureGroup (string structureName)
 Utility function to be able to get the group of the structure This group is used to be able to move all the loaded molecules in the same group Groups can be between 0 and 9 included More...
 
static HashSet< UnityMolStructuregetStructuresOfGroup (int group)
 Utility function to be able to get the structures of the group This group is used to be able to move all the loaded molecules in the same group Groups can be between 0 and 9 included More...
 
static void setStructureGroup (string structureName, int newGroup)
 Utility function to be set the group of a structure This group is used to be able to move all the loaded molecules in the same group Groups can be between 0 and 9 included More...
 
static void delete (string structureName)
 Delete a molecule and all its UnityMolSelection and UnityMolRepresentation More...
 
static void show (string type)
 Show as 'type' all loaded molecules type can be "cartoon", "c", "surface", "s", "hb", "line", "l", "hbond" More...
 
static void showDefault (string selName)
 Create default representations (cartoon for protein + HB for not protein atoms) More...
 
static void waitOneFrame ()
 
static void showStructureAllRepresentations (string structureName)
 Unhide all representations already created for a specified structure More...
 
static void showSelection (string selName, string type, params object[] args)
 Show the selection as 'type' type can be "cartoon", "c", "surface", "s", "hb", "line", "l", "hbond" If the representation is already there, update it if the selection content changed and show it More...
 
static void hideSelection (string selName)
 Hide every representations of the specified selection More...
 
static void hideSelection (string selName, string type)
 Hide every representation of type 'type' of the specified selection type can be "cartoon", "c", "surface", "s", "hb", "line", "l", "hbond" More...
 
static void deleteRepresentationInSelection (string selName, string type)
 Delete every representations of type 'type' of the specified selection type can be "cartoon", "c", "surface", "s", "hb", "line", "l", "hbond" More...
 
static void deleteRepresentationsInSelection (string selName)
 Delete every representations of the specified selection More...
 
static void hideStructureAllRepresentations (string structureName)
 Hide every representations of the specified structure More...
 
static bool areRepresentationsOn (string structureName)
 Utility function to test if a representation is shown for a specified structure More...
 
static bool areRepresentationsOn (string selName, string type)
 Utility function to test if a representation of type 'type' is shown for a specified selection type can be "cartoon", "c", "surface", "s", "hb", "line", "l", "hbond" More...
 
static void hide (string type)
 Hide all representations of type 'type' type can be "cartoon", "c", "surface", "s", "hb", "line", "l", "hbond" More...
 
static void switchSurfaceComputeMethod (string selName)
 Switch between the 2 types of surface computation methods: EDTSurf and MSMS More...
 
static void switchCutSurface (string selName, bool isCut)
 Switch between cut surface mode and no-cut surface mode More...
 
static void setSolidSurface (string selName)
 Switch all surface representation in selection to a solid surface material More...
 
static void setWireframeSurface (string selName)
 Switch all surface representation in selection to a wireframe surface material when available More...
 
static void setTransparentSurface (string selName, float alpha=0.8f)
 Switch all surface representation in selection to a transparent surface material More...
 
static void setSmoothness (string selName, string type, float val)
 Change hyperball representation parameters in the specified selection to a preset Metaphores can be "Smooth", "Balls&Sticks", "VdW", "Licorice" type can be "cartoon", "c", "surface", "s", "hb", "line", "l", "hbond" More...
 
static void setMetal (string selName, string type, float val)
 Change hyperball representation parameters in the specified selection to a preset Metaphores can be "Smooth", "Balls&Sticks", "VdW", "Licorice" type can be "cartoon", "c", "surface", "s", "hb", "line", "l", "hbond" More...
 
static void setHyperBallMetaphore (string selName, string metaphore)
 Change hyperball representation parameters in the specified selection to a preset Metaphores can be "Smooth", "Balls&Sticks", "VdW", "Licorice" More...
 
static void setHyperBallShininess (string selName, float shin)
 Set shininess for the hyperball representations of the specified selection More...
 
static void setHyperballShrink (string selName, float shrink)
 Set the shrink factor for the hyperball representations of the specified selection More...
 
static void setHyperballTexture (string selName, int idTex)
 Change all hyperball representation in the selection with a new texture mapped idTex of the texture is the index in UnityMolMain.atomColors.textures More...
 
static void setCartoonColorSS (string selName, string ssType, Color col)
 Set the color of the cartoon representation of the specified selection based on the nature of secondary structure assigned ssType can be "helix", "sheet" or "coil" More...
 
static void setRepSize (string selName, string type, float size)
 Change the size of the representation of type 'type' in the selection Mainly used for hyperball representation type can be "cartoon", "c", "surface", "s", "hb", "line", "l", "hbond" More...
 
static void colorSelection (string selName, string type, Color col)
 Change the color of all representation of type 'type' in selection type can be "cartoon", "c", "surface", "s", "hb", "line", "l", "hbond" More...
 
static void colorSelection (string selName, string type, string colorS)
 Change the color of all representation of type 'type' in selection colorS can be "black", "white", "yellow", "green", "red", "blue", "pink", "gray" type can be "cartoon", "c", "surface", "s", "hb", "line", "l", "hbond" More...
 
static void resetColorSelection (string selName, string type)
 Reset the color of all representation of type 'type' in selection to the default value type can be "cartoon", "c", "surface", "s", "hb", "line", "l", "hbond" More...
 
static void colorByChain (string selName, string type)
 Use the color palette to color representations of type 'type' in the selection 'selName' by chain type can be "cartoon", "c", "surface", "s", "hb", "line", "l", "hbond" More...
 
static void colorByResidue (string selName, string type)
 Use the color palette to color representations of type 'type' in the selection 'selName' by residue type can be "cartoon", "c", "surface", "s", "hb", "line", "l", "hbond" More...
 
static void colorByAtom (string selName, string type)
 Color representations of type 'type' in the selection 'selName' by atom More...
 
static void colorByCharge (string selName, bool normalizeDensity=false, float minDens=-10.0f, float maxDens=10.0f)
 Use the dx map to color by charge around atoms Only works for surface for now If normalizeDensity is set to true, the density values will be normalized if it is set to true, the default -10|10 range is used More...
 
static void setLineSize (string selName, float val)
 
static void centerOnStructure (string structureName, bool lerp=false)
 Offsets all representations to center the structure 'structureName' Instead of moving the camera, move the loaded molecules to center them on the center of the camera More...
 
static ManipulationManager getManipulationManager ()
 
static void centerOnSelection (string selName, bool lerp=false)
 Offsets all representations to center the selection 'selName' More...
 
static UnityMolSelection select (string selMDA, string name="selection", bool createSelection=true, bool addToExisting=false, bool silent=false, bool setAsCurrentSelection=true, bool forceCreate=false)
 Create a UnityMolSelection based on MDAnalysis selection language (https://www.mdanalysis.org/docs/documentation_pages/selections.html) Returns a UnityMolSelection object, adding it to the selection manager if createSelection is true If a selection with the same name already exists and addToExisting is true, add atoms to the already existing selection Set forceCreate to true if the selection is empty but still need to generate the selection More...
 
static void addSelectionKeyword (string keyword, string selName)
 Add a keyword to the selection language More...
 
static void removeSelectionKeyword (string keyword)
 Remove a keyword from the selection language More...
 
static void setCurrentSelection (string selName)
 Set the selection as currentSelection in the UnityMolSelectionManager More...
 
static void addToSelection (string selMDA, string name="selection", bool silent=false)
 Look for an existing selection named 'name' and add atoms to it based on MDAnalysis selection language More...
 
static void removeFromSelection (string selMDA, string name="selection", bool silent=false)
 Look for an existing selection named 'name' and remove atoms from it based on MDAnalysis selection language More...
 
static void deleteSelection (string selName)
 Delete selection 'selName' and all its representations More...
 
static string duplicateSelection (string selName)
 Duplicate selection 'selName' and without the representations More...
 
static bool renameSelection (string oldSelName, string newSelName)
 Change the 'oldSelName' selection name into 'newSelName' More...
 
static bool updateSelectionWithMDA (string selName, string selectionString, bool forceAlteration, bool silent=false)
 Update the atoms of the selection based on a new MDAnalysis language selection The selection only applies to the structures of the selection More...
 
static UnityMolSelection selectInSphere (Vector3 position, float radius)
 Select atoms of all loaded molecules inside a sphere defined by a world space position and a radius in Anstrom More...
 
static void updateRepresentations (string selName)
 Update representations of the specified selection More...
 
static void clearSelections ()
 Clear the currentSelection in UnityMolSelectionManager More...
 
static bool isATrajectoryPlaying ()
 Utility function to test if a trajectory is playing for any loaded molecule More...
 
static void changeHighlightMaterial (Material newMat)
 Utility function to change the material of highlighted selection More...
 
static void screenshot (string path, int resolutionWidth=1280, int resolutionHeight=720, bool transparentBG=false)
 Take a screenshot of the current viewpoint with a specific resolution More...
 
static void startVideo (string filePath, int resolutionWidth=1280, int resolutionHeight=720, int frameRate=30)
 Start to record a video with FFMPEG at a specific resolution and framerate More...
 
static void stopVideo ()
 Stop recording More...
 
static void undo ()
 Play the opposite function of the lastly called APIPython function recorded in UnityMolMain.pythonUndoCommands More...
 
static void saveHistoryScript (string path)
 Save the history of commands executed in a file More...
 
static void setRotationCenter (Vector3 newPos)
 
static void loadHistoryScript (string path)
 Load a python script of commands (possibly the output of the saveHistoryScript function) More...
 
static void setMolParentTransform (Vector3 pos, Vector3 scale, Vector3 rot, Vector3 centerOfRotation)
 Set the position, scale and rotation of the parent of all loaded molecules Linear interpolation between the current state of the camera to the specified values More...
 
static void changeGeneralScale (float newVal)
 Change the scale of the parent of the representations of each molecules Try to not move the center of mass More...
 
static void addHydrogensReduce (string structureName)
 Use Reduce method to add hydrogens More...
 
static void addHydrogensHaad (string structureName)
 Use HAAD method to add hydrogens More...
 
static void setAsLigand (string selName, bool isLig=true, bool updateAllSelections=true)
 Set the atoms of the selection named 'selName' to ligand More...
 
static void connectIMD (string structureName, string adress, int port)
 Connect to a running simulation using the IMD protocol implemented in Artemis The running simulation is binded to a UnityMolStructure More...
 
static void disconnectIMD (string structureName)
 Disconnect from the IMD simulation for the specified structure More...
 
static string getSurfaceType (string selName)
 
static string getHyperBallMetaphore (string selName)
 
static void setCameraNearPlane (float newV)
 
static void setCameraFarPlane (float newV)
 
static List< string > ls ()
 Print the content of the current directory More...
 
static void cd (string newPath)
 Change the current directory More...
 
static void pwd ()
 Print the current directory More...
 
static UnityMolStructure last ()
 Return the lastly loaded UnityMolStructure More...
 
static void bg_color (string colorS)
 Change the background color of the camera More...
 
static void switchRotateAxisX ()
 Switch on or off the rotation around the X axis of all loaded molecules More...
 
static void switchRotateAxisY ()
 Switch on or off the rotation around the Y axis of all loaded molecules More...
 
static void switchRotateAxisZ ()
 Switch on or off the rotation around the Z axis of all loaded molecules More...
 
static void changeRotationSpeedX (float val)
 Change the rotation speed around the X axis More...
 
static void changeRotationSpeedY (float val)
 Change the rotation speed around the Y axis More...
 
static void changeRotationSpeedZ (float val)
 Change the rotation speed around the Z axis More...
 
static void setMouseScrollSpeed (float val)
 Change the mouse scroll speed More...
 
static void setMouseMoveSpeed (float val)
 Change the speed of mouse rotations and translations More...
 
static void stopRotations ()
 Stop rotation around all axis More...
 
static RepType getRepType (string type)
 Transform a string of representation type to a RepType object More...
 
static string getTypeFromRepType (RepType rept)
 Transform a representation type into a string More...
 
static void annotateAtom (string structureName, int atomId)
 
static void removeAnnotationAtom (string structureName, int atomId)
 
static void annotateAtomText (string structureName, int atomId, string text)
 
static void removeAnnotationAtomText (string structureName, int atomId, string text)
 
static void annotateLine (string structureName, int atomId, string structureName2, int atomId2)
 
static void removeAnnotationLine (string structureName, int atomId, string structureName2, int atomId2)
 
static void annotateDistance (string structureName, int atomId, string structureName2, int atomId2)
 
static void removeAnnotationDistance (string structureName, int atomId, string structureName2, int atomId2)
 
static void annotateAngle (string structureName, int atomId, string structureName2, int atomId2, string structureName3, int atomId3)
 
static void removeAnnotationAngle (string structureName, int atomId, string structureName2, int atomId2, string structureName3, int atomId3)
 
static void annotateDihedralAngle (string structureName, int atomId, string structureName2, int atomId2, string structureName3, int atomId3, string structureName4, int atomId4)
 
static void removeAnnotationDihedralAngle (string structureName, int atomId, string structureName2, int atomId2, string structureName3, int atomId3, string structureName4, int atomId4)
 
static void annotateRotatingArrow (string structureName, int atomId, string structureName2, int atomId2)
 
static void removeAnnotationRotatingArrow (string structureName, int atomId, string structureName2, int atomId2)
 
static void annotateArcLine (string structureName, int atomId, string structureName2, int atomId2, string structureName3, int atomId3)
 
static void removeAnnotationArcLine (string structureName, int atomId, string structureName2, int atomId2, string structureName3, int atomId3)
 
static void annotateDrawLine (string structureName, List< Vector3 > line, Color col)
 
static void removeLastDrawLine (string structureName, int id)
 

Static Public Attributes

static string path
 

Member Function Documentation

◆ addHydrogensHaad()

static void UMol.API.APIPython.addHydrogensHaad ( string  structureName)
static

Use HAAD method to add hydrogens

◆ addHydrogensReduce()

static void UMol.API.APIPython.addHydrogensReduce ( string  structureName)
static

Use Reduce method to add hydrogens

◆ addSelectionKeyword()

static void UMol.API.APIPython.addSelectionKeyword ( string  keyword,
string  selName 
)
static

Add a keyword to the selection language

◆ addToSelection()

static void UMol.API.APIPython.addToSelection ( string  selMDA,
string  name = "selection",
bool  silent = false 
)
static

Look for an existing selection named 'name' and add atoms to it based on MDAnalysis selection language

◆ annotateAngle()

static void UMol.API.APIPython.annotateAngle ( string  structureName,
int  atomId,
string  structureName2,
int  atomId2,
string  structureName3,
int  atomId3 
)
static

◆ annotateArcLine()

static void UMol.API.APIPython.annotateArcLine ( string  structureName,
int  atomId,
string  structureName2,
int  atomId2,
string  structureName3,
int  atomId3 
)
static

◆ annotateAtom()

static void UMol.API.APIPython.annotateAtom ( string  structureName,
int  atomId 
)
static

◆ annotateAtomText()

static void UMol.API.APIPython.annotateAtomText ( string  structureName,
int  atomId,
string  text 
)
static

◆ annotateDihedralAngle()

static void UMol.API.APIPython.annotateDihedralAngle ( string  structureName,
int  atomId,
string  structureName2,
int  atomId2,
string  structureName3,
int  atomId3,
string  structureName4,
int  atomId4 
)
static

◆ annotateDistance()

static void UMol.API.APIPython.annotateDistance ( string  structureName,
int  atomId,
string  structureName2,
int  atomId2 
)
static

◆ annotateDrawLine()

static void UMol.API.APIPython.annotateDrawLine ( string  structureName,
List< Vector3 line,
Color  col 
)
static

◆ annotateLine()

static void UMol.API.APIPython.annotateLine ( string  structureName,
int  atomId,
string  structureName2,
int  atomId2 
)
static

◆ annotateRotatingArrow()

static void UMol.API.APIPython.annotateRotatingArrow ( string  structureName,
int  atomId,
string  structureName2,
int  atomId2 
)
static

◆ areRepresentationsOn() [1/2]

static bool UMol.API.APIPython.areRepresentationsOn ( string  structureName)
static

Utility function to test if a representation is shown for a specified structure

◆ areRepresentationsOn() [2/2]

static bool UMol.API.APIPython.areRepresentationsOn ( string  selName,
string  type 
)
static

Utility function to test if a representation of type 'type' is shown for a specified selection type can be "cartoon", "c", "surface", "s", "hb", "line", "l", "hbond"

◆ bg_color()

static void UMol.API.APIPython.bg_color ( string  colorS)
static

Change the background color of the camera

◆ cd()

static void UMol.API.APIPython.cd ( string  newPath)
static

Change the current directory

◆ centerOnSelection()

static void UMol.API.APIPython.centerOnSelection ( string  selName,
bool  lerp = false 
)
static

Offsets all representations to center the selection 'selName'

◆ centerOnStructure()

static void UMol.API.APIPython.centerOnStructure ( string  structureName,
bool  lerp = false 
)
static

Offsets all representations to center the structure 'structureName' Instead of moving the camera, move the loaded molecules to center them on the center of the camera

◆ changeGeneralScale()

static void UMol.API.APIPython.changeGeneralScale ( float  newVal)
static

Change the scale of the parent of the representations of each molecules Try to not move the center of mass

◆ changeHighlightMaterial()

static void UMol.API.APIPython.changeHighlightMaterial ( Material  newMat)
static

Utility function to change the material of highlighted selection

◆ changeRotationSpeedX()

static void UMol.API.APIPython.changeRotationSpeedX ( float  val)
static

Change the rotation speed around the X axis

◆ changeRotationSpeedY()

static void UMol.API.APIPython.changeRotationSpeedY ( float  val)
static

Change the rotation speed around the Y axis

◆ changeRotationSpeedZ()

static void UMol.API.APIPython.changeRotationSpeedZ ( float  val)
static

Change the rotation speed around the Z axis

◆ clearSelections()

static void UMol.API.APIPython.clearSelections ( )
static

Clear the currentSelection in UnityMolSelectionManager

◆ colorByAtom()

static void UMol.API.APIPython.colorByAtom ( string  selName,
string  type 
)
static

Color representations of type 'type' in the selection 'selName' by atom

◆ colorByChain()

static void UMol.API.APIPython.colorByChain ( string  selName,
string  type 
)
static

Use the color palette to color representations of type 'type' in the selection 'selName' by chain type can be "cartoon", "c", "surface", "s", "hb", "line", "l", "hbond"

◆ colorByCharge()

static void UMol.API.APIPython.colorByCharge ( string  selName,
bool  normalizeDensity = false,
float  minDens = -10.0f,
float  maxDens = 10.0f 
)
static

Use the dx map to color by charge around atoms Only works for surface for now If normalizeDensity is set to true, the density values will be normalized if it is set to true, the default -10|10 range is used

◆ colorByResidue()

static void UMol.API.APIPython.colorByResidue ( string  selName,
string  type 
)
static

Use the color palette to color representations of type 'type' in the selection 'selName' by residue type can be "cartoon", "c", "surface", "s", "hb", "line", "l", "hbond"

◆ colorSelection() [1/2]

static void UMol.API.APIPython.colorSelection ( string  selName,
string  type,
Color  col 
)
static

Change the color of all representation of type 'type' in selection type can be "cartoon", "c", "surface", "s", "hb", "line", "l", "hbond"

◆ colorSelection() [2/2]

static void UMol.API.APIPython.colorSelection ( string  selName,
string  type,
string  colorS 
)
static

Change the color of all representation of type 'type' in selection colorS can be "black", "white", "yellow", "green", "red", "blue", "pink", "gray" type can be "cartoon", "c", "surface", "s", "hb", "line", "l", "hbond"

◆ connectIMD()

static void UMol.API.APIPython.connectIMD ( string  structureName,
string  adress,
int  port 
)
static

Connect to a running simulation using the IMD protocol implemented in Artemis The running simulation is binded to a UnityMolStructure

◆ delete()

static void UMol.API.APIPython.delete ( string  structureName)
static

Delete a molecule and all its UnityMolSelection and UnityMolRepresentation

◆ deleteRepresentationInSelection()

static void UMol.API.APIPython.deleteRepresentationInSelection ( string  selName,
string  type 
)
static

Delete every representations of type 'type' of the specified selection type can be "cartoon", "c", "surface", "s", "hb", "line", "l", "hbond"

◆ deleteRepresentationsInSelection()

static void UMol.API.APIPython.deleteRepresentationsInSelection ( string  selName)
static

Delete every representations of the specified selection

◆ deleteSelection()

static void UMol.API.APIPython.deleteSelection ( string  selName)
static

Delete selection 'selName' and all its representations

◆ disconnectIMD()

static void UMol.API.APIPython.disconnectIMD ( string  structureName)
static

Disconnect from the IMD simulation for the specified structure

◆ duplicateSelection()

static string UMol.API.APIPython.duplicateSelection ( string  selName)
static

Duplicate selection 'selName' and without the representations

◆ ExecuteCommand()

static void UMol.API.APIPython.ExecuteCommand ( string  command)
static

Allow to call python API commands and record them in the history from C#

◆ fetch()

static UnityMolStructure UMol.API.APIPython.fetch ( string  PDBId,
bool  usemmCIF = true,
bool  readHetm = true 
)
static

Fetch a remote molecular file (pdb or mmcif zipped) This function calls showDefault() and centerOnStructure()

◆ getHyperBallMetaphore()

static string UMol.API.APIPython.getHyperBallMetaphore ( string  selName)
static

◆ getManipulationManager()

static ManipulationManager UMol.API.APIPython.getManipulationManager ( )
static

◆ getRepType()

static RepType UMol.API.APIPython.getRepType ( string  type)
static

Transform a string of representation type to a RepType object

◆ getStructureGroup()

static int UMol.API.APIPython.getStructureGroup ( string  structureName)
static

Utility function to be able to get the group of the structure This group is used to be able to move all the loaded molecules in the same group Groups can be between 0 and 9 included

◆ getStructuresOfGroup()

static HashSet<UnityMolStructure> UMol.API.APIPython.getStructuresOfGroup ( int  group)
static

Utility function to be able to get the structures of the group This group is used to be able to move all the loaded molecules in the same group Groups can be between 0 and 9 included

◆ getSurfaceType()

static string UMol.API.APIPython.getSurfaceType ( string  selName)
static

◆ getTypeFromRepType()

static string UMol.API.APIPython.getTypeFromRepType ( RepType  rept)
static

Transform a representation type into a string

◆ hide()

static void UMol.API.APIPython.hide ( string  type)
static

Hide all representations of type 'type' type can be "cartoon", "c", "surface", "s", "hb", "line", "l", "hbond"

◆ hideSelection() [1/2]

static void UMol.API.APIPython.hideSelection ( string  selName)
static

Hide every representations of the specified selection

◆ hideSelection() [2/2]

static void UMol.API.APIPython.hideSelection ( string  selName,
string  type 
)
static

Hide every representation of type 'type' of the specified selection type can be "cartoon", "c", "surface", "s", "hb", "line", "l", "hbond"

◆ hideStructureAllRepresentations()

static void UMol.API.APIPython.hideStructureAllRepresentations ( string  structureName)
static

Hide every representations of the specified structure

◆ isATrajectoryPlaying()

static bool UMol.API.APIPython.isATrajectoryPlaying ( )
static

Utility function to test if a trajectory is playing for any loaded molecule

◆ last()

static UnityMolStructure UMol.API.APIPython.last ( )
static

Return the lastly loaded UnityMolStructure

◆ load()

static UnityMolStructure UMol.API.APIPython.load ( string  filePath,
bool  readHetm = true 
)
static

Load a local molecular file (pdb/mmcif/gro/mol2/sdf/xyz formats)

◆ loadDXmap()

static void UMol.API.APIPython.loadDXmap ( string  structureName,
string  path 
)
static

Load a density map for a specific structure This function creates a DXReader instance in the UnityMolStructure

◆ loadHistoryScript()

static void UMol.API.APIPython.loadHistoryScript ( string  path)
static

Load a python script of commands (possibly the output of the saveHistoryScript function)

◆ loadTraj()

static void UMol.API.APIPython.loadTraj ( string  structureName,
string  path 
)
static

Load a trajectory for a loaded structure It creates a XDRFileReader in the corresponding UnityMolStructure and a TrajectoryPlayer

◆ ls()

static List<string> UMol.API.APIPython.ls ( )
static

Print the content of the current directory

◆ pwd()

static void UMol.API.APIPython.pwd ( )
static

Print the current directory

◆ readJSONFieldlines()

static void UMol.API.APIPython.readJSONFieldlines ( string  structureName,
string  path 
)
static

Read a json file and display fieldLines for the specified structure

◆ removeAnnotationAngle()

static void UMol.API.APIPython.removeAnnotationAngle ( string  structureName,
int  atomId,
string  structureName2,
int  atomId2,
string  structureName3,
int  atomId3 
)
static

◆ removeAnnotationArcLine()

static void UMol.API.APIPython.removeAnnotationArcLine ( string  structureName,
int  atomId,
string  structureName2,
int  atomId2,
string  structureName3,
int  atomId3 
)
static

◆ removeAnnotationAtom()

static void UMol.API.APIPython.removeAnnotationAtom ( string  structureName,
int  atomId 
)
static

◆ removeAnnotationAtomText()

static void UMol.API.APIPython.removeAnnotationAtomText ( string  structureName,
int  atomId,
string  text 
)
static

◆ removeAnnotationDihedralAngle()

static void UMol.API.APIPython.removeAnnotationDihedralAngle ( string  structureName,
int  atomId,
string  structureName2,
int  atomId2,
string  structureName3,
int  atomId3,
string  structureName4,
int  atomId4 
)
static

◆ removeAnnotationDistance()

static void UMol.API.APIPython.removeAnnotationDistance ( string  structureName,
int  atomId,
string  structureName2,
int  atomId2 
)
static

◆ removeAnnotationLine()

static void UMol.API.APIPython.removeAnnotationLine ( string  structureName,
int  atomId,
string  structureName2,
int  atomId2 
)
static

◆ removeAnnotationRotatingArrow()

static void UMol.API.APIPython.removeAnnotationRotatingArrow ( string  structureName,
int  atomId,
string  structureName2,
int  atomId2 
)
static

◆ removeFromSelection()

static void UMol.API.APIPython.removeFromSelection ( string  selMDA,
string  name = "selection",
bool  silent = false 
)
static

Look for an existing selection named 'name' and remove atoms from it based on MDAnalysis selection language

◆ removeLastDrawLine()

static void UMol.API.APIPython.removeLastDrawLine ( string  structureName,
int  id 
)
static

◆ removeSelectionKeyword()

static void UMol.API.APIPython.removeSelectionKeyword ( string  keyword)
static

Remove a keyword from the selection language

◆ renameSelection()

static bool UMol.API.APIPython.renameSelection ( string  oldSelName,
string  newSelName 
)
static

Change the 'oldSelName' selection name into 'newSelName'

◆ resetColorSelection()

static void UMol.API.APIPython.resetColorSelection ( string  selName,
string  type 
)
static

Reset the color of all representation of type 'type' in selection to the default value type can be "cartoon", "c", "surface", "s", "hb", "line", "l", "hbond"

◆ saveHistoryScript()

static void UMol.API.APIPython.saveHistoryScript ( string  path)
static

Save the history of commands executed in a file

◆ screenshot()

static void UMol.API.APIPython.screenshot ( string  path,
int  resolutionWidth = 1280,
int  resolutionHeight = 720,
bool  transparentBG = false 
)
static

Take a screenshot of the current viewpoint with a specific resolution

◆ select()

static UnityMolSelection UMol.API.APIPython.select ( string  selMDA,
string  name = "selection",
bool  createSelection = true,
bool  addToExisting = false,
bool  silent = false,
bool  setAsCurrentSelection = true,
bool  forceCreate = false 
)
static

Create a UnityMolSelection based on MDAnalysis selection language (https://www.mdanalysis.org/docs/documentation_pages/selections.html) Returns a UnityMolSelection object, adding it to the selection manager if createSelection is true If a selection with the same name already exists and addToExisting is true, add atoms to the already existing selection Set forceCreate to true if the selection is empty but still need to generate the selection

◆ selectInSphere()

static UnityMolSelection UMol.API.APIPython.selectInSphere ( Vector3  position,
float  radius 
)
static

Select atoms of all loaded molecules inside a sphere defined by a world space position and a radius in Anstrom

◆ setAsLigand()

static void UMol.API.APIPython.setAsLigand ( string  selName,
bool  isLig = true,
bool  updateAllSelections = true 
)
static

Set the atoms of the selection named 'selName' to ligand

◆ setCameraFarPlane()

static void UMol.API.APIPython.setCameraFarPlane ( float  newV)
static

◆ setCameraNearPlane()

static void UMol.API.APIPython.setCameraNearPlane ( float  newV)
static

◆ setCartoonColorSS()

static void UMol.API.APIPython.setCartoonColorSS ( string  selName,
string  ssType,
Color  col 
)
static

Set the color of the cartoon representation of the specified selection based on the nature of secondary structure assigned ssType can be "helix", "sheet" or "coil"

◆ setCurrentSelection()

static void UMol.API.APIPython.setCurrentSelection ( string  selName)
static

Set the selection as currentSelection in the UnityMolSelectionManager

◆ setHyperBallMetaphore()

static void UMol.API.APIPython.setHyperBallMetaphore ( string  selName,
string  metaphore 
)
static

Change hyperball representation parameters in the specified selection to a preset Metaphores can be "Smooth", "Balls&Sticks", "VdW", "Licorice"

◆ setHyperBallShininess()

static void UMol.API.APIPython.setHyperBallShininess ( string  selName,
float  shin 
)
static

Set shininess for the hyperball representations of the specified selection

◆ setHyperballShrink()

static void UMol.API.APIPython.setHyperballShrink ( string  selName,
float  shrink 
)
static

Set the shrink factor for the hyperball representations of the specified selection

◆ setHyperballTexture()

static void UMol.API.APIPython.setHyperballTexture ( string  selName,
int  idTex 
)
static

Change all hyperball representation in the selection with a new texture mapped idTex of the texture is the index in UnityMolMain.atomColors.textures

◆ setLineSize()

static void UMol.API.APIPython.setLineSize ( string  selName,
float  val 
)
static

◆ setMetal()

static void UMol.API.APIPython.setMetal ( string  selName,
string  type,
float  val 
)
static

Change hyperball representation parameters in the specified selection to a preset Metaphores can be "Smooth", "Balls&Sticks", "VdW", "Licorice" type can be "cartoon", "c", "surface", "s", "hb", "line", "l", "hbond"

◆ setModel()

static void UMol.API.APIPython.setModel ( string  structureName,
int  modelId 
)
static

Set the current model of the structure This function is used by ModelPlayers.cs to read the models of a structure like a trajectory

◆ setMolParentTransform()

static void UMol.API.APIPython.setMolParentTransform ( Vector3  pos,
Vector3  scale,
Vector3  rot,
Vector3  centerOfRotation 
)
static

Set the position, scale and rotation of the parent of all loaded molecules Linear interpolation between the current state of the camera to the specified values

◆ setMouseMoveSpeed()

static void UMol.API.APIPython.setMouseMoveSpeed ( float  val)
static

Change the speed of mouse rotations and translations

◆ setMouseScrollSpeed()

static void UMol.API.APIPython.setMouseScrollSpeed ( float  val)
static

Change the mouse scroll speed

◆ setPosScaleRot()

void UMol.API.APIPython.setPosScaleRot ( Vector3  pos,
Vector3  scale,
Vector3  rot,
Vector3  centerOfRotation 
)

◆ setRepSize()

static void UMol.API.APIPython.setRepSize ( string  selName,
string  type,
float  size 
)
static

Change the size of the representation of type 'type' in the selection Mainly used for hyperball representation type can be "cartoon", "c", "surface", "s", "hb", "line", "l", "hbond"

◆ setRotationCenter()

static void UMol.API.APIPython.setRotationCenter ( Vector3  newPos)
static

◆ setSmoothness()

static void UMol.API.APIPython.setSmoothness ( string  selName,
string  type,
float  val 
)
static

Change hyperball representation parameters in the specified selection to a preset Metaphores can be "Smooth", "Balls&Sticks", "VdW", "Licorice" type can be "cartoon", "c", "surface", "s", "hb", "line", "l", "hbond"

◆ setSolidSurface()

static void UMol.API.APIPython.setSolidSurface ( string  selName)
static

Switch all surface representation in selection to a solid surface material

◆ setStructureGroup()

static void UMol.API.APIPython.setStructureGroup ( string  structureName,
int  newGroup 
)
static

Utility function to be set the group of a structure This group is used to be able to move all the loaded molecules in the same group Groups can be between 0 and 9 included

◆ setTransparentSurface()

static void UMol.API.APIPython.setTransparentSurface ( string  selName,
float  alpha = 0.8f 
)
static

Switch all surface representation in selection to a transparent surface material

◆ setWireframeSurface()

static void UMol.API.APIPython.setWireframeSurface ( string  selName)
static

Switch all surface representation in selection to a wireframe surface material when available

◆ show()

static void UMol.API.APIPython.show ( string  type)
static

Show as 'type' all loaded molecules type can be "cartoon", "c", "surface", "s", "hb", "line", "l", "hbond"

◆ showDefault()

static void UMol.API.APIPython.showDefault ( string  selName)
static

Create default representations (cartoon for protein + HB for not protein atoms)

◆ showHideBackboneInSelection()

static void UMol.API.APIPython.showHideBackboneInSelection ( string  selName)
static

Show/Hide backbone in representations of the current selection This only works for lines, hyperball and sphere representations only

◆ showHideHydrogensInSelection()

static void UMol.API.APIPython.showHideHydrogensInSelection ( string  selName,
bool?  shouldShow = null 
)
static

Show/Hide hydrogens in representations of the provided selection This only works for lines, hyperball and sphere representations

◆ showHideSideChainsInSelection()

static void UMol.API.APIPython.showHideSideChainsInSelection ( string  selName)
static

Show/Hide side chains in representations of the current selection This only works for lines, hyperball and sphere representations only

◆ showSelection()

static void UMol.API.APIPython.showSelection ( string  selName,
string  type,
params object []  args 
)
static

Show the selection as 'type' type can be "cartoon", "c", "surface", "s", "hb", "line", "l", "hbond" If the representation is already there, update it if the selection content changed and show it

◆ showStructureAllRepresentations()

static void UMol.API.APIPython.showStructureAllRepresentations ( string  structureName)
static

Unhide all representations already created for a specified structure

◆ startVideo()

static void UMol.API.APIPython.startVideo ( string  filePath,
int  resolutionWidth = 1280,
int  resolutionHeight = 720,
int  frameRate = 30 
)
static

Start to record a video with FFMPEG at a specific resolution and framerate

◆ stopRotations()

static void UMol.API.APIPython.stopRotations ( )
static

Stop rotation around all axis

◆ stopVideo()

static void UMol.API.APIPython.stopVideo ( )
static

Stop recording

◆ switchCutSurface()

static void UMol.API.APIPython.switchCutSurface ( string  selName,
bool  isCut 
)
static

Switch between cut surface mode and no-cut surface mode

◆ switchRotateAxisX()

static void UMol.API.APIPython.switchRotateAxisX ( )
static

Switch on or off the rotation around the X axis of all loaded molecules

◆ switchRotateAxisY()

static void UMol.API.APIPython.switchRotateAxisY ( )
static

Switch on or off the rotation around the Y axis of all loaded molecules

◆ switchRotateAxisZ()

static void UMol.API.APIPython.switchRotateAxisZ ( )
static

Switch on or off the rotation around the Z axis of all loaded molecules

◆ switchSurfaceComputeMethod()

static void UMol.API.APIPython.switchSurfaceComputeMethod ( string  selName)
static

Switch between the 2 types of surface computation methods: EDTSurf and MSMS

◆ undo()

static void UMol.API.APIPython.undo ( )
static

Play the opposite function of the lastly called APIPython function recorded in UnityMolMain.pythonUndoCommands

◆ unloadDXmap()

static void UMol.API.APIPython.unloadDXmap ( string  structureName)
static

Unload the density map for the structure

◆ unloadJSONFieldlines()

static void UMol.API.APIPython.unloadJSONFieldlines ( string  structureName)
static

Remove the json file for fieldlines stored in the currentModel of the specified structure

◆ unloadTraj()

static void UMol.API.APIPython.unloadTraj ( string  structureName)
static

Unload a trajectory for a specific structure

◆ updateRepresentations()

static void UMol.API.APIPython.updateRepresentations ( string  selName)
static

Update representations of the specified selection

◆ updateSelectionWithMDA()

static bool UMol.API.APIPython.updateSelectionWithMDA ( string  selName,
string  selectionString,
bool  forceAlteration,
bool  silent = false 
)
static

Update the atoms of the selection based on a new MDAnalysis language selection The selection only applies to the structures of the selection

◆ waitOf()

IEnumerator UMol.API.APIPython.waitOf ( )

◆ waitOneFrame()

static void UMol.API.APIPython.waitOneFrame ( )
static

Member Data Documentation

◆ path

string UMol.API.APIPython.path
static

The documentation for this class was generated from the following file: