Class

MoorhenMolecule

MoorhenMolecule(commandCentre, glRef, storeopt, monomerLibraryPathopt)

Represents a molecule
Constructor

# new MoorhenMolecule(commandCentre, glRef, storeopt, monomerLibraryPathopt)

Parameters:
Name Type Attributes Default Description
commandCentre React.RefObject.<moorhen.CommandCentre> A react reference to the command centre instance
glRef React.RefObject.<webGL.MGWebGL> A react reference to the MGWebGL instance
store ToolkitStore <optional>
A Redux store. By default Moorhen Redux store will be used
monomerLibraryPath string <optional>
"./baby-gru/monomers" A string with the path to the monomer library, relative to the root of the app
Properties:
Name Type Description
name string The name assigned to this molecule instance
molNo number The imol assigned to this molecule instance
atomsDirty boolean Whether the cached atoms are outdated
symmetryOn boolean Whether the symmetry is currently being displayed
sequences object List of sequences present in the molecule
gemmiStructure object Object representation of the cached gemmi structure for this molecule
commandCentre React.RefObject.<moorhen.CommandCentre> A react reference to the command centre instance
glRef React.RefObject.<webGL.MGWebGL> A react reference to the MGWebGL instance
monomerLibraryPath string A string with the path to the monomer library, relative to the root of the app

View Source utils/MoorhenMolecule.ts, line 48

Example
import { MoorhenMolecule } from 'moorhen';

// Create a new molecule
const molecule = new MoorhenMolecule(commandCentre, glRef, monomerLibraryPath);

// Set some defaults
molecule.setBackgroundColour(glRef.current.background_colour)

// Load file from a URL
molecule.loadToCootFromURL('/uri/to/file.pdb', 'mol-1');

// Draw coot bond representation and centre on molecule
molecule.fetchIfDirtyAndDraw('CBs');
molecule.centreOn();

// Delete molecule
molecule.delete();

Classes

MoorhenMolecule

Methods

# async SSMSuperpose(movChainId, refMolNo, refChainId, redrawopt) → {Promise.<void>}

Use SSM to superpose this molecule (as the moving structure) with another molecule isntance
Parameters:
Name Type Attributes Default Description
movChainId string Chain ID for the moving structure
refMolNo string Molecule number for the reference structure
refChainId string Chain ID for the reference structure
redraw boolean <optional>
true Indicates if the molecule should be redrawn

View Source utils/MoorhenMolecule.ts, line 2955

Promise.<void>

# async addDict(fileContent) → {Promise.<void>}

Associate ligand dictionary with this molecule instance
Parameters:
Name Type Description
fileContent string The dictionary contents

View Source utils/MoorhenMolecule.ts, line 2810

Promise.<void>

# async addLigandOfType(resType, fromMolNoopt) → {Promise.<moorhen.WorkerResponse>}

Add a ligand of a given type to this molecule isntance
Parameters:
Name Type Attributes Default Description
resType string Three letter code for the ligand of interest
fromMolNo number <optional>
-999999 Indicate the molecule number to which the ligand dictionary was associated (use -999999 for "any")

View Source utils/MoorhenMolecule.ts, line 2788

Promise.<moorhen.WorkerResponse>

# async addRepresentation(style, cid, isCustomopt, colourRulesopt, bondOptionsopt, m2tParamsopt)

Add a representation to the molecule
Parameters:
Name Type Attributes Default Description
style string The style of the new representation
cid string The CID selection for the residues included in the new representation
isCustom boolean <optional>
false Indicates if the representation is considered "custom"
colourRules Array.<moorhen.ColourRule> <optional>
A list of colour rules that will be applied to the new representation
bondOptions moorhen.cootBondOptions <optional>
An object that describes bond width, atom/bond ratio and other bond settings.
m2tParams moorhen.m2tParameters <optional>
An object that describes ribbon width, nucleotide style and other ribbon settings.

View Source utils/MoorhenMolecule.ts, line 2644

# async animateRefine(n_cyc, n_iteration, final_n_cycopt)

