Skip to content

Commit

Permalink
update notebook formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ahwagner committed Jul 17, 2024
1 parent 8c01d00 commit 398d505
Show file tree
Hide file tree
Showing 5 changed files with 931 additions and 516 deletions.
125 changes: 94 additions & 31 deletions notebooks/getting_started/1_Quick_Start.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@
"cells": [
{
"cell_type": "markdown",
"id": "7f11c55b5ce145ee",
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"# 1 Quick Start\n",
"# 1. Quick Start\n",
"This notebook provides instructions on how to get your vrs-python environment up and running with as few\n",
"steps as possible, and to provide some rudimentary examples to prove it is working properly.\n",
"\n",
Expand All @@ -18,17 +25,16 @@
" UTA_DB_URL=\"postgresql://anonymous:anonymous@uta.biocommons.org:5432/uta/uta_20210129b\"\n",
"\n",
"**NOTE** The external sources for the SeqRepo and UTA repositories are **ONLY** to be used as part of this notebook series and are not meant for use in production code. Please refer to the links above and follow the directions provided on how to setup local instances."
],
"metadata": {
"collapsed": false
},
"id": "7f11c55b5ce145ee"
]
},
{
"cell_type": "markdown",
"id": "91f92a3e35bd48a1",
"metadata": {
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"#### Step 1 - Setup Data Proxy Access\n",
Expand All @@ -40,10 +46,13 @@
"execution_count": 1,
"id": "37130d69b9dbd9d1",
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2024-04-18T20:21:17.340604Z",
"start_time": "2024-04-18T20:21:17.207979Z"
},
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [],
Expand All @@ -57,7 +66,10 @@
"cell_type": "markdown",
"id": "a1d5bbc3a77ff03f",
"metadata": {
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"Assert that the UTA URL is defined in the environment"
Expand All @@ -68,10 +80,13 @@
"execution_count": 2,
"id": "b11653c9aae4ecba",
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2024-04-18T20:21:17.343195Z",
"start_time": "2024-04-18T20:21:17.341690Z"
},
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [],
Expand All @@ -84,7 +99,10 @@
"cell_type": "markdown",
"id": "98ab29e5ac01cc3a",
"metadata": {
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"#### Step 2 - Setup an Allele Translator\n",
Expand All @@ -96,10 +114,13 @@
"execution_count": 3,
"id": "42bd6d6f09916724",
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2024-04-18T20:21:17.393606Z",
"start_time": "2024-04-18T20:21:17.343980Z"
},
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [],
Expand All @@ -112,7 +133,10 @@
"cell_type": "markdown",
"id": "88d9aba51e44ae0",
"metadata": {
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"#### Step 3 - Translate variation representations to VRS\n",
Expand All @@ -125,16 +149,31 @@
"execution_count": 4,
"id": "af7a8f1509acf4ed",
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2024-04-18T20:21:17.525029Z",
"start_time": "2024-04-18T20:21:17.394248Z"
},
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [
{
"data": {
"text/plain": "{'id': 'ga4gh:VA.LK_4rOVxyEwrEpaOVd-BDFV0ocbO5vgV',\n 'type': 'Allele',\n 'digest': 'LK_4rOVxyEwrEpaOVd-BDFV0ocbO5vgV',\n 'location': {'id': 'ga4gh:SL.nA5-KovovkH-5p3LF1657nkkeWFwrInI',\n 'type': 'SequenceLocation',\n 'digest': 'nA5-KovovkH-5p3LF1657nkkeWFwrInI',\n 'sequenceReference': {'type': 'SequenceReference',\n 'refgetAccession': 'SQ.aUiQCzCPZ2d0csHbMSbh2NzInhonSXwI'},\n 'start': 80656509,\n 'end': 80656510},\n 'state': {'type': 'LiteralSequenceExpression', 'sequence': 'TT'}}"
"text/plain": [
"{'id': 'ga4gh:VA.LK_4rOVxyEwrEpaOVd-BDFV0ocbO5vgV',\n",
" 'type': 'Allele',\n",
" 'digest': 'LK_4rOVxyEwrEpaOVd-BDFV0ocbO5vgV',\n",
" 'location': {'id': 'ga4gh:SL.nA5-KovovkH-5p3LF1657nkkeWFwrInI',\n",
" 'type': 'SequenceLocation',\n",
" 'digest': 'nA5-KovovkH-5p3LF1657nkkeWFwrInI',\n",
" 'sequenceReference': {'type': 'SequenceReference',\n",
" 'refgetAccession': 'SQ.aUiQCzCPZ2d0csHbMSbh2NzInhonSXwI'},\n",
" 'start': 80656509,\n",
" 'end': 80656510},\n",
" 'state': {'type': 'LiteralSequenceExpression', 'sequence': 'TT'}}"
]
},
"execution_count": 4,
"metadata": {},
Expand All @@ -150,7 +189,10 @@
"cell_type": "markdown",
"id": "6fa7cb2ac050547f",
"metadata": {
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"The output above is the JSON structure of an *Allele* in VRS form. You should be able to recognize the *Allele*, *SequenceLocation*, *SequenceReference* and *LiteralSequenceLocation* classes. \n",
Expand All @@ -163,16 +205,31 @@
"execution_count": 5,
"id": "42430c680fe262c1",
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2024-04-18T20:21:18.708118Z",
"start_time": "2024-04-18T20:21:17.526585Z"
},
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [
{
"data": {
"text/plain": "{'id': 'ga4gh:VA.LK_4rOVxyEwrEpaOVd-BDFV0ocbO5vgV',\n 'type': 'Allele',\n 'digest': 'LK_4rOVxyEwrEpaOVd-BDFV0ocbO5vgV',\n 'location': {'id': 'ga4gh:SL.nA5-KovovkH-5p3LF1657nkkeWFwrInI',\n 'type': 'SequenceLocation',\n 'digest': 'nA5-KovovkH-5p3LF1657nkkeWFwrInI',\n 'sequenceReference': {'type': 'SequenceReference',\n 'refgetAccession': 'SQ.aUiQCzCPZ2d0csHbMSbh2NzInhonSXwI'},\n 'start': 80656509,\n 'end': 80656510},\n 'state': {'type': 'LiteralSequenceExpression', 'sequence': 'TT'}}"
"text/plain": [
"{'id': 'ga4gh:VA.LK_4rOVxyEwrEpaOVd-BDFV0ocbO5vgV',\n",
" 'type': 'Allele',\n",
" 'digest': 'LK_4rOVxyEwrEpaOVd-BDFV0ocbO5vgV',\n",
" 'location': {'id': 'ga4gh:SL.nA5-KovovkH-5p3LF1657nkkeWFwrInI',\n",
" 'type': 'SequenceLocation',\n",
" 'digest': 'nA5-KovovkH-5p3LF1657nkkeWFwrInI',\n",
" 'sequenceReference': {'type': 'SequenceReference',\n",
" 'refgetAccession': 'SQ.aUiQCzCPZ2d0csHbMSbh2NzInhonSXwI'},\n",
" 'start': 80656509,\n",
" 'end': 80656510},\n",
" 'state': {'type': 'LiteralSequenceExpression', 'sequence': 'TT'}}"
]
},
"execution_count": 5,
"metadata": {},
Expand All @@ -186,29 +243,35 @@
},
{
"cell_type": "markdown",
"source": [
"The VRS variant representations should be the same."
],
"id": "2c6d2303b4bda87c",
"metadata": {
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"id": "2c6d2303b4bda87c"
"source": [
"The VRS variant representations should be the same."
]
},
{
"cell_type": "code",
"outputs": [],
"source": [
"assert(vrs_from_hgvs == vrs_from_spdi)"
],
"execution_count": 6,
"id": "3c91be2bdec6b4be",
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2024-04-18T20:21:18.713821Z",
"start_time": "2024-04-18T20:21:18.710176Z"
},
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"id": "3c91be2bdec6b4be",
"execution_count": 6
"outputs": [],
"source": [
"assert(vrs_from_hgvs == vrs_from_spdi)"
]
}
],
"metadata": {
Expand All @@ -227,7 +290,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.12.1"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 398d505

Please sign in to comment.