Skip to content

Commit

Permalink
Fix contrastivevi tutorial (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinkim0 authored Dec 7, 2023
1 parent 1b42099 commit 780e84d
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions scrna/contrastiveVI_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"import tempfile\n",
"\n",
"import numpy as np\n",
"import requests\n",
"import scanpy as sc\n",
"import scvi\n",
"import torch"
Expand Down Expand Up @@ -160,6 +161,19 @@
"As an extra preprocessing step, we'll calculate cell cycle labels to be used later in our analysis:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def get_cell_cycle_genes() -> list:\n",
" # Canonical list of cell cycle genes\n",
" url = \"https://raw.githubusercontent.com/scverse/scanpy_usage/master/180209_cell_cycle/data/regev_lab_cell_cycle_genes.txt\"\n",
" cell_cycle_genes = requests.get(url).text.split(\"\\n\")[:-1]\n",
" return cell_cycle_genes"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -172,10 +186,7 @@
},
"outputs": [],
"source": [
"# Canonical list of cell cycle genes\n",
"!wget https://raw.githubusercontent.com/scverse/scanpy_usage/master/180209_cell_cycle/data/regev_lab_cell_cycle_genes.txt\n",
"\n",
"cell_cycle_genes = [x.strip() for x in open(\"./regev_lab_cell_cycle_genes.txt\")]\n",
"cell_cycle_genes = get_cell_cycle_genes()\n",
"\n",
"s_genes = cell_cycle_genes[:43]\n",
"g2m_genes = cell_cycle_genes[43:]\n",
Expand Down

0 comments on commit 780e84d

Please sign in to comment.