{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Annotate ClinVar entries with ACMG scores and GnomAD statistics\n",
    "\n",
    "Example of GeneBe Python client usage for annotating variants included in the ClinGen Evidence Repository (https://erepo.clinicalgenome.org/evrepo/). This example includes parsing HGVS entities, as this is how variants are represented in the downloaded version of Repository. In the end we will compare automatic ACMG classification with the human classifications from the Repository for each of the ACMG criteria. \n",
    "\n",
    "This is an example of using Pandas together with GeneBe. \n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Remember to have required packages installed\n",
    "\n",
    "# !pip install -U genebe\n",
    "# !pip install tqdm\n",
    "# !pip install ipywidgets\n",
    "# !pip install scikit-learn\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Download the ClinGen Variants"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(6105, 20)\n"
     ]
    }
   ],
   "source": [
    "import pandas as pd\n",
    "\n",
    "# download the ClinGen\n",
    "url = 'https://erepo.clinicalgenome.org/evrepo/api/classifications/all'\n",
    "\n",
    "erepo = pd.read_csv(url, sep='\\t')\n",
    "print(erepo.shape)\n",
    "\n",
    "host = 'https://api.genebe.net'\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Translate HGVS variants\n",
    "To proceed we have to convert HGVS variants to chr-pos-ref-alt. This can easily be done using `parse_hgvs`.\n",
    "\n",
    "Some of the variants are represented in non valid HGVS. They are omited."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Version:0.0.14\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 57/57 [00:23<00:00,  2.45it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Number of rows where 'variant' is an empty string: 54\n",
      "      index                                         #Variation  \\\n",
      "143     143            NM_206933.2(USH2A):c.12295-?_14133+?del   \n",
      "181     181  NM_000257.4(MYH7):c.2785_2787GAG[2] (p.Glu931del)   \n",
      "913     980      NM_000277.3(PAH):c.281_283TCA[1] (p.Ile95del)   \n",
      "931     999                 NM_002880.3(RAF1):c.-339_-338AG[1]   \n",
      "947    1023   NM_004700.4(KCNQ4):c.803_805CCT[1] (p.Ser269del)   \n",
      "1410   1546          NM_001001890.3(RUNX1):c.*2533_*2534TG[10]   \n",
      "1412   1550  NM_004360.5(CDH1):c.369_375CCGCCCC[3] (p.His12...   \n",
      "1413   1551      NM_004360.5(CDH1):c.436_437TC[1] (p.Pro147fs)   \n",
      "1415   1553  NM_004360.5(CDH1):c.32_34TGC[7] (p.Leu14_Leu15...   \n",
      "1466   1617    NM_004360.5(CDH1):c.1235_1236TA[3] (p.Ile415fs)   \n",
      "1479   1630  NM_004360.5(CDH1):c.2062_2063TG[1] (p.Cys688_G...   \n",
      "1485   1636       NM_004360.5(CDH1):c.32_34TGC[6] (p.Leu15dup)   \n",
      "1492   1643      NM_004360.5(CDH1):c.692_693TC[2] (p.His233fs)   \n",
      "1521   1693       NM_000277.3(PAH):c.578_579CT[1] (p.Leu194fs)   \n",
      "1983   2250     NM_004360.5(CDH1):c.2076_2077inv (p.Gly693Ser)   \n",
      "2009   2277  NM_001042723.2(RYR1):c.14407_14408inv (p.Phe48...   \n",
      "2060   2331       NM_000546.6(TP53):c.85_87AAC[1] (p.Asn30del)   \n",
      "2208   2524  NM_000257.4(MYH7):c.2649_2651GAA[1] (p.Lys884del)   \n",
      "2398   2732               NM_000527.4(LDLR):c.1061-?_1845+?del   \n",
      "2399   2733         NC_000021.9:g.(?_35048832)_(35049298_?)del   \n",
      "2402   2736                                      ETHE1, EX4DEL   \n",
      "2411   2746                              NM_005465.5:c.1082A>G   \n",
      "2889   3235      NC_000011.10:g.(?_108287594)_(108287721_?)del   \n",
      "2890   3236       NC_000011.9:g.(?_108137888)_(108225611_?)dup   \n",
      "3027   3379      NM_000018.2(ACADVL):c.343delG (p.Glu115Lysfs)   \n",
      "3112   3469  NM_000545.6(HNF1A):c.1720_1733delGGCATCCAGCACC...   \n",
      "3121   3480     NM_000545.6(HNF1A):c.788_789GT[1] (p.Val264fs)   \n",
      "3153   3512                        c.(?_-187)_(190+1_191-1)del   \n",
      "3424   3801                         NC_012920.1:m.3902_3908inv   \n",
      "3603   3983  NM_001042723.2(RYR1):c.7039_7041GAG[1] (p.Glu2...   \n",
      "3744   4135  NM_000018.4(ACADVL):c.1804_1805CT[1] (p.Leu602...   \n",
      "3852   4245    NM_005629.4(SLC6A8):c.568_569TG[1] (p.Ala191fs)   \n",
      "3855   4248    NM_005629.4(SLC6A8):c.746_747GT[1] (p.Val250fs)   \n",
      "3859   4252  NM_005629.4(SLC6A8):c.940_944TTCTT[1] (p.Phe31...   \n",
      "3949   4354                                 ITGB3, 11.2-KB DEL   \n",
      "4349   4805       NC_000005.9:g.(?_112116481)_(112179829_?)dup   \n",
      "4350   4806      NC_000005.10:g.(?_112707312)_(112707902_?)del   \n",
      "4351   4807      NC_000005.10:g.(?_112775619)_(112801393_?)del   \n",
      "4543   5010                 NM_000527.4(LDLR):c.191-?_940+?del   \n",
      "4554   5021                NM_000527.4(LDLR):c.941-?_1060+?del   \n",
      "4556   5023                 NM_000527.4(LDLR):c.695-?_817+?del   \n",
      "4563   5030               NM_000527.4(LDLR):c.2312-?_2547+?del   \n",
      "4585   5052               NM_000527.4(LDLR):c.2390-?_2547+?del   \n",
      "4716   5191   NM_000138.4(FBN1):c.7165_7166CT[1] (p.Cys2390fs)   \n",
      "4815   5292  NM_005629.4(SLC6A8):c.1000_1002AAC[2] (p.Asn33...   \n",
      "4918   5402                               NM_004360.4:c.425A>G   \n",
      "5370   5863         NC_000021.9:g.(?_34787801)_(35048958_?)del   \n",
      "5372   5865         NC_000021.9:g.(?_34799291)_(35049298_?)del   \n",
      "5374   5867         NC_000021.9:g.(?_34880547)_(34880723_?)del   \n",
      "5396   5889                 NC_000021.8:g.35304341_36865875del   \n",
      "5397   5890         NC_000021.8:g.(?_36231761)_(36231885_?)del   \n",
      "5400   5893    GRCh37/hg19 21q22.12(chr21:36164432-36421257)x1   \n",
      "5425   5920      NM_000277.3(PAH):c.113_115TCT[1] (p.Phe39del)   \n",
      "5457   5953     NM_005629.4(SLC6A8):c.1216TTC[2] (p.Phe408del)   \n",
      "\n",
      "     ClinVar Variation Id Allele Registry Id  \\\n",
      "143                177859                  -   \n",
      "181                 42934                  -   \n",
      "913                   604           CA251535   \n",
      "931                 40573           CA177689   \n",
      "947                208366                  -   \n",
      "1410               339827         CA10653557   \n",
      "1412               567576                  -   \n",
      "1413               491536                  -   \n",
      "1415               142455                  -   \n",
      "1466               428622                  -   \n",
      "1479               140781                  -   \n",
      "1485               220798                  -   \n",
      "1492               406615                  -   \n",
      "1521               102741           CA229632   \n",
      "1983               220300           CA349680   \n",
      "2009               478199        CA658658815   \n",
      "2060               142158           CA358484   \n",
      "2208                36637           CA012790   \n",
      "2398               265901                  -   \n",
      "2399               650703                  -   \n",
      "2402                 2323                  -   \n",
      "2411              1296988          CA1483974   \n",
      "2889               453341                  -   \n",
      "2890               583716                  -   \n",
      "3027                 1624           CA220206   \n",
      "3112               134513        CA915946722   \n",
      "3121               447500                  -   \n",
      "3153               250933                  -   \n",
      "3424                 9731           CA082749   \n",
      "3603               133180                  -   \n",
      "3744               203593                  -   \n",
      "3852               449366                  -   \n",
      "3855               452407                  -   \n",
      "3859               633583                  -   \n",
      "3949                13563                  -   \n",
      "4349               537703                  -   \n",
      "4350               429040                  -   \n",
      "4351               642643                  -   \n",
      "4543               431508                  -   \n",
      "4554               417370                  -   \n",
      "4556               431513                  -   \n",
      "4563               431547                  -   \n",
      "4585               226402                  -   \n",
      "4716                42420                  -   \n",
      "4815               265402                  -   \n",
      "4918               584516                  -   \n",
      "5370               417476                  -   \n",
      "5372               832666                  -   \n",
      "5374               833071                  -   \n",
      "5396               812913                  -   \n",
      "5397              1067688                  -   \n",
      "5400              1013200                  -   \n",
      "5425               188933                  -   \n",
      "5457                11698                  -   \n",
      "\n",
      "                                       HGVS Expressions HGNC Gene Symbol  \\\n",
      "143   NM_206933.2:c.12295-?_14133+?del, NM_206933.3(...            USH2A   \n",
      "181   NM_000257.4:c.2785_2787GAG[2], NM_000257.4(MYH...             MYH7   \n",
      "913   NM_000277.3:c.281_283TCA[1], NM_000277.1:c.284...              PAH   \n",
      "931   NM_002880.3:c.-339_-338AG[1], NM_002880.3:c.-3...             RAF1   \n",
      "947   NM_004700.4:c.803_805CCT[1], NM_004700.4(KCNQ4...            KCNQ4   \n",
      "1410  NM_001001890.3:c.*2533_*2534TG[10], NC_000021....            RUNX1   \n",
      "1412  NM_004360.5:c.369_375CCGCCCC[3], NM_004360.5(C...             CDH1   \n",
      "1413  NM_004360.5:c.436_437TC[1], NM_004360.5(CDH1):...             CDH1   \n",
      "1415  NM_004360.5:c.32_34TGC[7], NM_004360.5(CDH1):c...             CDH1   \n",
      "1466  NM_004360.5:c.1235_1236TA[3], NM_004360.5(CDH1...             CDH1   \n",
      "1479  NM_004360.5:c.2062_2063TG[1], NM_004360.5(CDH1...             CDH1   \n",
      "1485  NM_004360.5:c.32_34TGC[6], NM_004360.5(CDH1):c...             CDH1   \n",
      "1492  NM_004360.5:c.692_693TC[2], NM_004360.5(CDH1):...             CDH1   \n",
      "1521  NM_000277.3:c.578_579CT[1], NC_000012.12:g.102...              PAH   \n",
      "1983  NM_004360.5:c.2076_2077inv, NC_000016.10:g.688...             CDH1   \n",
      "2009  NM_001042723.2:c.14407_14408inv, NC_000019.10:...             RYR1   \n",
      "2060  NM_000546.6:c.85_87AAC[1], ENST00000269305.9:c...             TP53   \n",
      "2208  NM_000257.4:c.2649_2651GAA[1], ENST00000355349...             MYH7   \n",
      "2398  NM_000527.4:c.1061-?_1845+?del, NM_000527.4(LD...             LDLR   \n",
      "2399         NC_000021.9:g.(?_35048832)_(35049298_?)del            RUNX1   \n",
      "2402                                      ETHE1, EX4DEL              NaN   \n",
      "2411  NM_005465.5:c.1082A>G, NC_000001.11:g.24355281...             AKT3   \n",
      "2889      NC_000011.10:g.(?_108287594)_(108287721_?)del              ATM   \n",
      "2890       NC_000011.9:g.(?_108137888)_(108225611_?)dup              NaN   \n",
      "3027  NC_000017.11:g.7220924del, CM000679.2:g.722092...           ACADVL   \n",
      "3112  NC_000012.12:g.120999592del, CM000674.2:g.1209...            HNF1A   \n",
      "3121  NM_000545.6:c.790_791del, NM_000545.8(HNF1A):c...            HNF1A   \n",
      "3153                        c.(?_-187)_(190+1_191-1)del             LDLR   \n",
      "3424  NC_012920.1:m.3902_3908inv, NC_012920.1:m.3902...           MT-ND1   \n",
      "3603  NM_001042723.2:c.7039_7041GAG[1], NM_000540.3(...             RYR1   \n",
      "3744  NM_000018.4:c.1804_1805CT[1], NM_000018.4(ACAD...           ACADVL   \n",
      "3852  NM_005629.4:c.568_569TG[1], NM_005629.4(SLC6A8...           SLC6A8   \n",
      "3855  NM_005629.4:c.746_747GT[1], NM_005629.4(SLC6A8...           SLC6A8   \n",
      "3859  NM_005629.4:c.940_944TTCTT[1], NM_005629.4(SLC...           SLC6A8   \n",
      "3949   NG_008332.2:g.48605_58661del, ITGB3, 11.2-KB DEL            ITGB3   \n",
      "4349       NC_000005.9:g.(?_112116481)_(112179829_?)dup              APC   \n",
      "4350      NC_000005.10:g.(?_112707312)_(112707902_?)del              APC   \n",
      "4351      NC_000005.10:g.(?_112775619)_(112801393_?)del              APC   \n",
      "4543                 NM_000527.4(LDLR):c.191-?_940+?del             LDLR   \n",
      "4554                NM_000527.4(LDLR):c.941-?_1060+?del             LDLR   \n",
      "4556                 NM_000527.4(LDLR):c.695-?_817+?del             LDLR   \n",
      "4563               NM_000527.4(LDLR):c.2312-?_2547+?del             LDLR   \n",
      "4585               NM_000527.4(LDLR):c.2390-?_2547+?del             LDLR   \n",
      "4716  NM_000138.4:c.7165_7166CT[1], NM_000138.4:c.71...             FBN1   \n",
      "4815  NM_005629.4:c.1000_1002AAC[2], NM_005629.4(SLC...           SLC6A8   \n",
      "4918                               NM_004360.4:c.425A>G              NaN   \n",
      "5370         NC_000021.9:g.(?_34787801)_(35048958_?)del              NaN   \n",
      "5372         NC_000021.9:g.(?_34799291)_(35049298_?)del              NaN   \n",
      "5374         NC_000021.9:g.(?_34880547)_(34880723_?)del              NaN   \n",
      "5396                 NC_000021.8:g.35304341_36865875del              NaN   \n",
      "5397         NC_000021.8:g.(?_36231761)_(36231885_?)del              NaN   \n",
      "5400    GRCh37/hg19 21q22.12(chr21:36164432-36421257)x1              NaN   \n",
      "5425  NM_000277.3:c.113_115TCT[1], NM_000277.3(PAH):...              PAH   \n",
      "5457  NM_005629.4:c.1222_1224del, NM_005629.4(SLC6A8...           SLC6A8   \n",
      "\n",
      "                                                Disease       Mondo Id  \\\n",
      "143                                      Usher syndrome  MONDO:0019501   \n",
      "181                         hypertrophic cardiomyopathy  MONDO:0005045   \n",
      "913                                     phenylketonuria  MONDO:0009861   \n",
      "931                                           RASopathy  MONDO:0021060   \n",
      "947                       nonsyndromic genetic deafness  MONDO:0019497   \n",
      "1410  hereditary thrombocytopenia and hematologic ca...  MONDO:0011071   \n",
      "1412  CDH1-related diffuse gastric and lobular breas...  MONDO:0007648   \n",
      "1413  CDH1-related diffuse gastric and lobular breas...  MONDO:0007648   \n",
      "1415  CDH1-related diffuse gastric and lobular breas...  MONDO:0007648   \n",
      "1466  CDH1-related diffuse gastric and lobular breas...  MONDO:0007648   \n",
      "1479  CDH1-related diffuse gastric and lobular breas...  MONDO:0007648   \n",
      "1485  CDH1-related diffuse gastric and lobular breas...  MONDO:0007648   \n",
      "1492  CDH1-related diffuse gastric and lobular breas...  MONDO:0007648   \n",
      "1521                                    phenylketonuria  MONDO:0009861   \n",
      "1983  CDH1-related diffuse gastric and lobular breas...  MONDO:0007648   \n",
      "2009               malignant hyperthermia of anesthesia  MONDO:0018493   \n",
      "2060                             Li-Fraumeni syndrome 1  MONDO:0007903   \n",
      "2208                        hypertrophic cardiomyopathy  MONDO:0005045   \n",
      "2398                     hypercholesterolemia, familial  MONDO:0007750   \n",
      "2399  hereditary thrombocytopenia and hematologic ca...  MONDO:0011071   \n",
      "2402                        ethylmalonic encephalopathy  MONDO:0011229   \n",
      "2411  overgrowth syndrome and/or cerebral malformati...  MONDO:0016054   \n",
      "2889                           hereditary breast cancer  MONDO:0016419   \n",
      "2890                           hereditary breast cancer  MONDO:0016419   \n",
      "3027  very long chain acyl-CoA dehydrogenase deficiency  MONDO:0008723   \n",
      "3112                                 monogenic diabetes  MONDO:0015967   \n",
      "3121                                 monogenic diabetes  MONDO:0015967   \n",
      "3153                     hypercholesterolemia, familial  MONDO:0007750   \n",
      "3424                              mitochondrial disease  MONDO:0044970   \n",
      "3603       malignant hyperthermia, susceptibility to, 1  MONDO:0007783   \n",
      "3744  very long chain acyl-CoA dehydrogenase deficiency  MONDO:0008723   \n",
      "3852                    creatine transporter deficiency  MONDO:0010305   \n",
      "3855                    creatine transporter deficiency  MONDO:0010305   \n",
      "3859                    creatine transporter deficiency  MONDO:0010305   \n",
      "3949                           Glanzmann thrombasthenia  MONDO:0100326   \n",
      "4349                   familial adenomatous polyposis 1  MONDO:0021056   \n",
      "4350                   familial adenomatous polyposis 1  MONDO:0021056   \n",
      "4351                   familial adenomatous polyposis 1  MONDO:0021056   \n",
      "4543                     hypercholesterolemia, familial  MONDO:0007750   \n",
      "4554                     hypercholesterolemia, familial  MONDO:0007750   \n",
      "4556                     hypercholesterolemia, familial  MONDO:0007750   \n",
      "4563                     hypercholesterolemia, familial  MONDO:0007750   \n",
      "4585                     hypercholesterolemia, familial  MONDO:0007750   \n",
      "4716                                    Marfan syndrome  MONDO:0007947   \n",
      "4815                    creatine transporter deficiency  MONDO:0010305   \n",
      "4918  CDH1-related diffuse gastric and lobular breas...  MONDO:0100488   \n",
      "5370  hereditary thrombocytopenia and hematologic ca...  MONDO:0011071   \n",
      "5372  hereditary thrombocytopenia and hematologic ca...  MONDO:0011071   \n",
      "5374  hereditary thrombocytopenia and hematologic ca...  MONDO:0011071   \n",
      "5396  hereditary thrombocytopenia and hematologic ca...  MONDO:0011071   \n",
      "5397  hereditary thrombocytopenia and hematologic ca...  MONDO:0011071   \n",
      "5400  hereditary thrombocytopenia and hematologic ca...  MONDO:0011071   \n",
      "5425                                    phenylketonuria  MONDO:0009861   \n",
      "5457                    creatine transporter deficiency  MONDO:0010305   \n",
      "\n",
      "                          Mode of Inheritance               Assertion  ...  \\\n",
      "143           Autosomal recessive inheritance       Likely Pathogenic  ...   \n",
      "181            Autosomal dominant inheritance       Likely Pathogenic  ...   \n",
      "913           Autosomal recessive inheritance              Pathogenic  ...   \n",
      "931            Autosomal dominant inheritance                  Benign  ...   \n",
      "947            Autosomal dominant inheritance              Pathogenic  ...   \n",
      "1410           Autosomal dominant inheritance                  Benign  ...   \n",
      "1412           Autosomal dominant inheritance              Pathogenic  ...   \n",
      "1413           Autosomal dominant inheritance              Pathogenic  ...   \n",
      "1415           Autosomal dominant inheritance           Likely Benign  ...   \n",
      "1466           Autosomal dominant inheritance              Pathogenic  ...   \n",
      "1479           Autosomal dominant inheritance              Pathogenic  ...   \n",
      "1485           Autosomal dominant inheritance           Likely Benign  ...   \n",
      "1492           Autosomal dominant inheritance              Pathogenic  ...   \n",
      "1521          Autosomal recessive inheritance              Pathogenic  ...   \n",
      "1983           Autosomal dominant inheritance           Likely Benign  ...   \n",
      "2009           Autosomal dominant inheritance  Uncertain Significance  ...   \n",
      "2060           Autosomal dominant inheritance  Uncertain Significance  ...   \n",
      "2208           Autosomal dominant inheritance  Uncertain Significance  ...   \n",
      "2398                 Semidominant inheritance              Pathogenic  ...   \n",
      "2399           Autosomal dominant inheritance              Pathogenic  ...   \n",
      "2402          Autosomal recessive inheritance              Pathogenic  ...   \n",
      "2411  Autosomal dominant inheritance (mosaic)           Likely Benign  ...   \n",
      "2889           Autosomal dominant inheritance              Pathogenic  ...   \n",
      "2890           Autosomal dominant inheritance       Likely Pathogenic  ...   \n",
      "3027          Autosomal recessive inheritance              Pathogenic  ...   \n",
      "3112           Autosomal dominant inheritance       Likely Pathogenic  ...   \n",
      "3121           Autosomal dominant inheritance       Likely Pathogenic  ...   \n",
      "3153                 Semidominant inheritance              Pathogenic  ...   \n",
      "3424                Mitochondrial inheritance       Likely Pathogenic  ...   \n",
      "3603           Autosomal dominant inheritance       Likely Pathogenic  ...   \n",
      "3744          Autosomal recessive inheritance       Likely Pathogenic  ...   \n",
      "3852                     X-linked inheritance              Pathogenic  ...   \n",
      "3855                     X-linked inheritance       Likely Pathogenic  ...   \n",
      "3859                     X-linked inheritance       Likely Pathogenic  ...   \n",
      "3949          Autosomal recessive inheritance              Pathogenic  ...   \n",
      "4349           Autosomal dominant inheritance  Uncertain Significance  ...   \n",
      "4350           Autosomal dominant inheritance              Pathogenic  ...   \n",
      "4351           Autosomal dominant inheritance       Likely Pathogenic  ...   \n",
      "4543                 Semidominant inheritance       Likely Pathogenic  ...   \n",
      "4554                 Semidominant inheritance              Pathogenic  ...   \n",
      "4556                 Semidominant inheritance       Likely Pathogenic  ...   \n",
      "4563                 Semidominant inheritance       Likely Pathogenic  ...   \n",
      "4585                 Semidominant inheritance              Pathogenic  ...   \n",
      "4716           Autosomal dominant inheritance              Pathogenic  ...   \n",
      "4815                     X-linked inheritance              Pathogenic  ...   \n",
      "4918           Autosomal dominant inheritance  Uncertain Significance  ...   \n",
      "5370           Autosomal dominant inheritance              Pathogenic  ...   \n",
      "5372           Autosomal dominant inheritance              Pathogenic  ...   \n",
      "5374           Autosomal dominant inheritance              Pathogenic  ...   \n",
      "5396           Autosomal dominant inheritance              Pathogenic  ...   \n",
      "5397           Autosomal dominant inheritance              Pathogenic  ...   \n",
      "5400           Autosomal dominant inheritance       Likely Pathogenic  ...   \n",
      "5425          Autosomal recessive inheritance              Pathogenic  ...   \n",
      "5457                     X-linked inheritance              Pathogenic  ...   \n",
      "\n",
      "                              Summary of interpretation  \\\n",
      "143   The variant NM_206933.3:c.12295-?_14133+?del i...   \n",
      "181   The NM_000257.3(MYH7):c.2791_2793delGAG (p.Glu...   \n",
      "913   This variant was documented in 8 patients diag...   \n",
      "931   The c.-339_-338delAG variant in RAF1 is classi...   \n",
      "947   The c.803_805CCT[1] (aka c.806_808del) variant...   \n",
      "1410  The NM_001001890.3:c.*2533_*2534TG[10] (or c.*...   \n",
      "1412  The c.369_375CCGCCCC[3] (p.His128Profs*42) var...   \n",
      "1413  The c.438_439delTC p.(Pro147Trpfs*20) variant ...   \n",
      "1415  The c.32_34TGC[7] (p.Leu14_Leu15dup) variant r...   \n",
      "1466  The c.1235_1236TA[3] (p.Ile415fs) variant is p...   \n",
      "1479  The c.2064_2065delTG (p.Cys688Terfs) variant i...   \n",
      "1485  The c.32_34TGC[6] (p.Leu15dup), also referred ...   \n",
      "1492  The c.696_697delTC p.(His233fs) variant is pre...   \n",
      "1521  The c.578_579del PAH variant has been identifi...   \n",
      "1983  The c.2076_2077inv (p.Gly693Ser) variant has b...   \n",
      "2009  This pathogenicity assessment is relevant only...   \n",
      "2060  This variant has been observed in 2-7 60+ year...   \n",
      "2208  The c.2652_2654delGAA (p.Lys884del) variant in...   \n",
      "2398  The NM_000527.4(LDLR):c.1061-?_1845+?del varia...   \n",
      "2399  Deletion of exons 1-3 including the initiation...   \n",
      "2402  The ETHE1 EX4DEL mutation is a predicted null ...   \n",
      "2411  The c.1082A>G (NM_005465.7) variant in AKT3 is...   \n",
      "2889  The ATM EX27del variant is absent from gnomAD ...   \n",
      "2890  The ATM EX16_60dup variant is presumed to be a...   \n",
      "3027  The NM_000018.4(ACADVL): c.343del (p.Glu115Lys...   \n",
      "3112  The c.1720_1733del variant in the HNF1 homeobo...   \n",
      "3121  The c.790_791del variant in the  HNF1 homeobox...   \n",
      "3153  The NM_000527.5 (LDLR):c.(?_-187)_(190+1_191-1...   \n",
      "3424  The m.3902_3908inv (p.DLA199GKV) variant in MT...   \n",
      "3603  This pathogenicity assessment is relevant only...   \n",
      "3744  The c.1806_1807del (p.Leu602_Cys603insTer) var...   \n",
      "3852  The NM_005629.4:c.570_571del (p.Ala191GlnfsTer...   \n",
      "3855  The NM_005629.4:c.746_747delGT (p.Val250LeufsT...   \n",
      "3859  The NM_005629.4:c.940_944delTTCTT (p.Phe315Leu...   \n",
      "3949  The 11.2kb deletion in ITGB3 (NC_000017.11:g.4...   \n",
      "4349  The NC_000005.9:g.(?_112116481)_(112179829_?)d...   \n",
      "4350  The NC_000005.10:g.(?_112707312)_(112707902_?)...   \n",
      "4351  The NC_000005.10:g.(?_112775619)_(112801393_?)...   \n",
      "4543  The NM_000527.4(LDLR):c.191-?_940+?del variant...   \n",
      "4554  The NM_000527.4(LDLR):c.941-?_1060+?del varian...   \n",
      "4556  The NM_000527.4(LDLR):c.695-?_817+?del variant...   \n",
      "4563  The NM_000527.4(LDLR):c.2312-?_2547+?del varia...   \n",
      "4585  The NM_000527.5(LDLR):c.2390-?_2547+?del varia...   \n",
      "4716  The NM_00138 c.7165_7166, is a frameshift vari...   \n",
      "4815  The NM_005629.4:c.1000_1002delAAC variant in S...   \n",
      "4918  The c.425T>C (NM_004360.5) variant in CDH1 is ...   \n",
      "5370  NC_000021.9:g.(?_34787801)_(35048958_?)del res...   \n",
      "5372  This is a full gene deletion and is classified...   \n",
      "5374  NC_000021.9:g.(?_34880547)_(34880723_?)del cau...   \n",
      "5396  This variant is completely absent from all pop...   \n",
      "5397  This variant is a frameshift variant resulting...   \n",
      "5400  GRCh37/hg19 21q22.12(chr21:36164432-36421257)x...   \n",
      "5425  This c.113_115TCTdel (p.Phe39del) variant is a...   \n",
      "5457  The NM_005629.4:c.1222_1224del variant in SLC6...   \n",
      "\n",
      "                                        PubMed Articles  \\\n",
      "143                                            26969326   \n",
      "181                                                 NaN   \n",
      "913   29316886, 19292873, 25894915, 26666653, 243686...   \n",
      "931                                                 NaN   \n",
      "947                                            34316018   \n",
      "1410                                                NaN   \n",
      "1412                                                NaN   \n",
      "1413                                                NaN   \n",
      "1415                                                NaN   \n",
      "1466                                                NaN   \n",
      "1479                                                NaN   \n",
      "1485                                                NaN   \n",
      "1492                                                NaN   \n",
      "1521                                           26666653   \n",
      "1983                                                NaN   \n",
      "2009                                                NaN   \n",
      "2060                                                NaN   \n",
      "2208                                                NaN   \n",
      "2398                                                NaN   \n",
      "2399                                                NaN   \n",
      "2402  16183799, 20978941, 21048580, 20528888, 161837...   \n",
      "2411                                                NaN   \n",
      "2889                                                NaN   \n",
      "2890                                                NaN   \n",
      "3027                                                NaN   \n",
      "3112                                                NaN   \n",
      "3121                                                NaN   \n",
      "3153                                                NaN   \n",
      "3424                                                NaN   \n",
      "3603                                                NaN   \n",
      "3744                                                NaN   \n",
      "3852                                                NaN   \n",
      "3855                                                NaN   \n",
      "3859                                                NaN   \n",
      "3949                                                NaN   \n",
      "4349                                                NaN   \n",
      "4350                                                NaN   \n",
      "4351                                                NaN   \n",
      "4543                                                NaN   \n",
      "4554                                                NaN   \n",
      "4556                                                NaN   \n",
      "4563                                                NaN   \n",
      "4585                                                NaN   \n",
      "4716                                                NaN   \n",
      "4815                                                NaN   \n",
      "4918                                                NaN   \n",
      "5370                                                NaN   \n",
      "5372                                                NaN   \n",
      "5374                                                NaN   \n",
      "5396                                                NaN   \n",
      "5397             10508512, 11830488, 10508512, 11830488   \n",
      "5400                                                NaN   \n",
      "5425  16256386, 23500595, 12655550, 29102225, 265427...   \n",
      "5457                                                NaN   \n",
      "\n",
      "                                           Expert Panel  \\\n",
      "143                                   Hearing Loss VCEP   \n",
      "181                                 Cardiomyopathy VCEP   \n",
      "913                                Phenylketonuria VCEP   \n",
      "931                                      RASopathy VCEP   \n",
      "947                                   Hearing Loss VCEP   \n",
      "1410                            Myeloid Malignancy VCEP   \n",
      "1412                                          CDH1 VCEP   \n",
      "1413                                          CDH1 VCEP   \n",
      "1415                                          CDH1 VCEP   \n",
      "1466                                          CDH1 VCEP   \n",
      "1479                                          CDH1 VCEP   \n",
      "1485                                          CDH1 VCEP   \n",
      "1492                                          CDH1 VCEP   \n",
      "1521                               Phenylketonuria VCEP   \n",
      "1983                                          CDH1 VCEP   \n",
      "2009         Malignant Hyperthermia Susceptibility VCEP   \n",
      "2060                                          TP53 VCEP   \n",
      "2208                                Cardiomyopathy VCEP   \n",
      "2398                 Familial Hypercholesterolemia VCEP   \n",
      "2399                            Myeloid Malignancy VCEP   \n",
      "2402                        Mitochondrial Diseases VCEP   \n",
      "2411                           Brain Malformations VCEP   \n",
      "2889  Hereditary Breast, Ovarian and Pancreatic Canc...   \n",
      "2890  Hereditary Breast, Ovarian and Pancreatic Canc...   \n",
      "3027                                        ACADVL VCEP   \n",
      "3112                            Monogenic Diabetes VCEP   \n",
      "3121                            Monogenic Diabetes VCEP   \n",
      "3153                 Familial Hypercholesterolemia VCEP   \n",
      "3424                        Mitochondrial Diseases VCEP   \n",
      "3603         Malignant Hyperthermia Susceptibility VCEP   \n",
      "3744                                        ACADVL VCEP   \n",
      "3852        Cerebral Creatine Deficiency Syndromes VCEP   \n",
      "3855        Cerebral Creatine Deficiency Syndromes VCEP   \n",
      "3859        Cerebral Creatine Deficiency Syndromes VCEP   \n",
      "3949                            Platelet Disorders VCEP   \n",
      "4349  InSiGHT Hereditary Colorectal Cancer/Polyposis...   \n",
      "4350  InSiGHT Hereditary Colorectal Cancer/Polyposis...   \n",
      "4351  InSiGHT Hereditary Colorectal Cancer/Polyposis...   \n",
      "4543                 Familial Hypercholesterolemia VCEP   \n",
      "4554                 Familial Hypercholesterolemia VCEP   \n",
      "4556                 Familial Hypercholesterolemia VCEP   \n",
      "4563                 Familial Hypercholesterolemia VCEP   \n",
      "4585                 Familial Hypercholesterolemia VCEP   \n",
      "4716                                          FBN1 VCEP   \n",
      "4815        Cerebral Creatine Deficiency Syndromes VCEP   \n",
      "4918                                          CDH1 VCEP   \n",
      "5370                            Myeloid Malignancy VCEP   \n",
      "5372                            Myeloid Malignancy VCEP   \n",
      "5374                            Myeloid Malignancy VCEP   \n",
      "5396                            Myeloid Malignancy VCEP   \n",
      "5397                            Myeloid Malignancy VCEP   \n",
      "5400                            Myeloid Malignancy VCEP   \n",
      "5425                               Phenylketonuria VCEP   \n",
      "5457        Cerebral Creatine Deficiency Syndromes VCEP   \n",
      "\n",
      "                                              Guideline Approval Date  \\\n",
      "143   https://clinicalgenome.org/site/assets/files/7...    2023-09-26   \n",
      "181   https://clinicalgenome.org/docs/clingen-cardio...    2021-11-23   \n",
      "913   https://clinicalgenome.org/docs/clingen-pah-ex...    2019-10-18   \n",
      "931   https://www.clinicalgenome.org/docs/clingen-ra...    2019-11-04   \n",
      "947   https://clinicalgenome.org/site/assets/files/7...    2023-06-27   \n",
      "1410  https://www.clinicalgenome.org/affiliation/500...    2020-01-13   \n",
      "1412  https://www.clinicalgenome.org/site/assets/fil...    2023-08-04   \n",
      "1413  https://www.clinicalgenome.org/site/assets/fil...    2023-08-04   \n",
      "1415  https://www.clinicalgenome.org/site/assets/fil...    2023-08-18   \n",
      "1466  https://www.clinicalgenome.org/site/assets/fil...    2023-08-25   \n",
      "1479  https://www.clinicalgenome.org/site/assets/fil...    2023-08-25   \n",
      "1485  https://www.clinicalgenome.org/site/assets/fil...    2023-08-17   \n",
      "1492  https://www.clinicalgenome.org/site/assets/fil...    2023-08-04   \n",
      "1521  https://clinicalgenome.org/docs/clingen-pah-ex...    2020-10-30   \n",
      "1983  https://www.clinicalgenome.org/site/assets/fil...    2023-08-17   \n",
      "2009  https://clinicalgenome.org/docs/clingen-malign...    2023-04-06   \n",
      "2060                                                NaN    2021-04-30   \n",
      "2208  https://clinicalgenome.org/docs/clingen-cardio...    2021-03-22   \n",
      "2398  https://clinicalgenome.org/docs/clingen-famili...    2021-07-01   \n",
      "2399  https://www.clinicalgenome.org/affiliation/500...    2021-01-11   \n",
      "2402  https://www.clinicalgenome.org/affiliation/500...    2020-08-18   \n",
      "2411  https://clinicalgenome.org/docs/clingen-brain-...    2022-02-11   \n",
      "2889                                                NaN    2022-03-09   \n",
      "2890                                                NaN    2022-03-09   \n",
      "3027  https://clinicalgenome.org/site/assets/files/7...    2021-11-09   \n",
      "3112                                                NaN    2022-04-17   \n",
      "3121                                                NaN    2022-04-18   \n",
      "3153  https://clinicalgenome.org/docs/clingen-famili...    2022-03-25   \n",
      "3424  https://www.clinicalgenome.org/affiliation/500...    2022-06-30   \n",
      "3603  https://clinicalgenome.org/docs/clingen-malign...    2023-04-06   \n",
      "3744  https://clinicalgenome.org/site/assets/files/7...    2022-09-22   \n",
      "3852                                                NaN    2022-06-06   \n",
      "3855                                                NaN    2022-06-06   \n",
      "3859                                                NaN    2022-06-06   \n",
      "3949  https://clinicalgenome.org/docs/clingen-platel...    2022-04-07   \n",
      "4349                                                NaN    2023-02-26   \n",
      "4350                                                NaN    2023-02-26   \n",
      "4351                                                NaN    2023-02-26   \n",
      "4543  https://clinicalgenome.org/docs/clingen-famili...    2023-04-28   \n",
      "4554  https://clinicalgenome.org/docs/clingen-famili...    2023-04-28   \n",
      "4556  https://clinicalgenome.org/docs/clingen-famili...    2023-04-28   \n",
      "4563  https://clinicalgenome.org/docs/clingen-famili...    2023-04-28   \n",
      "4585  https://clinicalgenome.org/docs/clingen-famili...    2023-04-28   \n",
      "4716  https://clinicalgenome.org/docs/clingen-fbn1-e...    2023-06-15   \n",
      "4815                                                NaN    2023-05-11   \n",
      "4918  https://www.clinicalgenome.org/site/assets/fil...    2023-08-02   \n",
      "5370  https://www.clinicalgenome.org/affiliation/500...    2023-12-09   \n",
      "5372  https://www.clinicalgenome.org/affiliation/500...    2023-12-09   \n",
      "5374  https://www.clinicalgenome.org/affiliation/500...    2023-12-09   \n",
      "5396  https://www.clinicalgenome.org/affiliation/500...    2023-12-09   \n",
      "5397  https://www.clinicalgenome.org/affiliation/500...    2023-12-09   \n",
      "5400  https://www.clinicalgenome.org/affiliation/500...    2023-12-09   \n",
      "5425  https://clinicalgenome.org/docs/clingen-pah-ex...    2023-12-30   \n",
      "5457                                                NaN    2023-08-22   \n",
      "\n",
      "     Published Date Retracted  \\\n",
      "143      2023-10-05     False   \n",
      "181      2021-12-09     False   \n",
      "913      2019-10-18     False   \n",
      "931      2019-11-04     False   \n",
      "947      2023-10-05     False   \n",
      "1410     2020-01-14     False   \n",
      "1412     2023-08-04     False   \n",
      "1413     2023-08-04     False   \n",
      "1415     2023-08-18     False   \n",
      "1466     2023-08-25     False   \n",
      "1479     2023-08-25     False   \n",
      "1485     2023-08-17     False   \n",
      "1492     2023-08-04     False   \n",
      "1521     2020-10-30     False   \n",
      "1983     2023-08-17     False   \n",
      "2009     2023-04-06     False   \n",
      "2060     2021-06-16     False   \n",
      "2208     2021-08-25     False   \n",
      "2398     2021-07-01     False   \n",
      "2399     2021-01-11     False   \n",
      "2402     2021-10-13     False   \n",
      "2411     2022-02-11     False   \n",
      "2889     2022-07-11     False   \n",
      "2890     2022-07-11     False   \n",
      "3027     2022-04-06     False   \n",
      "3112     2022-04-17     False   \n",
      "3121     2022-04-18     False   \n",
      "3153     2022-04-25     False   \n",
      "3424     2022-06-30     False   \n",
      "3603     2023-04-06     False   \n",
      "3744     2022-09-22     False   \n",
      "3852     2022-10-08     False   \n",
      "3855     2022-10-08     False   \n",
      "3859     2022-10-08     False   \n",
      "3949     2022-12-07     False   \n",
      "4349     2023-03-14     False   \n",
      "4350     2023-03-14     False   \n",
      "4351     2023-03-14     False   \n",
      "4543     2023-04-30     False   \n",
      "4554     2023-04-30     False   \n",
      "4556     2023-04-30     False   \n",
      "4563     2023-05-01     False   \n",
      "4585     2023-05-01     False   \n",
      "4716     2023-06-15     False   \n",
      "4815     2023-07-03     False   \n",
      "4918     2023-08-02     False   \n",
      "5370     2023-12-09     False   \n",
      "5372     2023-12-09     False   \n",
      "5374     2023-12-09     False   \n",
      "5396     2023-12-09     False   \n",
      "5397     2023-12-09     False   \n",
      "5400     2023-12-09     False   \n",
      "5425     2023-12-30     False   \n",
      "5457     2023-08-24     False   \n",
      "\n",
      "                                     Evidence Repo Link  \\\n",
      "143   https://erepo.genome.network/evrepo/ui/classif...   \n",
      "181   https://erepo.genome.network/evrepo/ui/classif...   \n",
      "913   https://erepo.genome.network/evrepo/ui/classif...   \n",
      "931   https://erepo.genome.network/evrepo/ui/classif...   \n",
      "947   https://erepo.genome.network/evrepo/ui/classif...   \n",
      "1410  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "1412  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "1413  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "1415  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "1466  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "1479  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "1485  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "1492  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "1521  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "1983  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "2009  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "2060  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "2208  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "2398  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "2399  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "2402  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "2411  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "2889  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "2890  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "3027  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "3112  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "3121  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "3153  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "3424  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "3603  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "3744  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "3852  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "3855  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "3859  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "3949  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "4349  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "4350  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "4351  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "4543  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "4554  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "4556  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "4563  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "4585  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "4716  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "4815  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "4918  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "5370  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "5372  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "5374  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "5396  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "5397  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "5400  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "5425  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "5457  https://erepo.genome.network/evrepo/ui/classif...   \n",
      "\n",
      "                                      Uuid variant  \n",
      "143   3e2a9116-5417-4772-b792-45d0463dc138          \n",
      "181   5fe5fef0-e52a-4616-8e14-0b7ae7e8da51          \n",
      "913   4cfb3ea8-9859-4e41-8ff3-200a9ed28f91          \n",
      "931   bb1a1ba7-e80d-43d8-8451-8dea25906f40          \n",
      "947   fb0e0e45-d5c2-4b0f-8f5f-3d89cb430f20          \n",
      "1410  588b8cdc-075a-4421-9fbe-3f873c51af1c          \n",
      "1412  f95f187d-ae7b-4e38-8df0-a1bc2fdeb7cb          \n",
      "1413  b0e566e8-f394-4d9f-b6a9-3f29c1b5705c          \n",
      "1415  32a09493-4519-46f6-b57a-e60d03a9272e          \n",
      "1466  169b8ea6-d8f6-4bc7-8434-67e66ee59492          \n",
      "1479  3f59f180-03c4-40bf-8632-9084331cc8d5          \n",
      "1485  61226fb6-6dcd-4205-96fc-9fba9b2b61c6          \n",
      "1492  9b03e28d-685a-4819-a353-755b36c80ff2          \n",
      "1521  45d316d3-b5e7-4926-ac80-e3bf756f76b9          \n",
      "1983  4d8a8b46-26bd-4516-978f-f4181f76b2b5          \n",
      "2009  1cfdb692-c4e9-4ea7-9168-d1f55c86bc5c          \n",
      "2060  7d2cb855-34af-45fd-82a4-737b107f9814          \n",
      "2208  3cce6484-bb53-4aad-bd72-fd31ad70ba49          \n",
      "2398  4ec3a403-6eee-4822-846f-2a5dbf6e9d6d          \n",
      "2399  87d59116-fa2c-4fed-9ae3-e8e796b881f2          \n",
      "2402  fec8fb9b-390e-4a9a-a646-cedb42ca9eec          \n",
      "2411  3a22934f-3cfe-4db2-8dbd-cbd28ac7ddbd          \n",
      "2889  b031a823-83d4-4852-b057-ff7333023650          \n",
      "2890  3d9442af-f310-4967-adc9-89e0731ceca6          \n",
      "3027  e1a7f305-d1e3-4e8b-9d38-0645f61fc98e          \n",
      "3112  c87c7f1a-6800-49e2-be04-b0daf170fc28          \n",
      "3121  f41b36a1-8cd2-42fb-af0a-c631e71d4688          \n",
      "3153  81e3eb12-5953-408f-8622-140cbae0308e          \n",
      "3424  b04011ab-11a2-4533-99f7-2507ea2fd88b          \n",
      "3603  575dfa16-5f83-4a27-8f1e-48f35087366f          \n",
      "3744  d71ab43d-2141-4dca-b7bc-7ee353997559          \n",
      "3852  0dcf5205-d48d-433c-8506-d76ae9865e0a          \n",
      "3855  4aad549a-7e97-432a-87df-eebecf18eafb          \n",
      "3859  3bcf10b1-617f-4719-a169-302ecc1940dc          \n",
      "3949  aaf92a4c-d017-438c-906b-ba8c494b2bc3          \n",
      "4349  a7c13e3b-e46e-43b0-a0bb-6d6532fba5ee          \n",
      "4350  946611c9-09b4-4fd0-90dc-39f3069f548d          \n",
      "4351  5bee178f-c9b5-4102-8807-f297a0daa4ec          \n",
      "4543  b4730114-6878-4cd8-90e5-a9582a85a630          \n",
      "4554  d00e4bb0-30fb-437e-9c69-6009c4866026          \n",
      "4556  29ad1a9d-52aa-4ec2-848b-f8d709a463ca          \n",
      "4563  cda41ca5-f62d-4444-8c55-ef9eb1fc89f6          \n",
      "4585  4cdf29f1-f197-4328-8ef1-0a95ae6e5b6c          \n",
      "4716  93fd1b32-0700-482d-8fb2-cda364449c28          \n",
      "4815  3eb7d366-f800-46eb-a53a-f690c5631f3b          \n",
      "4918  28ac3c56-3202-4015-a3b0-eca58023c2e0          \n",
      "5370  283c50a5-8f41-4be3-b599-87ed7c47263e          \n",
      "5372  c2f2ab0c-5d91-4b85-a215-3d02810b5fc6          \n",
      "5374  9a4a81d7-3e06-4319-a284-b10ec78dd46b          \n",
      "5396  2f4c000b-53a7-47a5-8e41-ec944ba3654a          \n",
      "5397  dcba60fc-8a00-410f-a513-baf026c322dc          \n",
      "5400  fb4c079a-ea33-446c-b822-c75f89bd81de          \n",
      "5425  334b8b62-50b5-4fb6-8ee6-0934740e8038          \n",
      "5457  29079020-d5eb-44ab-95bc-4c9fd389a141          \n",
      "\n",
      "[54 rows x 22 columns]\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "# import genebe as gnb\n",
    "import genebe as gnb\n",
    "\n",
    "\n",
    "print('Version:' + gnb.__version__)\n",
    "# logging.basicConfig(level=logging.INFO)\n",
    "\n",
    "erepo_subset = erepo.dropna(subset=['#Variation']).copy()\n",
    "erepo_subset = erepo_subset.reset_index()\n",
    "\n",
    "variants_hgvs = erepo_subset['#Variation'].tolist()\n",
    "\n",
    "variants = gnb.parse_variants(variants_hgvs,endpoint_url= f\"{host}/cloud/api-public/v1/hgvs\",\n",
    "    batch_size=100)\n",
    "\n",
    "erepo_subset['variant'] = variants\n",
    "invalid_hgvs_rows = erepo_subset[erepo_subset['variant'] == '']\n",
    "\n",
    "count_empty_variant = len(invalid_hgvs_rows)\n",
    "\n",
    "# Display the count\n",
    "print(f\"Number of rows where 'variant' is an empty string: {count_empty_variant}\")\n",
    "print(invalid_hgvs_rows)\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Annotate variants\n",
    "\n",
    "This single line annotate variants with ACMG and much more. Look at the list of columns. \n",
    "\n",
    "You can modify the `annotate_variants_list_to_dataframe` arguments to further improve the result."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "WARNING:root:you will log in ps209497@gmail.com\n",
      "  0%|          | 0/57 [00:00<?, ?it/s]"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 57/57 [00:29<00:00,  1.95it/s]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "Index(['chr', 'pos', 'ref', 'alt', 'transcript', 'gene_symbol', 'dbsnp',\n",
       "       'gnomad_exomes_af', 'gnomad_exomes_ac', 'gnomad_exomes_homalt',\n",
       "       'revel_score', 'bayesdelnoaf_score', 'phylop100way_score', 'acmg_score',\n",
       "       'acmg_classification', 'acmg_criteria', 'gene_hgnc_id', 'hgvs_c',\n",
       "       'consequences', 'gnomad_genomes_af', 'gnomad_genomes_ac',\n",
       "       'gnomad_genomes_homalt', 'dbscsnv_ada_score', 'alphamissense_score',\n",
       "       'apogee2_score', 'gnomad_mito_homoplasmic', 'gnomad_mito_heteroplasmic',\n",
       "       'mitotip_score'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\n",
    "\n",
    "annotations = gnb.annotate_variants_list_to_dataframe(erepo_subset['variant'].tolist(), flatten_consequences=True, endpoint_url=f\"{host}/cloud/api-public/v1/variants\")\n",
    "annotations.columns\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Concatenate with sources\n",
    "\n",
    "Now, let's concatenate our annotations with the source database for further analysis.\n",
    "\n",
    "We will select only columns that we need for this analysis."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['#Variation', 'variant', 'Applied Evidence Codes (Met)',\n",
       "       'acmg_criteria', 'acmg_score'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result = pd.concat([erepo_subset, annotations], axis=1)\n",
    "result = result[['#Variation','variant','Applied Evidence Codes (Met)','acmg_criteria','acmg_score']]\n",
    "result.columns\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Analysis\n",
    "Here, we will analyze how the Evidence Repository ACMG criteria compare with GeneBe criteria assignments.\n",
    "\n",
    "Let's prepare the dataframe."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "value_map = {'_Stand Alone':8,'_Stand alone':8,'_Stand_Alone':8, '_Stand_alone':8,'_Stand_Alone':8,  '_Very Strong': 8, '_Very_Strong': 8, '_Strong': 4, '_Moderate': 2, '_Supporting': 1, '': -1, 'None': 0}\n",
    "\n",
    "criteria = ['PVS1', 'PS1', 'PS2', 'PS3', 'PS4', 'PS5', 'PM1', 'PM2', 'PM3', 'PM4', 'PM5', 'PM6', 'PM7', 'PP1', 'PP2', 'PP3', 'PP4', 'PP5', 'PP6', 'BS1', 'BS2', 'BS3', 'BS4', 'BS5', 'BP1', 'BP2', 'BP3', 'BP4', 'BP5', 'BP6', 'BP7', 'BP8', 'BA1']\n",
    "\n",
    "default_values = {        'PS1': 4,        'PS2': 4,        'PS3': 4,        'PS4': 4,        'PS5': 4,        'PM1': 2,        'PM2': 2,        'PM3': 2,        'PM4': 2,        'PM5': 2,        'PM6': 2,        'PM7': 2,        'PP1': 1,        'PP2': 1,        'PP3': 1,        'PP4': 1,        'PP5': 1,        'PP6': 1,        'BS1': 4,        'BS2': 4,        'BS3': 4,        'BS4': 4,        'BS5': 4,        'BP1': 1,    'BP2': 1,    'BP3': 1,    'BP4': 1,    'BP5': 1,    'BP6': 1,    'BP7': 1,    'BP8': 1,    'PVS1': 8,    'BA1': 8}\n",
    "\n",
    "# if criteria contains key-criterium, in the column set number according to custom strength\n",
    "for criterium in criteria:\n",
    "    key = criterium + '_erepo'\n",
    "    result[key] = result['Applied Evidence Codes (Met)'].str.extract(f'{criterium}([A-Za-z _]*)', expand=False).fillna('None')\n",
    "    result[key] = result[key].map(value_map)\n",
    "\n",
    "for criterium in criteria:\n",
    "    key = criterium + '_genebe'\n",
    "    result[key] = result['acmg_criteria'].str.extract(f'{criterium}([A-Za-z _]*)', expand=False).fillna('None')\n",
    "    result[key] = result[key].map(value_map)\n",
    "\n",
    "# set numeric values for criteria without custom strength\n",
    "for criterium in criteria:\n",
    "    result[criterium+'_erepo'] = result[criterium+'_erepo'].replace(-1, default_values[criterium])\n",
    "    result[criterium+'_genebe'] = result[criterium+'_genebe'].replace(-1, default_values[criterium])\n",
    "\n",
    "\n",
    "for suffix in '_erepo', '_genebe':\n",
    "    result['score'+suffix] = (\n",
    "            result['PVS1'+suffix] +\n",
    "            result['PS1'+suffix] + result['PS2'+suffix] + result['PS3'+suffix] + result['PS4'+suffix] + result['PS5'+suffix] +\n",
    "            result['PM1'+suffix] + result['PM2'+suffix] + result['PM3'+suffix] + result['PM4'+suffix] + result['PM5'+suffix] +\n",
    "            result['PM6'+suffix] + result['PM7'+suffix] +\n",
    "            result['PP1'+suffix] + result['PP2'+suffix] + result['PP3'+suffix] + result['PP4'+suffix] + result['PP5'+suffix] +\n",
    "            result['PP6'+suffix]\n",
    "            - result['BS1'+suffix] - result['BS2'+suffix] - result['BS3'+suffix] - result['BS4'+suffix] - result['BS5'+suffix]\n",
    "            - result['BP1'+suffix] - result['BP2'+suffix] - result['BP3'+suffix] - result['BP4'+suffix] - result['BP5'+suffix]\n",
    "            - result['BP6'+suffix] - result['BP7'+suffix] - result['BP8'+suffix]\n",
    "            - result['BA1'+suffix]\n",
    "    )\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Correlation between scores\n",
    "\n",
    "When considering this correlation, remember that the human judge has access to more criteria than the GeneBe algorithm."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.8296581587167354"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np\n",
    "\n",
    "correlation_coefficient = np.corrcoef(result['score_erepo'], result['score_genebe'])\n",
    "correlation_coefficient[0,1]\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Score per criterium\n",
    "\n",
    "Here, let's examine what Cohen's Kappa score looks like for each criterion when comparing ClinGen with GeneBe.\n",
    "\n",
    "Keep in mind that a score of 0 means that this criterion is not set by GeneBe due to a lack of data."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'PVS1': 0.8185191273065793,\n",
       " 'PS1': 0.08463506882443095,\n",
       " 'PS2': 0.0,\n",
       " 'PS3': 0.0,\n",
       " 'PS4': 0.0,\n",
       " 'PM1': 0.19009215930803292,\n",
       " 'PM2': 0.3822234354548125,\n",
       " 'PM3': 0.0,\n",
       " 'PM4': 0.5092724302972851,\n",
       " 'PM5': 0.22769678423922513,\n",
       " 'PM6': 0.0,\n",
       " 'PP1': 0.0,\n",
       " 'PP2': 0.298912072811791,\n",
       " 'PP3': 0.25917740782891785,\n",
       " 'PP4': 0.0,\n",
       " 'PP5': 0.0,\n",
       " 'BS1': 0.0918472799703457,\n",
       " 'BS2': 0.20740807822023832,\n",
       " 'BS3': 0.0,\n",
       " 'BS4': 0.0,\n",
       " 'BP1': 0.0,\n",
       " 'BP2': 0.0,\n",
       " 'BP3': 0.0,\n",
       " 'BP4': 0.2193168963734642,\n",
       " 'BP5': 0.0,\n",
       " 'BP6': 0.0,\n",
       " 'BP7': 0.5930384471817842,\n",
       " 'BA1': 0.3726553632392755}"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.metrics import cohen_kappa_score\n",
    "import math\n",
    "\n",
    "kappas = {}\n",
    "\n",
    "for criterium in criteria:\n",
    "    ekey = criterium + '_erepo'\n",
    "    gkey = criterium + '_genebe'\n",
    "    evalues = result[ekey]\n",
    "    gvalues = result[gkey]\n",
    "    kappa = cohen_kappa_score(evalues, gvalues)\n",
    "    if not math.isnan(kappa):\n",
    "        kappas[criterium] = kappa\n",
    "\n",
    "kappas\n",
    "\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "bio2",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
