Class

MoorhenMap

MoorhenMap(commandCentre, glRef, storeopt)

Represents a map
Constructor

# new MoorhenMap(commandCentre, glRef, storeopt)

Parameters:
Name Type Attributes 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
Properties:
Name Type Description
name string The name assigned to this map instance
molNo number The imol assigned to this map instance
style string Indicates whether the rendered map is drawn as lines, lit lines or a solid surphace
isDifference boolean Indicates whether this is a difference map instance
hasReflectionData boolean Indicates whether this map instance has been associated with observed reflection data
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

View Source utils/MoorhenMap.ts, line 43

Example
import { MoorhenMap } from "moorhen";

// Create a new map
const map = new MoorhenMap(commandCentre, glRef);

// Load file from a URL
const selectedColumns = { F: "FWT", PHI: "PHWT", Fobs: "FP", SigFobs: "SIGFP", FreeR: "FREE", isDifference: false, useWeight: false, calcStructFact: true }
map.loadToCootFromMtzURL("/uri/to/file.mtz", "map-1", selectedColumns);

// Draw map and set view on map centre
map.drawMapContour();
map.centreOnMap();

// Delete map
map.delete();

Classes

MoorhenMap

Members

# loadToCootFromMtzFile

Load map to moorhen from a MTZ file

View Source utils/MoorhenMap.ts, line 235

# loadToCootFromMtzFile

Load map to moorhen from a MTZ file

View Source utils/MoorhenMap.ts, line 1118

Methods

# async associateToReflectionData(selectedColumns, reflectionData) → {Promise.<moorhen.WorkerResponse>}

Associate this map with a set of observed reflections
Parameters:
Name Type Description
selectedColumns moorhen.selectedMtzColumns Object indicating the selected MTZ columns
reflectionData Uint8Array The reflection data that will be associates to this map

View Source utils/MoorhenMap.ts, line 1257

- Void promise
Promise.<moorhen.WorkerResponse>

# blur(bFactor) → {Promise.<moorhen.WorkerResponse.<number>>}

Blur the map
Parameters:
Name Type Description
bFactor number The b-factor used for blurring

View Source utils/MoorhenMap.ts, line 1278

Status (-1 if failure)
Promise.<moorhen.WorkerResponse.<number>>

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

Set the view in the centre of this map instance

View Source utils/MoorhenMap.ts, line 1320

Promise.<void>

# clearBuffersOfStyle(style) → {void}

Clear MGWebGL buffers of a given style for this map
Parameters:
Name Type Description
style string The map style that will be cleared

View Source utils/MoorhenMap.ts, line 1206

void

# async copyMap() → {Promise.<moorhen.Map>}

Create a copy of the map

View Source utils/MoorhenMap.ts, line 1271

New map instance
Promise.<moorhen.Map>

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

Delete the map instance

View Source utils/MoorhenMap.ts, line 1081

Promise.<void>

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

Draw the map contour around a given origin
Parameters:
Name Type Description
x number Origin coord. X
y number Origin coord. Y
z number Origin coord. Z
radius number Radius around the origin that will be drawn
contourLevel number The map contour level

View Source utils/MoorhenMap.ts, line 1218

Promise.<void>

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

Contour the map with parameters from the redux store

View Source utils/MoorhenMap.ts, line 1193

Promise.<void>

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

Estimate the map weight based on the map rmsd

View Source utils/MoorhenMap.ts, line 1306

Promise.<void>

# async exportAsGltf() → {ArrayBuffer}

Export the map as a gltf in binary format

View Source utils/MoorhenMap.ts, line 1350

- The contents of the gltf file (binary format)
ArrayBuffer

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

Set the colours for a non-difference map using values from redux store

View Source utils/MoorhenMap.ts, line 1241

Promise.<void>

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

Fetch the colours for a difference map using values from redux store and redraw the map
Parameters:
Name Type Description
type 'positiveDiffColour' | 'negativeDiffColour' Indicates whether the negative or positive colours will be set

View Source utils/MoorhenMap.ts, line 1234

Promise.<void>

# async fetchIsDifferenceMap() → {boolean}

Fetch whether this is a difference map

View Source utils/MoorhenMap.ts, line 1336

- True if this map instance is a difference map
boolean

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

Fetch the map alpha (transparency) for this map using values from redux store and redraw the map

View Source utils/MoorhenMap.ts, line 1248

Promise.<void>

# async fetchMapCentre() → {Array.<number>}

Get the suggested map centre for this map instance (it will also fetch suggested level for EM maps)

View Source utils/MoorhenMap.ts, line 1299

The map centre
Array.<number>

# async fetchMapRmsd() → {number}

Get the current map RMSD

View Source utils/MoorhenMap.ts, line 1285

The map RMSD
number

# async fetchReflectionData() → {Promise.<moorhen.WorkerResponse.<Uint8Array>>}

Fetch the reflection data associated with this map

View Source utils/MoorhenMap.ts, line 1264

The reflection data
Promise.<moorhen.WorkerResponse.<Uint8Array>>

# async fetchSuggestedLevel() → {number}

Get the suggested level for this map instance (only for MX maps)

View Source utils/MoorhenMap.ts, line 1292

The suggested map contour level
number

# async getHistogram(nBins, zoomFactor) → {object}

Get the histogram data for this map instance
Parameters:
Name Type Description
nBins number
zoomFactor number

View Source utils/MoorhenMap.ts, line 1329

- An object with the histogram data
object

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

Get the current map

View Source utils/MoorhenMap.ts, line 1167

A worker response with the map arrayBuffer
Promise.<moorhen.WorkerResponse>

# getMapContourParams() → {object}

Get map contour parameters from the redux store

View Source utils/MoorhenMap.ts, line 1187

A description of map contour parameters as described in the redux store
object

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

Get the current map weight

View Source utils/MoorhenMap.ts, line 1181

The current map weight
Promise.<number>

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

Get suggested contour level, radius and map centre for this map instance

View Source utils/MoorhenMap.ts, line 1313

Promise.<void>

# hideMapContour() → {void}

Hide the map contour

View Source utils/MoorhenMap.ts, line 1199

void

# async loadToCootFromMapData(data, name, isDiffMap) → {Promise.<moorhen.Map>}

Load map to moorhen from map data
Parameters:
Name Type Description
data ArrayBuffer | Uint8Array The map data in the form of a array buffer
name string The name that will be assigned to the map
isDiffMap boolean Indicates whether the new map is a difference map

View Source utils/MoorhenMap.ts, line 1140

This moorhenMap instance
Promise.<moorhen.Map>

# async loadToCootFromMapFile(source, isDiffMapopt, decompressopt) → {Promise.<moorhen.Map>}

Load a map to moorhen from a map file data blob
Parameters:
Name Type Attributes Default Description
source File The map file
isDiffMap boolean <optional>
false Indicates whether the new map is a difference map
decompress boolean <optional>
false Indicates whether the new map should be decompressed before being passed to libcoot api

View Source utils/MoorhenMap.ts, line 1150

This moorhenMap instance
Promise.<moorhen.Map>

# async loadToCootFromMapURL(url, name, isDiffMapopt, decompressopt, optionsopt) → {Promise.<moorhen.Map>}

Load map to moorhen from a map file url
Parameters:
Name Type Attributes Default Description
url string The url to the MTZ file
name string The name that will be assigned to the map
isDiffMap boolean <optional>
false Indicates whether the new map is a difference map
decompress boolean <optional>
false Indicates whether the new map should be decompressed before being passed to libcoot api
options object <optional>
Options passed to fetch API

View Source utils/MoorhenMap.ts, line 1130

This moorhenMap instance
Promise.<moorhen.Map>

# async loadToCootFromMtzData(data, name, selectedColumns) → {Pormise.<moorhen.Map>}

Load map to moorhen using MTZ data
Parameters:
Name Type Description
data Uint8Array The mtz data
name string The name that will be assigned to the map
selectedColumns moorhen.selectedMtzColumns Object indicating the selected MTZ columns

View Source utils/MoorhenMap.ts, line 1111

This moorhenMap instance
Pormise.<moorhen.Map>

# async loadToCootFromMtzURL(url, name, selectedColumns, optionsopt) → {Pormise.<moorhen.Map>}

Load map to moorhen using a MTZ url
Parameters:
Name Type Attributes Description
url string The url to the MTZ file
name string The name that will be assigned to the map
selectedColumns moorhen.selectedMtzColumns Object indicating the selected MTZ columns
options object <optional>
Options passed to fetch API

View Source utils/MoorhenMap.ts, line 1101

This moorhenMap instance
Pormise.<moorhen.Map>

# async replaceMapWithMtzFile(fileUrl, selectedColumns) → {Promise.<void>}

Replace the current map with the contents of a MTZ file
Parameters:
Name Type Description
fileUrl string The uri to the MTZ file
selectedColumns moorhen.selectedMtzColumns Object indicating the selected MTZ columns

View Source utils/MoorhenMap.ts, line 1090

Promise.<void>

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

Helper function to set this map instance as the "active" map for refinement

View Source utils/MoorhenMap.ts, line 1074

Promise.<void>

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

Set the default colour for this map depending on the current number of maps loaded in the session

View Source utils/MoorhenMap.ts, line 1343

Promise.<void>

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

Set the map weight
Parameters:
Name Type Attributes Default Description
weight number <optional>
moorhen.Map.suggestedMapWeight The new map weight

View Source utils/MoorhenMap.ts, line 1174

Void worker response
Promise.<moorhen.WorkerResponse>

# setOtherMapForColouring(molNo, min, max)

Set colouring for this map instance based on another map
Parameters:
Name Type Description
molNo number The imol for the other map
min number The min value
max number The max value

View Source utils/MoorhenMap.ts, line 1226

# async static autoReadMtz(source, commandCentre, glRef, store) → {Array.<moorhen.Map>}

Static method used to automatically read multiple maps from a single mtz file
Parameters:
Name Type Description
source File The mtz file
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 The redux store

View Source utils/MoorhenMap.ts, line 1161

A list of maps resulting from reading the mtz file
Array.<moorhen.Map>