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 |
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
Members
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 |
- 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 |
Status (-1 if failure)
Promise.<moorhen.WorkerResponse.<number>>
# async centreOnMap() → {Promise.<void>}
Set the view in the centre of this map instance
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 |
void
# async copyMap() → {Promise.<moorhen.Map>}
Create a copy of the map
New map instance
Promise.<moorhen.Map>
# 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 |
Promise.<void>
# drawMapContour() → {Promise.<void>}
Contour the map with parameters from the redux store
Promise.<void>
# async estimateMapWeight() → {Promise.<void>}
Estimate the map weight based on the map rmsd
Promise.<void>
# async exportAsGltf() → {ArrayBuffer}
Export the map as a gltf in binary format
- 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
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 |
Promise.<void>
# async fetchIsDifferenceMap() → {boolean}
Fetch whether this is a difference map
- 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
Promise.<void>
# async fetchMapCentre() → {Array.<number>}
Get the suggested map centre for this map instance (it will also fetch suggested level for EM maps)
The map centre
Array.<number>
# async fetchReflectionData() → {Promise.<moorhen.WorkerResponse.<Uint8Array>>}
Fetch the reflection data associated with this map
The reflection data
Promise.<moorhen.WorkerResponse.<Uint8Array>>
# async fetchSuggestedLevel() → {number}
Get the suggested level for this map instance (only for MX maps)
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
|
- An object with the histogram data
object
# getMap() → {Promise.<moorhen.WorkerResponse>}
Get the current map
A worker response with the map arrayBuffer
Promise.<moorhen.WorkerResponse>
# getMapContourParams() → {object}
Get map contour parameters from the redux store
A description of map contour parameters as described in the redux store
object
# async getMapWeight() → {Promise.<number>}
Get the current map weight
The current map weight
Promise.<number>
# async getSuggestedSettings() → {Promise.<void>}
Get suggested contour level, radius and map centre for this map instance
Promise.<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 |
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 |
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 |
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 |
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 |
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 |
Promise.<void>
# async setActive() → {Promise.<void>}
Helper function to set this map instance as the "active" map for refinement
Promise.<void>
# async setDefaultColour() → {Promise.<void>}
Set the default colour for this map depending on the current number of maps loaded in the session
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 |
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 |
# 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 |
A list of maps resulting from reading the mtz file
Array.<moorhen.Map>