Skip to content

Commit

Permalink
example data moved and Nature Protocols case examples added
Browse files Browse the repository at this point in the history
  • Loading branch information
luzgaral committed Jun 25, 2024
1 parent 1f78753 commit 566cb92
Show file tree
Hide file tree
Showing 35 changed files with 218,414 additions and 17,215 deletions.

Large diffs are not rendered by default.

Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.
157 changes: 157 additions & 0 deletions example_data/NatureProtocols2024_case_examples/T0_DownloadDB.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
" ![CellphoneDB Logo](https://www.cellphonedb.org/images/cellphonedb_logo_33.png) | CellphoneDB is a publicly available repository of curated receptors, ligands and their interactions."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Download database from source\n",
"In this notebook we will download CellphoneDB database and the input files required to generate the database. These input files can be modified in case the user desires to remove or add new interactions. Please check the `T00_BuildDBfromFiles.ipynb` notebook to generate a database from input files."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Install CellphoneDB\n",
"It's recommended to install CellphoneDB within a conda environment"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"> pip install cellphonedb"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import glob\n",
"import os"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Display database versions"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table class=\"striped\"><tr><th style=\"text-align:center\">Version</th><th style=\"text-align:center\">Release date</th></tr><td style=\"text-align:center\"><a class=\"teal-text\" href=\"https://github.com/ventolab/cellphonedb-data/releases/tag/v5.0.0\">v5.0.0</a></td><td style=\"text-align:center\">2023-10-31</td></tr><tr><td style=\"text-align:center\"><a class=\"teal-text\" href=\"https://github.com/ventolab/cellphonedb-data/releases/tag/v4.1.0\">v4.1.0</a></td><td style=\"text-align:center\">2023-03-09</td></tr><tr><tr><tr></table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from IPython.display import HTML, display\n",
"from cellphonedb.utils import db_releases_utils\n",
"\n",
"display(HTML(db_releases_utils.get_remote_database_versions_html()['db_releases_html_table']))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Define the version and the path to download database"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"# -- Version of the databse\n",
"cpdb_version = 'v5.0.0'\n",
"\n",
"# -- Path where the input files to generate the database are located\n",
"cpdb_target_dir = os.path.join('/home/jovyan/cellphonedb_v500_NatProtocol/', cpdb_version)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Download database"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloaded cellphonedb.zip into /home/jovyan/cellphonedb_v500_NatProtocol/v5.0.0\n",
"Downloaded complex_input.csv into /home/jovyan/cellphonedb_v500_NatProtocol/v5.0.0\n",
"Downloaded gene_input.csv into /home/jovyan/cellphonedb_v500_NatProtocol/v5.0.0\n",
"Downloaded interaction_input.csv into /home/jovyan/cellphonedb_v500_NatProtocol/v5.0.0\n",
"Downloaded protein_input.csv into /home/jovyan/cellphonedb_v500_NatProtocol/v5.0.0\n",
"Downloaded uniprot_synonyms.tsv into /home/jovyan/cellphonedb_v500_NatProtocol/v5.0.0/sources\n",
"Downloaded transcription_factor_input.csv into /home/jovyan/cellphonedb_v500_NatProtocol/v5.0.0/sources\n"
]
}
],
"source": [
"from cellphonedb.utils import db_utils\n",
"\n",
"db_utils.download_database(cpdb_target_dir, cpdb_version)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "cpdb_v500",
"language": "python",
"name": "cpdb_v500"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.19"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Binary file not shown.
Loading

0 comments on commit 566cb92

Please sign in to comment.