Refine a molecule with animation effect
Parameters:
Name Type Attributes Default Description
n_cyc number The total number of refinement cycles for each iteration
n_iteration number The number of iterations
final_n_cyc number <optional>
100 Number of refinement cycles in the last iteration

View Source utils/MoorhenMolecule.ts, line 2935

# applyTransform()

Apply cached transformation matrix to molecule

View Source utils/MoorhenMolecule.ts, line 2764

# buffersInclude(bufferIn) → {boolean}

Check whether a particular buffer is included within the representation buffer for this molecule
Parameters:
Name Type Description
bufferIn The buffer with the ID to search for

View Source utils/MoorhenMolecule.ts, line 2685

True if the buffer is included in this molecule
boolean

# cacheLigandDict(fileContent) → {void}

Internal function used to store a ligand dictionary in the cache for this molecule instance
Parameters:
Name Type Description
fileContent string The dictionary contents

View Source utils/MoorhenMolecule.ts, line 2802

void

# async centreAndAlignViewOn(selectionCid, alignWithCBopt, zoomLevelopt) → {Promise.<void>}

Centre the view and align it with the axis of a particular residue
Parameters:
Name Type Attributes Default Description
selectionCid string CID selection for the residue to centre the view on
alignWithCB boolean <optional>
false Indicates whether to align with the CB atom for better view of the side chain (when present in the residue)
zoomLevel number <optional>
0.3 Indicates the zoom level to use

View Source utils/MoorhenMolecule.ts, line 2613

Promise.<void>

# async centreOn(selectionCid, animateopt) → {Promise.<void>}

Centre the view on a particular residue
Parameters:
Name Type Attributes Default Description
selectionCid string CID selection for the residue to centre the view on
animate boolean <optional>
true Indicates whether the change will be animated

View Source utils/MoorhenMolecule.ts, line 2622

Promise.<void>

# async changeChainId(oldId, newId, startResNo, endResNo) → {number}

Change the ID of a given chain
Parameters:
Name Type Description
oldId string The old chain ID
newId string The new chain ID
startResNo number The start residue number
endResNo number The end residue number

View Source utils/MoorhenMolecule.ts, line 3076

- Status code -1 on a conflict, 1 on good, 0 on did nothing
number

# async checkHasGlycans() → {Promise.<boolean>}

Check if the current molecule has glycans

View Source utils/MoorhenMolecule.ts, line 2582

- True if the current molecule has glycans
Promise.<boolean>

# checkIsLigand() → {boolean}

Check if the molecule instance consists of a ligand

View Source utils/MoorhenMolecule.ts, line 2439

True if the molecule is a ligand
boolean

# clearBuffersOfStyle(style)

Clears the representation buffers for a particular style
Parameters:
Name Type Description
style string The style to clear

View Source utils/MoorhenMolecule.ts, line 2672

# clearExtraRestraints() → {Promise.<moorhen.WorkerResponse>}

Clear all additional restraints

View Source utils/MoorhenMolecule.ts, line 2892

Promise.<moorhen.WorkerResponse>

# async copyFragmentForRefinement(cid, refinementMap, redraw, redrawFragmentFirst) → {moorhen.Molecule}

Copy a fragment of the current model into a new molecule for refinement
Parameters:
Name Type Description
cid Array.<string> The CID selection indicating the residues that will be copied into the new fragment
refinementMap moorhen.Map The map instance used in the refinement
redraw boolean Indicate if the molecules should be redrawn
redrawFragmentFirst boolean Indicate if the fragment should be redrawn first

View Source utils/MoorhenMolecule.ts, line 2492

A new molecule instance that can be used for refinement
moorhen.Molecule

# async copyFragmentUsingCid(cid, doRecentreopt, styleopt) → {Promise.<moorhen.Molecule>}

Copy a fragment of the current model into a new molecule using a selection CID
Parameters:
Name Type Attributes Default Description
cid string The CID selection indicating the residues that will be copied into the new fragment
doRecentre boolean <optional>
true Indicates whether the view should re-centre on the new copied fragment
style boolean <optional>
"CBs" Indicates the style used to draw the copied fragment (only takes effect if doRecentre=true)

