Skip to content

Integrate MolQL transpilers in Mol* #4

@ptourlas

Description

@ptourlas

Greetings!

I have seen the examples offered at http://molql.org/explorer.html and I would like to integrate the PyMol and VMD transpilers in a Molstar fork that I have. My goal is to allow selections from any language the user prefers, just like in the MolQL explorer. From what I understand, the transpilers produce something pretty close to what Molstar "speaks". For example,
StructureSelectionQueries.water.expression() (see https://github.com/molstar/molstar/blob/704a9a111dff82e3566276068b1c33505570ccb7/src/mol-plugin-state/helpers/structure-selection-query.ts#L276)
returns:

{
    head: {
      name: "structure-query.modifier.union",
    },
    args: [
      {
        head: {
          name: "structure-query.generator.atom-groups",
        },
        args: {
          "entity-test": {
            head: {
              name: "core.rel.eq",
            },
            args: [
              {
                head: {
                  name: "structure-query.atom-property.macromolecular.entity-type",
                },
              },
              "water",
            ],
          },
        },
      },
    ],
  }

which I can use to add a representation for the waters in a given structure.

On the other hand, water selection in the MolQL explorer yields:

{
  "source": "molql-explorer",
  "version": "0.1.0",
  "expression": {
    "head": "structure.generator.atom-groups",
    "args": {
      "residue-test": {
        "head": "core.set.has",
        "args": [
          {
            "head": "core.type.set",
            "args": [
              "H2O",
              "HH0",
              "OHH",
              "HOH",
              "OH2",
              "SOL",
              "WAT",
              "TIP",
              "TIP2",
              "TIP3",
              "TIP4"
            ]
          },
          {
            "head": "structure.atom-property.macromolecular.label_comp_id"
          }
        ]
      }
    }
  }
}

I tried to substitute the first query with the expression part of the second, but Molstar greeted me with an Error: Can only apply symbols message.
Any hints on how to approach this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions