Skip to content

Commit

Permalink
Small corrections notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
PauBadiaM committed Nov 25, 2022
1 parent c0221e3 commit 0391f4f
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 94 deletions.
58 changes: 29 additions & 29 deletions docs/source/notebooks/msigdb.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"cells": [
{
"cell_type": "markdown",
"id": "6ab59a1c",
"id": "b66fda50",
"metadata": {},
"source": [
"# Functional enrichment of biological terms"
]
},
{
"cell_type": "markdown",
"id": "51c6a2a7",
"id": "aca06cc5",
"metadata": {},
"source": [
"scRNA-seq yield many molecular readouts that are hard to interpret by themselves. One way of summarizing this information is by assigning them to biological terms from prior knowledge.\n",
Expand All @@ -30,7 +30,7 @@
},
{
"cell_type": "markdown",
"id": "9e65d5aa",
"id": "7bb71063",
"metadata": {},
"source": [
"## Loading packages\n",
Expand All @@ -42,7 +42,7 @@
{
"cell_type": "code",
"execution_count": 1,
"id": "4a74e503",
"id": "8d8d1e9c",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -56,7 +56,7 @@
},
{
"cell_type": "markdown",
"id": "d7911e03",
"id": "ba3c7327",
"metadata": {},
"source": [
"## Loading the data\n",
Expand All @@ -67,7 +67,7 @@
{
"cell_type": "code",
"execution_count": 2,
"id": "caeb9307",
"id": "b55c010e",
"metadata": {},
"outputs": [
{
Expand All @@ -94,7 +94,7 @@
},
{
"cell_type": "markdown",
"id": "063875b8",
"id": "5733c3d9",
"metadata": {},
"source": [
"We can visualize the different cell types in it:"
Expand All @@ -103,7 +103,7 @@
{
"cell_type": "code",
"execution_count": 3,
"id": "5830fc61",
"id": "d54e1470",
"metadata": {},
"outputs": [
{
Expand All @@ -123,7 +123,7 @@
},
{
"cell_type": "markdown",
"id": "3434d155",
"id": "456e6fa7",
"metadata": {},
"source": [
"## MSigDB gene sets\n",
Expand All @@ -134,7 +134,7 @@
{
"cell_type": "code",
"execution_count": 4,
"id": "e23e276f",
"id": "ed35afbf",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -277,10 +277,10 @@
},
{
"cell_type": "markdown",
"id": "ba58ae14",
"id": "d4419a70",
"metadata": {},
"source": [
"As an example, we will use the hallmark gene sets, but we could have used any other. \n",
"As an example, we will use the hallmark gene sets, but we could have used any other such as KEGG or REACTOME. \n",
"\n",
"<div class=\"alert alert-info\">\n",
"\n",
Expand All @@ -296,7 +296,7 @@
{
"cell_type": "code",
"execution_count": 5,
"id": "8aae33ad",
"id": "63ab797b",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -430,15 +430,15 @@
},
{
"cell_type": "markdown",
"id": "263733e6",
"id": "abc036e7",
"metadata": {},
"source": [
"For this example we will use the resource MSigDB, but we could have used any other such as GO. To see the list of available resources inside `Omnipath`, run `dc.show_resources()`"
]
},
{
"cell_type": "markdown",
"id": "730beda7",
"id": "230069c3",
"metadata": {},
"source": [
"## Enrichment with Over Representation Analysis\n",
Expand All @@ -457,7 +457,7 @@
{
"cell_type": "code",
"execution_count": 6,
"id": "f18b018f",
"id": "28f80701",
"metadata": {},
"outputs": [
{
Expand All @@ -482,7 +482,7 @@
},
{
"cell_type": "markdown",
"id": "e6e928d2",
"id": "a76f5bb2",
"metadata": {},
"source": [
"The obtained scores (-log10(p-value))(`ora_estimate`) and p-values (`ora_pvals`) are stored in the `.obsm` key:"
Expand All @@ -491,7 +491,7 @@
{
"cell_type": "code",
"execution_count": 7,
"id": "a0b76012",
"id": "9c9d230e",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -992,7 +992,7 @@
},
{
"cell_type": "markdown",
"id": "9d5e9a20",
"id": "342fefce",
"metadata": {},
"source": [
"## Visualization\n",
Expand All @@ -1004,7 +1004,7 @@
{
"cell_type": "code",
"execution_count": 8,
"id": "dcb61861",
"id": "631022a6",
"metadata": {},
"outputs": [
{
Expand All @@ -1028,7 +1028,7 @@
},
{
"cell_type": "markdown",
"id": "35f062a9",
"id": "0d8de784",
"metadata": {},
"source": [
"`dc.get_acts` returns a new `AnnData` object which holds the obtained activities in its `.X` attribute, allowing us to re-use many `scanpy` functions, for example:"
Expand All @@ -1037,7 +1037,7 @@
{
"cell_type": "code",
"execution_count": 9,
"id": "6b1a8a78",
"id": "baad01ca",
"metadata": {},
"outputs": [
{
Expand All @@ -1059,15 +1059,15 @@
},
{
"cell_type": "markdown",
"id": "f3bcc01f",
"id": "71f38076",
"metadata": {},
"source": [
"The cells highlighted seem to be enriched by coagulation."
]
},
{
"cell_type": "markdown",
"id": "3613244f",
"id": "987c3ea7",
"metadata": {},
"source": [
"## Exploration\n",
Expand All @@ -1078,7 +1078,7 @@
{
"cell_type": "code",
"execution_count": 10,
"id": "1280b444",
"id": "e7314c36",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -1307,7 +1307,7 @@
},
{
"cell_type": "markdown",
"id": "9488a871",
"id": "9f8a8f43",
"metadata": {},
"source": [
"We can visualize which group is more enriched using `seaborn`:"
Expand All @@ -1316,7 +1316,7 @@
{
"cell_type": "code",
"execution_count": 11,
"id": "e39e730c",
"id": "9c7ecc46",
"metadata": {},
"outputs": [
{
Expand All @@ -1339,15 +1339,15 @@
},
{
"cell_type": "markdown",
"id": "937b7931",
"id": "b7566e44",
"metadata": {},
"source": [
"In this specific example, we can observe that most cell types are enriched by targets of MYC, a global regulator of the immune system, and megakaryocytes are enriched by coagulation genes."
]
},
{
"cell_type": "markdown",
"id": "e534fff1",
"id": "f75e1467",
"metadata": {},
"source": [
"<div class=\"alert alert-info\">\n",
Expand Down
Loading

0 comments on commit 0391f4f

Please sign in to comment.