View Source utils/MoorhenMolecule.ts, line 2481

New molecule instance
Promise.<moorhen.Molecule>

# async copyMolecule(doRedraw) → {moorhen.Molecule}

Copy molecule into a new instance
Parameters:
Name Type Description
doRedraw boolean

View Source utils/MoorhenMolecule.ts, line 2471

New molecule instance
moorhen.Molecule

# async delete(popBackImolopt) → {Promise.<moorhen.WorkerResponse>}

Delete this molecule instance
Parameters:
Name Type Attributes Default Description
popBackImol boolean <optional>
false Indicates whether the imol for this molecule instance should be popped back (useful for ephemeral molecules)

View Source utils/MoorhenMolecule.ts, line 2447

Promise.<moorhen.WorkerResponse>

# async deleteCid(cid, redrawopt) → {object}

Delete residues in a given CID
Parameters:
Name Type Attributes Default Description
cid string The CID to delete
redraw boolean <optional>
true Indicates if the molecule should be redrawn

View Source utils/MoorhenMolecule.ts, line 2944

- A pair where first is the return status and second is the atom count of the molecule after deletion
object

# async downloadAtoms(formatopt)

Download the PDB file contents of the molecule in its current state
Parameters:
Name Type Attributes Default Description
format string <optional>
'pdb' File format will match the one of the original file unless specified here

View Source utils/MoorhenMolecule.ts, line 2575

# drawBiomolecule(fetchSymMatrixopt) → {void}

Draw symmetry mates for the current molecule
Parameters:
Name Type Attributes Default Description
fetchSymMatrix boolean <optional>
true Indicates whether a new symmetry matrix must be fetched from libcoot api

View Source utils/MoorhenMolecule.ts, line 2388

void

# async drawEnvironment(selectionCid) → {Promise.<void>}

Draw enviroment distances for a given residue
Parameters:
Name Type Description
selectionCid string The CID selection to draw the environment

View Source utils/MoorhenMolecule.ts, line 2737

Promise.<void>

# async drawHover(selectionString) → {Promise.<void>}

Draw a hover effect over a selected residue
Parameters:
Name Type Description
selectionString string The CID selection for the residue that will be highlighted

View Source utils/MoorhenMolecule.ts, line 2699

Promise.<void>

# async drawResidueSelection(selectionString) → {Promise.<void>}

Highlight residues in a selected CID range
Parameters:
Name Type Description
selectionString string The CID selection for the residues that will be highlighted

View Source utils/MoorhenMolecule.ts, line 2707

Promise.<void>

# async drawSymmetry(fetchSymMatrixopt) → {Promise.<void>}

Draw symmetry mates for the current molecule
Parameters:
Name Type Attributes Default Description
fetchSymMatrix boolean <optional>
true Indicates whether a new symmetry matrix must be fetched from libcoot api

View Source utils/MoorhenMolecule.ts, line 2396

Promise.<void>

# async drawUnitCell()

Draw the unit cell of this molecule

View Source utils/MoorhenMolecule.ts, line 2691

# async drawWithStyleFromMesh(style, meshObjects, cidopt) → {Promise.<void>}

Draw molecule from a given mesh
Parameters:
Name Type Attributes Description
style string Indicate the style to be drawn
meshObjects Array.<any> The mesh obects that will be drawn
cid string <optional>
The new buffer CID selection

View Source utils/MoorhenMolecule.ts, line 2632

Promise.<void>

# async exportAsGltf(representationId) → {ArrayBuffer}

Export the current molecule as a gltf file in binary format
Parameters:
Name Type Description
representationId string The id of the representation to export

View Source utils/MoorhenMolecule.ts, line 3048

- The contents of the gltf file in binary format
ArrayBuffer

# fetchBiomoleculeMatrix() → {void}

Fetch the matrices representing the biomolecule of the current model from gemmi

View Source utils/MoorhenMolecule.ts, line 2374

void

# async fetchDefaultColourRules()

Set the default colour rules for this molecule from libcoot API

View Source utils/MoorhenMolecule.ts, line 2852

# async fetchHeaderInfo(useCache) → {Promise.<libcootApi.headerInfoJS>}

Fetch header information for this molecule instance
Parameters:
Name Type Description
useCache boolean Whether to use the cached results or not

View Source utils/MoorhenMolecule.ts, line 3105

Object containing header information
Promise.<libcootApi.headerInfoJS>

# async fetchIfDirtyAndDraw(style) → {Promise.<void>}

Draw the molecule with a particular style. If the molecule atoms are marked as "dirty" then fetch new atoms.
Parameters:
Name Type Description
style string The style that will be drawn

View Source utils/MoorhenMolecule.ts, line 2603

Promise.<void>

# async fetchSymmetryMatrix() → {Promise.<void>}

Fetch the symmetry matrix for the current model from libcoot api

View Source utils/MoorhenMolecule.ts, line 2381

Promise.<void>

# async fitLigand(mapMolNo, ligandMolNo, fitRightHereopt, redrawopt, useConformersopt, conformerCountopt) → {Promise.<Array.<moorhen.Molecule>>}

A function to fit a given ligand
Parameters:
Name Type Attributes Default Description
mapMolNo number The map iMol that will be used for ligand fitting
ligandMolNo number The ligand iMol that will be fitted
fitRightHere boolean <optional>
true Indicates if the ligand should be fitted at the current origin
redraw boolean <optional>
false Indicates if the fitted ligands should be drawn
useConformers boolean <optional>
false Indicates if there is need to test multiple conformers
conformerCount number <optional>
0 Conformer count

View Source utils/MoorhenMolecule.ts, line 2979

- A list of fitted ligands
Promise.<Array.<moorhen.Molecule>>

# async gemmiAtomsForCid(cid) → {Promise.<Array.<moorhen.AtomInfo>>}

Get atom information for a given CID selection
Parameters:
Name Type Description
cid string The CID selection

View Source utils/MoorhenMolecule.ts, line 2839

JS objects containing atom information
Promise.<Array.<moorhen.AtomInfo>>

# async generateSelfRestraints(cidopt, maxRadiusopt) → {Promise.<void>}

Generate self restraints
Parameters:
Name Type Attributes Default Description
cid string <optional>
"//" The CID for local restraints
maxRadius number <optional>
4.2 The maximum radius for the restraints

View Source utils/MoorhenMolecule.ts, line 2886

Promise.<void>

# async getActiveAtom() → {string}

Get the active atom for this molecule

View Source utils/MoorhenMolecule.ts, line 2714

The active atom CID
string

# async getAtoms(formatopt) → {string}

Get a string with the PDB file contents of the molecule in its current state
Parameters:
Name Type Attributes Default Description
format string <optional>
'pdb' File format will match the one of the original file unless specified here

View Source utils/MoorhenMolecule.ts, line 2568

A string representation file contents
string

# getChainNames() → {Array.<string>}

Get a list with the names of the chains in the current model

View Source utils/MoorhenMolecule.ts, line 2770

- A list of chain names in the current structure
Array.<string>

# getDict(comp_id) → {string}

Get dictionary for a ligand associated with this molecule
Parameters:
Name Type Description
comp_id string Three letter code for the ligand of interest

View Source utils/MoorhenMolecule.ts, line 2795

The ligand dictionary
string

# async getLigandSVG(resName, useCache) → {Promise.<Array.<string>>}

Get SVG descriptions for the ligands in this molecule instance
Parameters:
Name Type Description
resName string The name of the ligand to get SVG descriptions for
useCache boolean Whether to use the cached results or not

View Source utils/MoorhenMolecule.ts, line 3065

A list of SVG descriptions for the ligands in this molecule instance
Promise.<Array.<string>>

# async getMoleculeDiameter() → {number}

Get the diameter of this molecule

View Source utils/MoorhenMolecule.ts, line 2589

The molecule diameter
number

# async getNcsRelatedChains() → {Array.<Array.<string>>}

Get chain IDs that are related by NCS or molecular symmetry

View Source utils/MoorhenMolecule.ts, line 2992

An array of arrays where chain IDs are grouped together
Array.<Array.<string>>

# async getNeighborResiduesCids(selectionCid, radius, minDist, maxDist) → {Promise.<Array.<string>>}

Get the CIDs for all residues wihtin a distance threshold of a set of residues
Parameters:
Name Type Description
selectionCid string The CID indicating the selection of residues used for the search
radius number The radius used in the search
minDist number Minimum distance for the serch
maxDist number Maximum distance for the search

View Source utils/MoorhenMolecule.ts, line 2427

List of CIDs with the residues found within the radius of search
Promise.<Array.<string>>

# getNonSelectedCids(cid) → {Array.<string>}

Get the CIDs of residues not included in the input CID
Parameters:
Name Type Description
cid string The input CID selection

View Source utils/MoorhenMolecule.ts, line 3032

An array of CIDs for the residue ranges not included in the input CID
Array.<string>

# async getNumberOfAtoms() → {Promise.<number>}

A function to get the number of atoms in the current molecule

View Source utils/MoorhenMolecule.ts, line 2999

The number of atoms in the molecule
Promise.<number>

# async getPrivateerValidation(useCache) → {Promise.<Array.<privateer.ResultsEntry>>}

Get results of privateer validation for this molecule instance
Parameters:
Name Type Description
useCache boolean Whether to use the cached results or not

View Source utils/MoorhenMolecule.ts, line 3056

A list of results from privateer validation
Promise.<Array.<privateer.ResultsEntry>>

# getResidueBFactors() → {Array.<object>}

Get information about the residue B-factors

View Source utils/MoorhenMolecule.ts, line 2985

An array of objects indicating the residue CID and B-factor
Array.<object>

# async getSecondaryStructInfo(modelNumber) → {Array.<object>}

Get the secondary structure information for the residues in the current molecule
Parameters:
Name Type Description
modelNumber number The model number to extract secondary structure information from

View Source utils/MoorhenMolecule.ts, line 3040

An array of objects containing the secondary structure information for each residue
Array.<object>

# getUnitCellParams()

Get the unit cell parameters for the molecule

View Source utils/MoorhenMolecule.ts, line 2416

An object with the unit cell parameters

# hide(style, cidopt)

Hide a type of representation for the molecule
Parameters:
Name Type Attributes Description
style string The representation style to hide
cid string <optional>
The CID selection for the representation

View Source utils/MoorhenMolecule.ts, line 2666

# async hideCid(cid, redrawopt) → {Promise.<void>}

Hide representations for a given CID selection
Parameters:
Name Type Attributes Default Description
cid string The CID selection
redraw boolean <optional>
true Indicates if the molecule should be redrawn

View Source utils/MoorhenMolecule.ts, line 2861

Promise.<void>

# async isValidSelection(cid) → {boolean}

Test whether an atom selection is valid
Parameters:
Name Type Description
cid string The CID selection

View Source utils/MoorhenMolecule.ts, line 3025

Whether the selection is valid
boolean

# isVisible(excludeStyles) → {boolean}

Determine whether this molecule instance has any visible buffers
Parameters:
Name Type Description
excludeStyles Array.<string> A list of representation styles that should be excluded from this check

View Source utils/MoorhenMolecule.ts, line 2846

True if the molecule has any visible buffers
boolean

# async loadMissingMonomer(newTlc, attachToMolecule) → {Promise.<string>}

Load a the missing dictionary for a monomer. First attempts to load it from the monomer library, if it fails it will load from the EBI.
Parameters:
Name Type Description
newTlc string Three letter code for the monomer
attachToMolecule number Molecule number for which the dicitonary will be associated

View Source utils/MoorhenMolecule.ts, line 2545

Promise.<string>

# async loadMissingMonomers() → {Promise.<moorhen.Molecule>}

Attempt to load dictionaries for all missing monomers present in the molecule

View Source utils/MoorhenMolecule.ts, line 2552

This molecule instance
Promise.<moorhen.Molecule>

