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

Strip default items from session snapshots(?) #4503

Open
cmdcolin opened this issue Jul 30, 2024 · 1 comment
Open

Strip default items from session snapshots(?) #4503

cmdcolin opened this issue Jul 30, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@cmdcolin
Copy link
Collaborator

this could be a large-ish task but session snapshots tend to be kind of bloated with a lot of default values being included. config snapshots specifically have logic to remove these. it uses the fact that config slots have a defaultValue to compare to. with session/view/track/display model snapshots, this logic for removing might be more "bespoke"

@cmdcolin cmdcolin added the enhancement New feature or request label Jul 30, 2024
@cmdcolin
Copy link
Collaborator Author

example of a potential before and after

{
  "session": {
    "drawerPosition": "right",
    "drawerWidth": 384,
    "widgets": {
      "hierarchicalTrackSelector": {
        "id": "hierarchicalTrackSelector",
        "type": "HierarchicalTrackSelectorWidget",
        "view": "integration_test",
        "faceted": {
          "filterText": "",
          "showSparse": false,
          "showFilters": true,
          "showOptions": false,
          "panelWidth": 400
        }
      },
      "GridBookmark": {
        "id": "GridBookmark",
        "type": "GridBookmarkWidget"
      }
    },
    "activeWidgets": {
      "hierarchicalTrackSelector": "hierarchicalTrackSelector"
    },
    "minimized": false,
    "id": "X2pTznil7TtrhV4z1r75O",
    "name": "Integration test example 7/30/2024, 9:58:25 AM",
    "margin": 0,
    "views": [
      {
        "id": "integration_test",
        "minimized": false,
        "type": "LinearGenomeView",
        "offsetPx": 2000,
        "bpPerPx": 0.05,
        "displayedRegions": [
          {
            "refName": "ctgA",
            "start": 0,
            "end": 50001,
            "assemblyName": "volvox"
          }
        ],
        "tracks": [
          {
            "id": "ZfLTDGAGgASvA7MNwZe-R",
            "type": "AlignmentsTrack",
            "configuration": "volvox-long-reads-sv-cram",
            "minimized": false,
            "displays": [
              {
                "id": "td2O2UMdbdkKFdlhNQF66",
                "type": "LinearAlignmentsDisplay",
                "PileupDisplay": {
                  "id": "KLfnmVzVvgs9qtaRcw7bv",
                  "type": "LinearPileupDisplay",
                  "heightPreConfig": 205,
                  "configuration": {
                    "type": "LinearPileupDisplay",
                    "displayId": "volvox-long-reads-sv-cram-LinearAlignmentsDisplay_LinearPileupDisplay_xyz"
                  },
                  "filterBy": {
                    "flagInclude": 0,
                    "flagExclude": 1540
                  },
                  "jexlFilters": [],
                  "showSoftClipping": false
                },
                "SNPCoverageDisplay": {
                  "id": "EvLGqRbKK7L8_CIR6hCX_",
                  "type": "LinearSNPCoverageDisplay",
                  "heightPreConfig": 45,
                  "configuration": {
                    "type": "LinearSNPCoverageDisplay",
                    "displayId": "volvox-long-reads-sv-cram-LinearAlignmentsDisplay_snpcoverage_xyz"
                  },
                  "selectedRendering": "",
                  "resolution": 1,
                  "constraints": {},
                  "filterBy": {
                    "flagInclude": 0,
                    "flagExclude": 1540
                  },
                  "jexlFilters": []
                },
                "snpCovHeight": 45,
                "configuration": "volvox-long-reads-sv-cram-LinearAlignmentsDisplay",
                "lowerPanelType": "LinearPileupDisplay"
              }
            ]
          }
        ],
        "hideHeader": false,
        "hideHeaderOverview": false,
        "hideNoTracksActive": false,
        "trackSelectorType": "hierarchical",
        "showCenterLine": false,
        "showCytobandsSetting": true,
        "trackLabels": "offset",
        "showGridlines": true,
        "highlight": [],
        "colorByCDS": false,
        "showTrackOutlines": true,
        "showBookmarkHighlights": true,
        "showBookmarkLabels": true
      }
    ],
    "sessionTracks": [],
    "sessionAssemblies": [],
    "temporaryAssemblies": [],
    "connectionInstances": [],
    "sessionConnections": [],
    "focusedViewId": "integration_test",
    "sessionPlugins": []
  }
}

after

{
  "session": {
    "widgets": {
      "hierarchicalTrackSelector": {
        "id": "hierarchicalTrackSelector",
        "type": "HierarchicalTrackSelectorWidget",
        "view": "integration_test"
      },
    },
    "activeWidgets": {
      "hierarchicalTrackSelector": "hierarchicalTrackSelector"
    },
    "id": "X2pTznil7TtrhV4z1r75O",
    "name": "Integration test example 7/30/2024, 9:58:25 AM",
    "views": [
      {
        "id": "integration_test",
        "type": "LinearGenomeView",
        "offsetPx": 2000,
        "bpPerPx": 0.05,
        "displayedRegions": [
          {
            "refName": "ctgA",
            "start": 0,
            "end": 50001,
            "assemblyName": "volvox"
          }
        ],
        "tracks": [
          {
            "id": "ZfLTDGAGgASvA7MNwZe-R",
            "type": "AlignmentsTrack",
            "configuration": "volvox-long-reads-sv-cram",
            "displays": [
              {
                "id": "td2O2UMdbdkKFdlhNQF66",
                "type": "LinearAlignmentsDisplay",
                "PileupDisplay": {
                  "id": "KLfnmVzVvgs9qtaRcw7bv",
                  "type": "LinearPileupDisplay",
                  "configuration": {
                    "type": "LinearPileupDisplay",
                    "displayId": "volvox-long-reads-sv-cram-LinearAlignmentsDisplay_LinearPileupDisplay_xyz"
                  },
                },
                "SNPCoverageDisplay": {
                  "id": "EvLGqRbKK7L8_CIR6hCX_",
                  "type": "LinearSNPCoverageDisplay",
                  "configuration": {
                    "type": "LinearSNPCoverageDisplay",
                    "displayId": "volvox-long-reads-sv-cram-LinearAlignmentsDisplay_snpcoverage_xyz"
                  },
                },
                "configuration": "volvox-long-reads-sv-cram-LinearAlignmentsDisplay",
                "lowerPanelType": "LinearPileupDisplay"
              }
            ]
          }
        ]
      }
    ],
    "focusedViewId": "integration_test"
  }
}

potentially the after could be simplified even further but that would be a good start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant