Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: accurately fetch data when data and/or dataTransform is defined in individual tracks that are overlaid #470

Merged
merged 5 commits into from
Aug 25, 2021

Conversation

sehilyi
Copy link
Member

@sehilyi sehilyi commented Aug 24, 2021

Fix gosling-lang/gos#38
Fix gosling-lang/gos#37

Spec that had issues:

{
  "arrangement": "vertical",
  "views": [
    {
      "alignment": "stack",
      "layout": "circular",
      "static": true,
      "tracks": [
        {
          "alignment": "overlay",
          "height": 100,
          "tracks": [
            {
              "color": {
                "field": "sample",
                "type": "nominal"
              },
              "data": {
                "binSize": 4,
                "categories": [
                  "sample 1",
                  "sample 2",
                  "sample 3",
                  "sample 4"
                ],
                "column": "position",
                "row": "sample",
                "type": "multivec",
                "url": "https://server.gosling-lang.org/api/v1/tileset_info/?d=cistrome-multivec",
                "value": "peak"
              },
              "mark": "bar",
              "row": {
                "field": "sample",
                "type": "nominal"
              },
              "stroke": {
                "value": "black"
              },
              "strokeWidth": {
                "value": 0.3
              },
              "style": {
                "outlineWidth": 0
              },
              "x": {
                "field": "start",
                "type": "genomic"
              },
              "xe": {
                "field": "end",
                "type": "genomic"
              },
              "y": {
                "field": "peak",
                "type": "quantitative"
              }
            },
            {
              "color": {
                "value": "blue"
              },
              "data": {
                "binSize": 4,
                "categories": [
                  "sample 1",
                  "sample 2",
                  "sample 3",
                  "sample 4"
                ],
                "column": "position",
                "row": "sample",
                "type": "multivec",
                "url": "https://server.gosling-lang.org/api/v1/tileset_info/?d=cistrome-multivec",
                "value": "peak"
              },
              "mark": "brush",
              "row": {
                "field": "sample",
                "type": "nominal"
              },
              "stroke": {
                "value": "black"
              },
              "strokeWidth": {
                "value": 0.3
              },
              "style": {
                "outlineWidth": 0
              },
              "x": {
                "field": "start",
                "linkingId": "detail-1",
                "type": "genomic"
              },
              "xe": {
                "field": "end",
                "type": "genomic"
              },
              "y": {
                "field": "peak",
                "type": "quantitative"
              }
            },
            {
              "color": {
                "value": "red"
              },
              "data": {
                "binSize": 4,
                "categories": [
                  "sample 1",
                  "sample 2",
                  "sample 3",
                  "sample 4"
                ],
                "column": "position",
                "row": "sample",
                "type": "multivec",
                "url": "https://server.gosling-lang.org/api/v1/tileset_info/?d=cistrome-multivec",
                "value": "peak"
              },
              "mark": "brush",
              "row": {
                "field": "sample",
                "type": "nominal"
              },
              "stroke": {
                "value": "black"
              },
              "strokeWidth": {
                "value": 0.3
              },
              "style": {
                "outlineWidth": 0
              },
              "x": {
                "field": "start",
                "linkingId": "detail-2",
                "type": "genomic"
              },
              "xe": {
                "field": "end",
                "type": "genomic"
              },
              "y": {
                "field": "peak",
                "type": "quantitative"
              }
            }
          ],
          "width": 500
        },
        {
          "data": {
            "genomicFieldsToConvert": [
              {
                "chromosomeField": "chr1",
                "genomicFields": [
                  "p1s",
                  "p1e"
                ]
              },
              {
                "chromosomeField": "chr2",
                "genomicFields": [
                  "p2s",
                  "p2e"
                ]
              }
            ],
            "headerNames": [
              "chr1",
              "p1s",
              "p1e",
              "chr2",
              "p2s",
              "p2e",
              "type",
              "id",
              "f1",
              "f2",
              "f3",
              "f4",
              "f5",
              "f6"
            ],
            "separator": "\t",
            "type": "csv",
            "url": "https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/rearrangements.bulk.1639.simple.filtered.pub"
          },
          "dataTransform": [
            {
              "field": "chr1",
              "oneOf": [
                "1",
                "16",
                "14",
                "9",
                "6",
                "5",
                "3"
              ],
              "type": "filter"
            },
            {
              "field": "chr2",
              "oneOf": [
                "1",
                "16",
                "14",
                "9",
                "6",
                "5",
                "3"
              ],
              "type": "filter"
            }
          ],
          "height": 100,
          "mark": "withinLink",
          "opacity": {
            "value": 0.15
          },
          "stroke": {
            "domain": [
              "deletion",
              "inversion",
              "translocation",
              "tandem-duplication"
            ],
            "field": "type",
            "type": "nominal"
          },
          "strokeWidth": {
            "value": 0.8
          },
          "width": 500,
          "x": {
            "field": "p1s",
            "type": "genomic"
          },
          "x1": {
            "field": "p2s",
            "type": "genomic"
          },
          "x1e": {
            "field": "p2e",
            "type": "genomic"
          },
          "xe": {
            "field": "p1e",
            "type": "genomic"
          }
        }
      ]
    },
    {
      "arrangement": "horizontal",
      "spacing": 10,
      "views": [
        {
          "tracks": [
            {
              "color": {
                "field": "sample",
                "legend": false,
                "type": "nominal"
              },
              "data": {
                "binSize": 4,
                "categories": [
                  "sample 1",
                  "sample 2",
                  "sample 3",
                  "sample 4"
                ],
                "column": "position",
                "row": "sample",
                "type": "multivec",
                "url": "https://server.gosling-lang.org/api/v1/tileset_info/?d=cistrome-multivec",
                "value": "peak"
              },
              "height": 150,
              "mark": "bar",
              "row": {
                "field": "sample",
                "type": "nominal"
              },
              "stroke": {
                "value": "black"
              },
              "strokeWidth": {
                "value": 0.3
              },
              "style": {
                "background": "blue",
                "backgroundOpacity": 0.1
              },
              "width": 245,
              "x": {
                "domain": {
                  "chromosome": "5"
                },
                "field": "start",
                "linkingId": "detail-1",
                "type": "genomic"
              },
              "xe": {
                "field": "end",
                "type": "genomic"
              },
              "y": {
                "field": "peak",
                "type": "quantitative"
              }
            }
          ]
        },
        {
          "tracks": [
            {
              "color": {
                "field": "sample",
                "legend": true,
                "type": "nominal"
              },
              "data": {
                "binSize": 4,
                "categories": [
                  "sample 1",
                  "sample 2",
                  "sample 3",
                  "sample 4"
                ],
                "column": "position",
                "row": "sample",
                "type": "multivec",
                "url": "https://server.gosling-lang.org/api/v1/tileset_info/?d=cistrome-multivec",
                "value": "peak"
              },
              "height": 150,
              "mark": "bar",
              "row": {
                "field": "sample",
                "type": "nominal"
              },
              "stroke": {
                "value": "black"
              },
              "strokeWidth": {
                "value": 0.3
              },
              "style": {
                "background": "red",
                "backgroundOpacity": 0.1
              },
              "width": 245,
              "x": {
                "domain": {
                  "chromosome": "16"
                },
                "field": "start",
                "linkingId": "detail-2",
                "type": "genomic"
              },
              "xe": {
                "field": "end",
                "type": "genomic"
              },
              "y": {
                "field": "peak",
                "type": "quantitative"
              }
            }
          ]
        }
      ]
    }
  ]
}

@sehilyi sehilyi merged commit e647386 into master Aug 25, 2021
@sehilyi sehilyi deleted the sehilyi/overlay-bug branch August 25, 2021 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant