Configuration Load Morpheus with a pre-configured matrix

There are two options to loading a pre-configured matrix.

1. Pass the request parameters json, a URI encoded JSON configuration object, or url, a URL to a JSON configuration file, to https://software.broadinstitute.org/morpheus/ (can be embedded using an iframe).
Note that the correct HTTP CORS headers must be set if any of your resources are hosted on a different domain.

2. Include morpheus-latest.min.css, morpheus-external-latest.min.js, morpheus-latest.min.js in your HTML. Construct a new morpheus.HeatMap object with the el parameter, the element in which to render the heat map.

JSON configuration
  • A File or URL to one of the accepted file formats.
    Can also be an array of files or URLs in which case the datasets are combined by matching on column ids.
    Also be can specified in
    • rows Number
      Number of rows in the dataset
    • columns Number
      Number of columns in the dataset
    • seriesArrays[[number, object]]
      Each series contains an array of arrays in row-major order.
    • seriesNames [string]
      Array of series names
    • seriesDataTypes [string]
      Array of series data types
    • rowMetadataModel Object with the key "vectors"
      Contains dataset row metadata
      • vectors Array
        Array of objects with the keys "name" and "array".
    • columnMetadataModel Object with the key "vectors"
      Contains dataset column metadata
      • vectors Array
        Array of objects with the keys "name" and "array".
  • Optional array of objects describing additional annotations to join with dataset. [Object]
    • file String
      An xlsx file, a tab-delimited text file, or a gmt file.
    • datasetField String
      Field to match in dataset.
    • fileField String
      Field to match in file.
    • include [String]
      Optional array of fields to include from file.
    Annotate rows matching "name" field in dataset to "id" field in file at https://MY_URL. [{file:"https://MY_URL", datasetField:"name", fileField:"id"}]
    • Number|String (default: 13)
      Heat map row size in pixels or 'fit' to fit heat map to current height.
    • Number
      Total heat map width. If undefined, width will be with of el element.
    • Number|String (default: 13)
      Heat map column size in pixels or 'fit' to fit heat map to current width.
    • Boolean (default:true)
      Whether to draw heat map grid.
  • Optional array of metadata names to group the heat map by. [Object]
    • field String
      The metadata field name.
    Group by the type and gender metadata fields
    [{field:"type"}, {field:"gender"}]
  • Optional object that describes filter. Object
    • filters [Object]
      • field String
        The metadata field name.
      • type String
        One of "set", "range", "top", "index"
      • values [String|Number] for "set" filter
        Array of values to include
      • min Number for "range" filter
        Minimum value to include
      • max Number for "range" filter
        Maximum value to include
      • direction String for "top" filter
        One of "top", "bottom", "topAndBottom"
      • n Number for "top" filter
        Number to include
      • indices [Number] for "index" filter
        Array of indices to include
    • isAnd Boolean
      Whether filters are combined by AND or OR.
    Keep rows with annotation "field_1" equal to "A" or "B" and annotation "field_2" between zero and one.
    {isAnd:true, filters:[{type:"set", name:"field_1", values:["A", "B"]}, {type:"range", name:"field_2", min:0, max:1}]}
  • Optional object that describes value to color mappingObject
    • scalingModeString
      "fixed" or "relative" color scheme
    • steppedBoolean
      Whether color scheme is continuous (false) or discrete (true)
    • values[Number]
      Array of values corresponding to colors
    • colorsBoolean
      Array of colors
    • sizeObject
      Optional object that describes the mapping of value to size for an element in the heat map
      • seriesNameString
        Dataset series name to map value to size
      • minNumber
        Minimum value in series used for mapping value to size
      • maxNumber
        Maximum value in series used for mapping value to size
    • transformValuesNumber
      For "fixed" scaling mode: 1 to z-score, 2 to robust z-score
    • conditions[Object]
      Optional array of objects that describe the mapping of value to shape for an element in the heat map
      • seriesNameString
        Dataset series name to map value to a condition
      • colorString
        Shape color
      • shapeString
        Shape name ("circle", "square", "diamond", "triangle-up", "triangle-down", "triangle-left", "triangle-right")
      • inheritColorBoolean
        Whether shape inherits color from color scheme
      • colorString
        Shape color when inheritColor is false
      • v1Number
        Condition one value
      • v2Number
        Condition two value
      • v1OpString
        Condition one operation ("gte", "gt")
      • v2OpNumber
        Condition two operation ("lte", "lt")
    Use a fixed color scheme with color stops at -100, -90, 90, and 100
    { scalingMode : "fixed", stepped : false, values : [ -100, -90, 90, 100], colors : ["#abdda4", "white", "white", "red"]}
  • Optional array of sort keys. To sort by an annotation, set "type" to "annotation" and supply a metadata name. To sort by values in the heat map set "type" to "byValues" and set "modelIndices" to an array of model row/column indices in the dataset to sort by. [Object]
    • orderNumber
      0 for ascending, 1 for descending.
    • fieldString
      Annotation field name when sorting by an annotation
    • typeString
      Sort by "annotation" or "byValues"
    • modelIndices[Number]
      Array of model row/column indices in the dataset to sort by when sorting by heat map values
    Sort ascending by gene, and then descending by heat map values in 1st column
    [{field:"gene", order:0, type:"annotation"}, {modelIndices:[0], order:1, type:"byValues"}]
  • Describes how annotation values are mapped to colors. The keys in the object are the annotation names. The structure of the object will depend on whether you're specifying a continuous or discrete color map.
    For discrete mappings:
    Map "a" to "red", "b" to "blue", and "c" to "white" for the "type" field.
    {"type":{"a":"red", "b":"blue", "c":"white"}}
    For continuous mappings:
    Map from yellow to green from 0 to 2 for the "score" field.
    {"score":{values:[0, 2], colors:["yellow", "green"]}
  • Describes how annotation values are mapped to shapes. The keys in the object are the annotation names. The values are one of "circle", "square", "plus", "x", "asterisk", "diamond", "triangle-up", "triangle-down", "triangle-left", "triangle-right", or "circle-minus".
    Map "a" to "diamond", "b" to "asterisk", and "c" to "x" for the "type" field.
    {"type":{"a":"diamond", "b":"asterisk", "c":"x"}}
  • Describes how annotation values are mapped to font weights. The keys in the object are the annotation names. The values are one of {"weight":"400"}, {"weight":"700"}, or {"weight":"900"}
    Map "a" to font weight 700
    {"type":{"a":{"weight":"700"}}
    • String
      Optional URL to a dendrogram in Newick format
    • String
      Optional metadata field in dataset to match leaf node ids in the dendrogram Newick file.
  • Optional array of objects describing how to display metadata fields [Object]
    • field String
      Metadata field name
    • display [String]
      "text" to render annotation as text, "color" to render annotation as color, "bar" to render annotation as bar chart, "text_and_font" to encode text using font weight, "text_and_color" to encode text using color.
    • highlightMatchingValues Boolean (default:false)
      Whether to highlight matching values on hover
    • colorByField String
      Optional field name to color this field by.
    • fontField String
      Optional field name to use for mapping values to font weights.
    • min Number
      Optional minimum for bar chart.
    • mid Number
      Optional midpoint for bar chart.
    • max Number
      Optional maximum for bar chart.
    • formatter String
      Optional number format pattern, such as ".4f".
    Display id as text and stdev using text and color
    [{field:"id", display:["text"]}, {field:"stdev", display:["text", "color"]}]
  • Optional array of tools to run at load time [Object]
    [{name:String, params:Object}]
    Cluster rows and columns
    [{ name: "Hierarchical Clustering", params: {cluster: "Rows and columns"} }]