gosling.js icon indicating copy to clipboard operation
gosling.js copied to clipboard

Pileup transformation with non-higlass data throws an error

Open sehilyi opened this issue 2 years ago • 0 comments

It looks like the source of the error is when combining tiles before applying the pileup transformation.

Source of the error (code):

// combineAllTilesIfNeeded()
tiles.forEach((t: any, i: number) => {
    // Combine data
    newData = [...newData, ...t.tileData]; // Uncaught (in promise) TypeError: c.tileData is not iterable

    // Flag to force using only one tile
    t.mergedToAnotherTile = i !== 0;
});

tileData is only available for the higlass data.

Minimal example:

{
  "tracks": [
    {
      "data": {
        "type": "json",
        "values": [
          {"c": "chr1", "s": 100, "e": 200},
          {"c": "chr5", "s": 150, "e": 200}
        ],
        "chromosomeField": "c",
        "genomicFields": ["s", "e"]
      },
      "dataTransform": [
        {
          "type": "displace",
          "method": "pile",
          "boundingBox": {"startField": "s", "endField": "e"},
          "newField": "row"
        }
      ],
      "mark": "rect",
      "x": {"field": "s", "type": "genomic", "domain": {"interval": [1, 300]}},
      "xe": {"field": "e", "type": "genomic"},
      "color": {"value": "red"},
      "stroke": {"value": "black"},
      "strokeWidth": {"value": 1}
    }
  ]
}

sehilyi avatar Aug 11 '22 16:08 sehilyi