Skip to content
2 changes: 2 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<!-- https://myst-parser.readthedocs.io/en/latest/faq/index.html
#include-a-file-from-outside-the-docs-folder-like-readme-md -->

```{include} ../README.md
:start-line: 0
:relative-docs: docs
Expand All @@ -18,6 +19,7 @@ vuegen_demo
:maxdepth: 1
:caption: Building a report

vuegen_basic_case_study
vuegen_case_study_earth_microbiome
example_report
```
Expand Down
33 changes: 19 additions & 14 deletions docs/vuegen_basic_case_study.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,17 @@
"source": [
"### 0.1. Installing libraries and creating global variables for platform and working directory\n",
"\n",
"To run this notebook locally, you should create a virtual environment with the required libraries and set the `platform` variable to `local_notebook`. If you are running this notebook on Google Colab, set the `platform` variable to `colab`."
"To run this notebook locally, you should create a virtual environment with the required libraries. If you are running this notebook on Google Colab, everything should be set."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": [
"hide-output"
]
},
"outputs": [],
"source": [
"# Vuegen library \n",
Expand All @@ -73,7 +77,8 @@
"metadata": {},
"outputs": [],
"source": [
"platform = 'local_notebook' #@param ['colab', 'local_notebook'] {allow-input: true}"
"import os\n",
"IN_COLAB = \"COLAB_GPU\" in os.environ"
]
},
{
Expand All @@ -83,11 +88,11 @@
"outputs": [],
"source": [
"# Set working directory\n",
"if platform == 'colab':\n",
"if IN_COLAB:\n",
" # Clone the repository in Colab\n",
" !git clone --depth=1 https://github.com/Multiomics-Analytics-Group/vuegen.git\n",
" base_output_dir = \"vuegen/docs/example_data/Basic_example_vuegen_demo_notebook/\"\n",
"elif platform == 'local_notebook':\n",
"else:\n",
" # Output directory for local execution\n",
" base_output_dir = \"./example_data/Basic_example_vuegen_demo_notebook/\""
]
Expand All @@ -99,7 +104,7 @@
"outputs": [],
"source": [
"# Optional library to launch a streamlit app from colab\n",
"if platform == 'colab':\n",
"if IN_COLAB:\n",
" !npm install localtunnel"
]
},
Expand All @@ -112,7 +117,7 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -122,7 +127,7 @@
"from vuegen import report_generator\n",
"from vuegen.utils import get_logger, load_yaml_config\n",
"\n",
"if platform == 'colab':\n",
"if IN_COLAB:\n",
" import urllib"
]
},
Expand Down Expand Up @@ -166,10 +171,10 @@
"metadata": {},
"outputs": [],
"source": [
"# Launch the Streamlit report depneding on the platform\n",
"# if platform == \"local_notebook\":\n",
"# # Launch the Streamlit report depneding on the platform\n",
"# if not IN_COLAB:\n",
"# !streamlit run streamlit_report/sections/report_manager.py\n",
"# elif platform == \"colab\": # https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n",
"# else: # https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n",
"# print(\"Password/Enpoint IP for localtunnel is:\",urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip(\"\\n\"))\n",
"# !streamlit run streamlit_report/sections/report_manager.py --server.address=localhost &>/content/logs.txt &\n",
"# !npx localtunnel --port 8501"
Expand Down Expand Up @@ -309,10 +314,10 @@
"metadata": {},
"outputs": [],
"source": [
"# Launch the Streamlit report depneding on the platform\n",
"#if platform == \"local_notebook\":\n",
"# # Launch the Streamlit report depneding on the platform\n",
"# if not IN_COLAB:\n",
"# !streamlit run streamlit_report/sections/report_manager.py\n",
"#elif platform == \"colab\":\n",
"# else: # https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n",
"# print(\"Password/Enpoint IP for localtunnel is:\",urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip(\"\\n\"))\n",
"# !streamlit run streamlit_report/sections/report_manager.py --server.address=localhost &>/content/logs.txt &\n",
"# !npx localtunnel --port 8501"
Expand Down
21 changes: 11 additions & 10 deletions docs/vuegen_case_study_earth_microbiome.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"source": [
"### 0.1. Installing libraries and creating global variables for platform and working directory\n",
"\n",
"To run this notebook locally, you should create a virtual environment with the required libraries and set the `platform` variable to `local_notebook`. If you are running this notebook on Google Colab, set the `platform` variable to `colab`."
"To run this notebook locally, you should create a virtual environment with the required libraries. If you are running this notebook on Google Colab, everything should be set."
]
},
{
Expand Down Expand Up @@ -90,7 +90,8 @@
"metadata": {},
"outputs": [],
"source": [
"platform = 'local_notebook' #@param ['colab', 'local_notebook'] {allow-input: true}"
"import os\n",
"IN_COLAB = \"COLAB_GPU\" in os.environ"
]
},
{
Expand All @@ -100,7 +101,7 @@
"outputs": [],
"source": [
"# Optional library to launch a streamlit app from colab\n",
"if platform == 'colab':\n",
"if IN_COLAB:\n",
" !npm install localtunnel"
]
},
Expand Down Expand Up @@ -148,7 +149,7 @@
"from vuegen import report_generator\n",
"from vuegen.utils import get_logger, load_yaml_config\n",
"\n",
"if platform == 'colab':\n",
"if IN_COLAB:\n",
" import urllib"
]
},
Expand Down Expand Up @@ -1388,10 +1389,10 @@
"metadata": {},
"outputs": [],
"source": [
"# Launch the Streamlit report depneding on the platform\n",
"#if platform == \"local_notebook\":\n",
"# # Launch the Streamlit report depneding on the platform\n",
"# if not IN_COLAB:\n",
"# !streamlit run streamlit_report/sections/report_manager.py\n",
"#elif platform == \"colab\": # https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n",
"# else: # https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n",
"# print(\"Password/Enpoint IP for localtunnel is:\",urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip(\"\\n\"))\n",
"# !streamlit run streamlit_report/sections/report_manager.py --server.address=localhost &>/content/logs.txt &\n",
"# !npx localtunnel --port 8501"
Expand Down Expand Up @@ -1567,10 +1568,10 @@
"metadata": {},
"outputs": [],
"source": [
"# Launch the Streamlit report depneding on the platform\n",
"#if platform == \"local_notebook\":\n",
"# # Launch the Streamlit report depneding on the platform\n",
"# if not IN_COLAB:\n",
"# !streamlit run streamlit_report/sections/report_manager.py\n",
"#elif platform == \"colab\":\n",
"# else: # https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n",
"# print(\"Password/Enpoint IP for localtunnel is:\",urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip(\"\\n\"))\n",
"# !streamlit run streamlit_report/sections/report_manager.py --server.address=localhost &>/content/logs.txt &\n",
"# !npx localtunnel --port 8501"
Expand Down