# async loadToCootFromFile(source) → {Promise.<moorhen.Molecule>}

Load a new molecule from the contents of a file
Parameters:
Name Type Description
source File The input file

View Source utils/MoorhenMolecule.ts, line 2520

The new molecule
Promise.<moorhen.Molecule>

# async loadToCootFromString(coordData, name) → {Promise.<moorhen.Molecule>}

Load a new molecule from a string
Parameters:
Name Type Description
coordData string The molecule data
name string The new molecule name

View Source utils/MoorhenMolecule.ts, line 2536

The new molecule
Promise.<moorhen.Molecule>

# async loadToCootFromURL(url, molName, optionsopt) → {Promise.<moorhen.Molecule>}

Load a new molecule from a file URL
Parameters:
Name Type Attributes Description
url string The url to the path with the data for the new molecule
molName string The new molecule name
options object <optional>
Options passed to fetch API

View Source utils/MoorhenMolecule.ts, line 2512

The new molecule
Promise.<moorhen.Molecule>

# async lsqkbSuperpose(refMolNo, residueMatches, matchTypeopt, redrawopt) → {Promise.<void>}

Use LSQKB to superpose this molecule (as the moving structure) with another molecule isntance
Parameters:
Name Type Attributes Default Description
refMolNo string Molecule number for the reference structure
residueMatches Array.<moorhen.lskqbResidueRangeMatch> A list of objects describing the residue matches for LSQKB
matchType number <optional>
1 The match type for LSQKB: 0 - all | 1 - main | 2 - CAs
redraw boolean <optional>
true Indicates if the molecule should be redrawn

View Source utils/MoorhenMolecule.ts, line 2966

Promise.<void>

# async mergeFragmentFromRefinement(cid, fragmentMolecule, acceptTransformopt, refineAfterMergeopt)

Merge a fragment that was used for refinement into the current molecule
Parameters:
Name Type Attributes Default Description
cid Array.<string> The CID selection used to create the fragment
fragmentMolecule moorhen.Molecule The fragment molecule
acceptTransform boolean <optional>
true Indicates whether the transformation should be accepted
refineAfterMerge boolean <optional>
false Indicates whether another cycle of refinement should be run after merging the fragment

View Source utils/MoorhenMolecule.ts, line 2502

# async mergeMolecules(otherMolecules, doHideopt) → {Promise.<void>}

Merge a set of molecules in this molecule instance
Parameters:
Name Type Attributes Default Description
otherMolecules moorhen.Molecule A list of other molecules to merge into this instance
doHide boolean <optional>
false Indicates whether the source molecules should be hidden when finish

View Source utils/MoorhenMolecule.ts, line 2779

Promise.<void>

# async minimizeEnergyUsingCidAnimated(cid, ncyc, nIterations, useRamaRestraints, ramaWeight, useTorsionRestraints, torsionWeight)

Minimize the energy of a given set of residues (usually a ligand)
Parameters:
Name Type Description
cid The CID for the input residues
ncyc The number of cycles
nIterations The number of iterations
useRamaRestraints Indicates whether ramachandran restraints should be used
ramaWeight Indicates the weight assigned to ramachandran restraints
useTorsionRestraints Indicates whether torsion restraints should be used
torsionWeight Indicates the weight assigned to torsion restraints

View Source utils/MoorhenMolecule.ts, line 3097

# async moveMoleculeHere(x, y, z) → {Promise.<void>}

Move the molecule to a new position
Parameters:
Name Type Description
x number Coordinate X
y number Coordinate Y
z number Coordinate Z

View Source utils/MoorhenMolecule.ts, line 3009

Promise.<void>

# async parseCidIntoSelection(cid) → {object}

Parse a CID selection into a residue selection object
Parameters:
Name Type Description
cid string The CID selection

View Source utils/MoorhenMolecule.ts, line 3017

An object for the residue selection
object

# parseSequences() → {void}

Parse the sequences in the molecule

View Source utils/MoorhenMolecule.ts, line 2433

void

# async redo() → {Promise.<void>}

Redo last action performed on this molecule

View Source utils/MoorhenMolecule.ts, line 2824

Promise.<void>

# async redraw() → {Promise.<void>}

Redraw the molecule representations

View Source utils/MoorhenMolecule.ts, line 2744

Promise.<void>

# async redrawAdaptativeBonds(selectionString) → {Promise.<void>}

Draw bonds for a given glRef origin
Parameters:
Name Type Description
selectionString string The CID selection for the residues that will be highlighted

View Source utils/MoorhenMolecule.ts, line 2729

Promise.<void>

# async redrawRepresentation(id)

Redraw a molecule representation
Parameters:
Name Type Description
id string Unique identifier for the representation of interest

View Source utils/MoorhenMolecule.ts, line 2651

# async refineResidueRange(chainId, start, stop, ncycopt, redrawopt) → {Promise.<void>}

Refine a residue range
Parameters:
Name Type Attributes Default Description
chainId string The chain ID for the residue range
start string First residue number in the range
stop string Last residue number in the range
ncyc number <optional>
4000 Number of refinement cycles
redraw boolean <optional>
true Indicates if the molecule should be redrawn

View Source utils/MoorhenMolecule.ts, line 2915

Promise.<void>

# async refineResiduesUsingAtomCid(cid, mode, ncycopt, redrawopt) → {Promise.<void>}

Refine a set of residues
Parameters:
Name Type Attributes Default Description
cid string The CID selection with the atoms that should be refined
mode string Refinement mode (SINGLE, TRIPLE ...etc.)
ncyc number <optional>
4000 Number of refinement cycles
redraw boolean <optional>
true Indicates if the molecule should be redrawn

View Source utils/MoorhenMolecule.ts, line 2903

Promise.<void>

# async refineResiduesUsingAtomCidAnimated(cid, activeMap, dist, redraw, redrawFragmentFirst)

Refine a residue CID with animation
Parameters:
Name Type Description
cid Array.<string> The CID selection used to create the fragment
activeMap moorhen.Map The map instance used in the refinement
dist number The maximum distance used to get neighboring residues for the refinement. Use -1 for literal CID instead of neighbours.
redraw boolean Indicate if the molecules should be redrawn
redrawFragmentFirst boolean Indicate if the fragment should be redrawn first

View Source utils/MoorhenMolecule.ts, line 2926

# removeRepresentation(representationId)

Remove a representation for this molecule instance
Parameters:
Name Type Description
representationId string The unique identifier for the representation

View Source utils/MoorhenMolecule.ts, line 2678

# async replaceModelWithCoordData(coordData) → {Promise.<void>}

Replace the current molecule some file contents
Parameters:
Name Type Description
coordData string The coord data for new model

View Source utils/MoorhenMolecule.ts, line 2349

Promise.<void>

# async replaceModelWithFile(fileUrl) → {Promise.<void>}

Replace the current molecule with the model in a file
Parameters:
Name Type Description
fileUrl string The uri to the file with the new model

View Source utils/MoorhenMolecule.ts, line 2341

Promise.<void>

# async rigidBodyFit(cidsString, mapNo) → {Promise.<void>}

Run rigid body fitting
Parameters:
Name Type Description
cidsString string Residue CID selection
mapNo number Map number that should be used

View Source utils/MoorhenMolecule.ts, line 2877

Promise.<void>

# setAtomsDirty(state) → {void}

Set the cached molecule atoms as "dirty". This means new bond representations need to be fetched next time the molecule is redrawn.
Parameters:
Name Type Description
state boolean Indicate whether the current atom representation is dirty

View Source utils/MoorhenMolecule.ts, line 2560

void

# setBackgroundColour(backgroundColour)

Set the background colour where the molecule is being drawn. Used to detect whether the background is dark and molecule needs to be rendered using lighter colours.
Parameters:
Name Type Description
backgroundColour Array.<number> The rgba indicating the background colour

View Source utils/MoorhenMolecule.ts, line 2402

# async setDrawAdaptativeBonds(newValue)

Value setter for MoorhenMolecule.adaptativeBondsEnabled
Parameters:
Name Type Description
newValue boolean The new value

View Source utils/MoorhenMolecule.ts, line 2721

# setSymmetryRadius(radius) → {Promise.<void>}

Set the radius to draw symmetry mates
Parameters:
Name Type Description
radius number Symmetry mates with an atom within this radius will be drawn

View Source utils/MoorhenMolecule.ts, line 2368

Promise.<void>

# show(style, cidopt) → {void}

Show the representation for the molecule
Parameters:
Name Type Attributes Description
style string The representation style to show
cid string <optional>
The CID selection for the representation

View Source utils/MoorhenMolecule.ts, line 2659

void

# async splitMultiModels(drawopt) → {Array.<moorhen.Molecule>}

Split a molecule with multiple models into separate molecules (one for each model)
Parameters:
Name Type Attributes Default Description
draw boolean <optional>
false Indicates whether the new molecules should be drawn

View Source utils/MoorhenMolecule.ts, line 3084

- A list with the new molecules
Array.<moorhen.Molecule>

# toggleBiomolecule() → {void}

Turn on/off molecule symmetry

View Source utils/MoorhenMolecule.ts, line 2355

void

# toggleSymmetry() → {Promise.<void>}

Turn on/off molecule symmetry

View Source utils/MoorhenMolecule.ts, line 2361

Promise.<void>

# async transferLigandDicts(toMolecule, overrideopt)

Transfer ligand dictionaries stored in this molecule instance to other molecule
Parameters:
Name Type Attributes Default Description
toMolecule morhen.Molecule The molecule where the metadata will be transferred
override boolean <optional>
false Override ligand dictionaries already stored under the same ligand name in the other molecule instance

View Source utils/MoorhenMolecule.ts, line 2463

# async transferMetaData(otherMolecule, transferDictsopt)

Transfer metadata stored in this molecule instance to other molecule
Parameters:
Name Type Attributes Default Description
otherMolecule morhen.Molecule The molecule where the metadata will be transferred
transferDicts boolean <optional>
true Indicates whether ligand dictionaries should also be transferred

View Source utils/MoorhenMolecule.ts, line 2455

# transformedCachedAtomsAsMovedAtoms(selectionCid) → {Array.<Array.<moorhen.AtomInfo>>}

Move residues by applying a series of cached matrix transformations
Parameters:
Name Type Description
selectionCid string The CID selection for the set of residues that will be moved

View Source utils/MoorhenMolecule.ts, line 2751

New atom information for the moved residues
Array.<Array.<moorhen.AtomInfo>>

# async undo() → {Promise.<void>}

Undo last action performed on this molecule

View Source utils/MoorhenMolecule.ts, line 2817

Promise.<void>

# async unhideAll(redrawopt)

Unhide all the molecule representations
Parameters:
Name Type Attributes Default Description
redraw boolean <optional>
true Indicates if the molecule should be redrawn

View Source utils/MoorhenMolecule.ts, line 2868

# async updateAtoms()

Update the cached atoms with the latest information from the libcoot api

View Source utils/MoorhenMolecule.ts, line 2595

# async updateGemmiStructure(coordString) → {Promise.<void>}

Update the cached gemmi structure for this molecule
Parameters:
Name Type Description
coordString string

View Source utils/MoorhenMolecule.ts, line 2410

Promise.<void>

# async updateLigands() → {Promise.<void>}

Update the ligand dictionaries for this molecule instance

View Source utils/MoorhenMolecule.ts, line 2831

Promise.<void>

# async updateWithMovedAtoms(movedResidues) → {Promise.<void>}

Update the molecule with a set of moved residues
Parameters:
Name Type Description
movedResidues Array.<Array.<moorhen.AtomInfo>> Set of moved residues

View Source utils/MoorhenMolecule.ts, line 2759

Promise.<void>

# static guessCoordFormat(coordDataString) → {string}

Guess the coordinate format from the file contents
Parameters:
Name Type Description
coordDataString string The file contents

View Source utils/MoorhenMolecule.ts, line 2527

- The file format
string