<jupyter_start><jupyter_text>Common Uses and Use ModesThis notebook demonstrates *proposed* VR usage stylesLB: store gene symbol/idLB: variation type, other data "just for convenience"<jupyter_code>from ga4gh.core import ga4gh_identify
from ga4gh.vrs import models
from ga4gh.vrs.dataproxy import SeqRepoRESTDataProxy
from ga4gh.vrs.extras.translator import Translator

seqrepo_rest_service_url = "http://localhost:5000/seqrepo"

data_proxy = SeqRepoRESTDataProxy(base_url=seqrepo_rest_service_url)
tlr = Translator(data_proxy=data_proxy)<jupyter_output><empty_output><jupyter_text>To generate unique identifiers<jupyter_code>a = tlr.from_hgvs("NC_000013.11:g.32936732G>A")
str(a._id)<jupyter_output><empty_output><jupyter_text>As a storage or representation mechanism<jupyter_code>import json
import redis
db = redis.Redis()
a = tlr.from_hgvs("NC_000013.11:g.32936732G>A")
a_id = str(a._id)
a_id
a_data = a.as_dict()
a_data
# serialize object as json string, save to redis database
db.set(a_id, json.dumps(a_data))
# read json string from db, parse to dict
a2_data = json.loads(db.get(a_id))
a2_data
a2 = models.Allele(**a2_data)
a == a2
tlr.to_hgvs(a2)<jupyter_output><empty_output><jupyter_text>Associated with Annotations  Embedded in other objects<jupyter_code>patient_report = {
    "demo": {
        "name": "<NAME>",
    },
    "observed-variation": [
        a.as_dict()
    ],
    "clinical-findings": [
        {
            "vr_id": a._id._value,
            "name": "bad_humor",
            "severity": "he's got it bad",
            "prognosis": "will never be funny"
        }
    ],
    "display-names": {
        a._id._value: {
            "hgvs": [
                "NC_000013.11:g.32936732G>A"
            ],
            "dbsnp": [
                "rs9999999999"
            ]
        }
    }
}
print(json.dumps(patient_report, indent=2))<jupyter_output>{
  "demo": {
    "name": "<NAME>"
  },
  "observed-variation": [
    {
      "_id": "ga4gh:VA.mpIbo0Vv4HT-Oh3g5SWcuzAR2mue3yL-",
      "location": {
        "interval": {
          "end": 32936732,
          "start": 32936731,
          "type": "SimpleInterval"
        },
        "sequence_id": "ga4gh:SQ._0wi-qoDrvram155UmcSC-zA5ZK4fpLT",
        "type": "SequenceLocation"
      },
      "state": {
        "sequence": "A",
        "type": "SequenceState"
      },
      "type": "Allele"
    }
  ],
  "clinical-findings": [
    {
      "vr_id": "ga4gh:VA.mpIbo0Vv4HT-Oh3g5SWcuzAR2mue3yL-",
      "name": "bad_humor",
      "severity": "he's got it bad",
      "prognosis": "will never be funny"
    }
  ],
  "display-names": {
    "ga4gh:VA.mpIbo0Vv4HT-Oh3g5SWcuzAR2mue3yL-": {
      "hgvs": [
        "NC_000013.11:g.32936732G>A"
      ],
      "dbsnp": [
        "rs9999999999"
      ]
    }
  }
}
{'fraction_non_alphanumeric': 0.14085014409221902, 'fraction_numerical': 0.05187319884726225, 'mean_word_length': 2.873082287308229, 'pattern_counts': {'":': 35, '<': 18, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '473346', 'license': 'Apache-2.0', 'n_tokens_mistral': 1185, 'n_tokens_neox': 1081, 'n_words': 172, 'path': 'notebooks/sandbox/Usage Styles.ipynb', 'repo_name': 'GenomicMedLab/vrs-python', 'size': '2784'}