Skip to content

Commit

Permalink
updated notebook formatting to align with standard format
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleoconnell-NIH committed May 24, 2024
1 parent d16f2d3 commit 90fe92d
Show file tree
Hide file tree
Showing 8 changed files with 566 additions and 2,378 deletions.
92 changes: 86 additions & 6 deletions notebooks/GWAS/GWAS_coat_color.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,46 @@
"metadata": {},
"source": [
"# GWAS in the cloud\n",
"## Overview\n",
"We adapted the NIH CFDE tutorial from [here](https://training.nih-cfde.org/en/latest/Bioinformatic-Analyses/GWAS-in-the-cloud/background/) and fit it to a notebook. We have greatly simplified the instructions, so if you need or want more details, look at the full tutorial to find out more.\n",
"Most of this notebook is bash, but expects that you are using a Python kernel, until step 3, plotting, you will need to switch your kernel to R."
"\n",
"Most of this notebook is written in Bash, but expects that you are using a Python kernel, until step 3, plotting where you will need to switch your kernel to R."
]
},
{
"cell_type": "markdown",
"id": "3edafe63",
"metadata": {},
"source": [
"## Learning Objectives\n",
"The goal is to learn how to execute a GWAS analysis in a cloud environment"
]
},
{
"cell_type": "markdown",
"id": "5d7ef396",
"metadata": {},
"source": [
"## Prerequisites\n",
"+ You only need access to a Sagemaker notebook environment to run this notebook"
]
},
{
"cell_type": "markdown",
"id": "39ee9668",
"metadata": {},
"source": [
"## Get Started"
]
},
{
"cell_type": "markdown",
"id": "8fbf6304",
"metadata": {},
"source": [
"## 1. Setup\n",
"### Download the data\n",
"### Install packages and set up environment\n",
"\n",
"#### Download the data\n",
"use %%bash to denote a bash block. You can also use '!' to denote a single bash command within a Python notebook"
]
},
Expand Down Expand Up @@ -68,7 +97,31 @@
"tags": []
},
"source": [
"## 1. Install dependencies"
"### Install dependencies"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9f5032d7",
"metadata": {},
"outputs": [],
"source": [
"# install mamba\n",
"! curl -L -O https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh\n",
"! bash Mambaforge-$(uname)-$(uname -m).sh -b -p $HOME/mambaforge"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1a5bd340",
"metadata": {},
"outputs": [],
"source": [
"# add to your path\n",
"import os\n",
"os.environ[\"PATH\"] += os.pathsep + os.environ[\"HOME\"]+\"/mambaforge/bin\""
]
},
{
Expand All @@ -78,6 +131,7 @@
"metadata": {},
"outputs": [],
"source": [
"# install everything else\n",
"! mamba install -y -c bioconda plink vcftools"
]
},
Expand All @@ -86,7 +140,7 @@
"id": "3de2fc4c",
"metadata": {},
"source": [
"## 2. Analyze"
"## Analyze"
]
},
{
Expand Down Expand Up @@ -266,7 +320,7 @@
"id": "1f52e97c",
"metadata": {},
"source": [
"## 3. Plotting\n",
"## Plotting\n",
"In this tutorial, plotting is done in R, so at this point you can change your kernel to R in the top right. Wait for it to say 'idle' in the bottom left, then continue. You could also plot using Python native packages and maintain the Python notebook kernel."
]
},
Expand Down Expand Up @@ -359,6 +413,32 @@
"\n",
"The top associated mutation is a nonsense SNP in the gene MC1R known to control pigment production. The MC1R allele encoding yellow coat color contains a single base change (from C to T) at the 916th nucleotide."
]
},
{
"cell_type": "markdown",
"id": "2f6e1ef6",
"metadata": {},
"source": [
"### Conclusion\n",
"Here we learned how to run a simple GWAS analysis in the cloud"
]
},
{
"cell_type": "markdown",
"id": "044a04d8",
"metadata": {},
"source": [
"## Clean up\n",
"Make sure you shut down this VM, or delete it if you don't plan to use if further.\n",
"\n",
"You can also [delete the buckets](https://docs.aws.amazon.com/AmazonS3/latest/userguide/delete-bucket.html) if you don't want to pay for the data: `aws s3 rb s3://bucket-name --force`"
]
},
{
"cell_type": "markdown",
"id": "c1e7be16",
"metadata": {},
"source": []
}
],
"metadata": {
Expand Down
Loading

0 comments on commit 90fe92d

Please sign in to comment.