molstar / mol-view-spec

https://molstar.org/mol-view-spec/
MIT License
8 stars 1 forks source link

Mock data #2

Closed JonStargaryen closed 1 year ago

JonStargaryen commented 1 year ago

Create some custom mmCIF files with my_custom_cif_category for coloring and labels to use for testing of frontend/Mol*.

dsehnal commented 1 year ago

Brainstorming on data model:


class AnnotationNode:
    kind: "annotation"
    type: "text" | "color"
    source_url: Optional[str]
    address_schema: "label-atom" | "auth-atom" | "residue" | "sifts-residue" | "chain" | "..." 
    # consider polymer and non-polymer as separate schemas
    annotation_field_name: str

class LabelResidueElement:
    label_seq_id: int
    label_asym_id: str
    label_entity_id: Optional[str]

class AuthResidueElement:
    auth_seq_id: int
    auth_asym_id: str
    pdbx_ins_code: Optional[str]

# ligand would be chain
class LabelChainElement:
    asym_id: str
    entity_id: str

# Array of objects LabelChainElement
"""[
    { label_asym_id: "A", label: "label 1", color: "#121212" },
    { label_asym_id: "B", label_entity_id: "1", label: "label 2", color: "#333333"  }
]"""

# Object of arrays LabelChainElement
"""{
    asym_id: ["A", "B"], 
    entity_id: [null, "1"],
    label: [...],
    color: [...]
}"""

# CIF Category

# annotation(category="my_annotation", id=1, schema="label-chain")
# annotation(category="my_annotation", id=2, schema="label-chain")
loop_
_my_annotation.annotation_id
_my_annotation.label_asym_id 
_my_annotation.label_entity_id 
_my_annotation.label
_my_annotation.label_color
1 A . 'label 1' '#121212'
1 B 1 'label 2' '#333333'
2 A . 'label 1' '#121212'
2 B 1 'label 2' '#333333'

# annotation(category="my_annotation_1", schema="label-chain", label_field="label")
# annotation(category="my_annotation_1", schema="label-chain", label_field="label_2")

# annotation(category="my_annotation_2", schema="label-chain")

_my_annotation_2.label_asym_id 
_my_annotation_2.label_entity_id 
_my_annotation_2.label
_my_annotation_2.label_color
_my_annotation_2.label_2
_my_annotation_2.label_3
dsehnal commented 1 year ago

I have pushed an example and relevant endpoints to master

JonStargaryen commented 1 year ago

Great, thanks!