Skip to content

Commit f750669

Browse files
authored
Merge branch 'main' into fork-readme
2 parents bd4cc3f + 7c5629e commit f750669

File tree

2 files changed

+130
-21
lines changed

2 files changed

+130
-21
lines changed

.devcontainer/devcontainer.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "VRS-Python Notebooks",
3+
"image": "mcr.microsoft.com/vscode/devcontainers/python:3.12",
4+
"customizations": {
5+
"vscode": {
6+
"extensions": [
7+
"ms-toolsai.jupyter"
8+
]
9+
}
10+
},
11+
"postCreateCommand": "pip install --upgrade setuptools && pip install -e '.[extras,notebooks]'"
12+
}

notebooks/getting_started/README.md

+118-21
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,141 @@
11
# VRS Python Getting Started Notebook Series
2-
This series of notebooks is intended to be the fastest way to becoming productive with the
3-
[vrs-python](https://github.com/ga4gh/vrs-python) package. The
4-
intent of each notebook in this series is to be an interactive introduction to functionally contained in the vrs-python package.
5-
6-
A beginning developer level of familiarity with python, jupyter notebooks is assumed in order to run this notebook series.
7-
You should be familiar with installing packages and running commands in your execution environment.
8-
9-
### Pre-requisites
10-
The following software packages must exist in your execution environment before running these notebooks:
11-
* git
12-
13-
* make
14-
15-
### Setup vrs-python
16-
From a terminal window, run the following commands:
17-
* git clone --recurse-submodules https://github.com/ga4gh/vrs-python
18-
* cd vrs-python
19-
* make nbready
20-
* source venv/3.12/bin/activate
21-
* cd notebooks/getting_started
22-
* jupyter notebook notebook_name.ipynb
2+
3+
This series of notebooks is intended to be the fastest way to becoming productive with
4+
the [vrs-python](https://github.com/ga4gh/vrs-python) package. The intent of each
5+
notebook in this series is to be an interactive introduction to functionally contained
6+
in the vrs-python package.
7+
8+
A beginning developer level of familiarity with python, jupyter notebooks is assumed in
9+
order to run this notebook series. You should be familiar with installing packages and
10+
running commands in your execution environment.
11+
12+
## Development Environment Setup
13+
14+
We provide you two options for setting up your development environment: using a Python
15+
[virtual environment](#virtual-environment) or leveraging
16+
[VS Code Dev Containers](#dev-containers) (useful for non-macOS users).
17+
18+
### Fork the Repo
19+
20+
Fork the repo at <https://github.com/ga4gh/vrs-python/> and initialize a development
21+
environment.
22+
23+
```shell
24+
git clone --recurse-submodules [email protected]:YOUR_GITHUB_ID/vrs-python.git
25+
cd vrs-python
26+
```
27+
28+
### Virtual Environment
29+
30+
You must first install [email protected], if not already installed.
31+
32+
Next, run the following:
33+
34+
```shell
35+
make nbready
36+
source venv/3.12/bin/activate
37+
```
38+
39+
#### Virtual Environment: Selecting the Kernel
40+
41+
When opening a notebook with this option, click `Select Kernel`,
42+
`Python Environments...`, and select the first option:
43+
`3.12 (Python 3.12.z) venv/3.12/bin/python`
44+
45+
_Note: Patch version may vary._
46+
47+
### Dev Containers
48+
49+
#### Prerequisites
50+
51+
For your convenience, this section is copied from the
52+
[VS Code Dev Containers Tutorial](https://code.visualstudio.com/docs/devcontainers/tutorial#_prerequisites).
53+
54+
* [Install VS Code](https://code.visualstudio.com/download)
55+
56+
You must be using VS Code to use the Dev Containers.
57+
58+
* [Install Docker](https://docs.docker.com/get-started/get-docker/)
59+
60+
Docker is needed to create and manage your containers.
61+
62+
* Docker Desktop
63+
64+
Download and install
65+
[Docker Desktop](https://www.docker.com/products/docker-desktop/), or an
66+
[alternative Docker option](https://code.visualstudio.com/remote/advancedcontainers/docker-options),
67+
like Docker on a remote host or Docker compliant CLI.
68+
69+
* Start Docker
70+
71+
Run the Docker Desktop application to start Docker. You will know it's running if
72+
you look in the activity tray and see the Docker whale icon.
73+
74+
Docker might take a few minutes to start. If the whale icon is animated, it is
75+
probably still in the process of starting. You can click on the icon to see the
76+
status.
77+
78+
* Check Docker
79+
80+
Once Docker is running, you can confirm that everything is working by opening a new
81+
terminal window and typing the command:
82+
83+
```shell
84+
docker --version
85+
```
86+
87+
* [Install Dev Containers extension](vscode:extension/ms-vscode-remote.remote-containers)
88+
89+
The Dev Containers extension lets you run Visual Studio Code inside a Docker container.
90+
91+
[Marketplace Link](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) (if viewing from browser)
92+
93+
#### Creating the Dev Container
94+
95+
Open the VS Code Command Palette: Shift + Command + P (Mac) / Ctrl + Shift + P (Windows/Linux)
96+
97+
Type and select the following inside the Command Palette: `> Dev Containers: Rebuild and Reopen in Container`
98+
99+
The Dev Container will be created and install the dependencies needed.
100+
101+
You should see `Dev Container: VRS-Python Notebooks @ desktop-linux` on the bottom left hand corner of VS Code.
102+
103+
#### Dev Containers: Selecting the Kernel
104+
105+
When opening a notebook with this option, click `Select Kernel`,
106+
`Python Environments...`, and select the first option:
107+
`Python 3.12.z /usr/local/bin/python`
108+
109+
_Note: Patch version may vary._
23110

24111
## Notebooks
112+
25113
### 1 Quick Start
114+
26115
The [Quick Start](1_Quick_Start.ipynb) notebook details how to get started by
27116
setting up access to a SeqRepo *DataProxy* and introduces the user to using an *AlleleTranslator* to convert
28117
the same allele to VRS form from both it's SPDI and HGVS nomenclature forms.
118+
29119
### 2 Exploring the SeqRepo Data Proxy
120+
30121
Sequence references are at the core of many of the operations for converting to and from VRS variant representations.
31122
The [Exploring the SeqRepo Data Proxy](2_Exploring_the_SeqRepo_DataProxy.ipynb) notebook
32123
has a number of useful utility methods for accessing information about sequence references.
124+
33125
### 3 Basic Models
126+
34127
In the [Basic Models](3_Basic_Models.ipynb) notebook, we explore building a VRS *Allele*
35128
from its component parts. The notebook details how to add VRS identifiers to the identifiable components of the *Allele*.
129+
36130
### 4 Exploring the Allele Translator
131+
37132
The current implementation of vrs-python facilitates transformation of variants
38133
in a number of different variant nomenclatures (SPDI, HGVS, gnomAD and Beacon) to VRS form. In the
39134
[Exploring the Allele Translator](4_Exploring_the_AlleleTranslator.ipynb) notebook,
40135
we show how to transform basic variants to VRS, and in some cases, back to the original nomenclature of the variant.
136+
41137
### 5 Exploring the CNV Translator
138+
42139
The final notebook of this series,
43140
[Exploring the CNV Translator](5_Exploring_the_CnvTranslator.ipynb) details transformations
44141
of various forms of copy number variation to their VRS representations.

0 commit comments

Comments
 (0)