Skip to content

Commit 1251d22

Browse files
enryHsayalaruano
andauthored
Update documentation (#83)
* 🎨 remove non-existing doc from index, format action, non-editable install * 🎨 format and use non-editable installation * 📝 Update README and docs structure * 📝 Update README with info for installing and running nf-vuegen * 📝 Correct admonitions for GUI section --------- Co-authored-by: Sebastián Ayala Ruano <[email protected]> Co-authored-by: sayalaruano <[email protected]>
1 parent 515886c commit 1251d22

File tree

5 files changed

+126
-62
lines changed

5 files changed

+126
-62
lines changed

.github/workflows/docs.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: [main]
88
release:
99
types: [published]
10-
10+
1111
jobs:
1212
test:
1313
name: Test docs and report examples
@@ -21,24 +21,24 @@ jobs:
2121
uses: actions/setup-python@v5
2222
with:
2323
python-version: ${{ matrix.python-version }}
24-
cache: 'pip' # caching pip dependencies
25-
cache-dependency-path: '**/pyproject.toml'
24+
cache: "pip" # caching pip dependencies
25+
cache-dependency-path: "**/pyproject.toml"
2626
- name: Install dependencies
2727
run: |
2828
python -m pip install --upgrade pip
29-
pip install -e .[docs]
29+
pip install .[docs]
3030
- name: Build references
3131
run: |
32-
cd docs
33-
sphinx-apidoc --force --implicit-namespaces --module-first -o reference ../src/vuegen
32+
cd docs
33+
sphinx-apidoc --force --implicit-namespaces --module-first -o reference ../src/vuegen
3434
- name: Build documentation
3535
run: |
36-
cd docs
37-
sphinx-build -n --keep-going -b html ./ ./_build/
36+
cd docs
37+
sphinx-build -n --keep-going -b html ./ ./_build/
3838
# --- HTML example deployment ---
3939
- name: Rename entry point of report to index.html
4040
run: |
41-
mv docs/quarto_report/quarto_report.html docs/quarto_report/index.html
41+
mv docs/quarto_report/quarto_report.html docs/quarto_report/index.html
4242
- name: Publish HTML report to GitHub Pages (gh-pages branch)
4343
# Only publish a new static report upon a new release -> can be changed.
4444
if: startsWith(github.ref, 'refs/tags')
@@ -62,4 +62,4 @@ jobs:
6262
with:
6363
github_token: ${{ secrets.GITHUB_TOKEN }}
6464
publish_dir: docs/
65-
publish_branch: streamlit-report-example
65+
publish_branch: streamlit-report-example

README.md

+100-36
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ An overview of the VueGen workflow is shown in the figure below:
3636

3737
![VueGen Abstract](https://raw.githubusercontent.com/Multiomics-Analytics-Group/vuegen/main/docs/images/vuegen_graph_abstract.png)
3838

39-
Also, the class diagram for the project is presented below to illustrate the architecture and relationships between classes:
39+
We created a schema diagram to illustrates the structure of the configuration file and the relationships between its elements:
40+
41+
![VueGen Schema Diagram](https://raw.githubusercontent.com/Multiomics-Analytics-Group/vuegen/main/docs/images/vuegen_schema_diagram.png)
42+
43+
Also, the class diagram for the project's current version is presented below to show the architecture and relationships between classes:
4044

4145
![VueGen Class Diagram](https://raw.githubusercontent.com/Multiomics-Analytics-Group/vuegen/main/docs/images/vuegen_classdiagram_noattmeth.png)
4246

@@ -59,9 +63,11 @@ pip install vuegen
5963

6064
You can also install the package for development by cloning this repository and running the following command:
6165

66+
> [!WARNING]
67+
> We assume you are in the root directory of the cloned repository when running this command. Otherwise, you need to specify the path to the `vuegen` directory.
68+
6269
```bash
63-
pip install -e path/to/vuegen # specify location
64-
pip install -e . # in case your pwd is in the vuegen directory
70+
pip install -e .
6571
```
6672

6773
### Conda
@@ -98,12 +104,19 @@ If you prefer not to install VueGen on your system, a pre-configured Docker cont
98104

99105
### Nextflow and nf-core
100106

101-
VueGen is also available as a [nf-core][nfcore] module, customised for compatibility with the [Nextflow][nextflow] environment. This module is designed to automate report generation from outputs produced by other modules, subworkflows, or pipelines. You can read the offical documentation for the nf-core module [here](nf-vuegen-nf-core). Also, the source code and detailed documentation are available in the [nf-VueGen repository][nf-vuegen].
107+
VueGen is also available as a [nf-core][nfcore] module, customised for compatibility with the [Nextflow][nextflow] environment. This module is designed to automate report generation from outputs produced by other modules, subworkflows, or pipelines. Asumming that you have `nextflow` and `nf-core` installed, you can use the following command to install the nf-core module:
108+
109+
```bash
110+
nf-core modules install vuegen
111+
```
112+
113+
> [!NOTE]
114+
> You can read the offical documentation for the nf-core module [here][nf-vuegen-nf-core]. Also, the source code and additional details are available in the [nf-VueGen repository][nf-vuegen].
102115
103116
## Execution
104117

105118
> [!IMPORTANT]
106-
> Here we use the `Earth_microbiome_vuegen_demo_notebook` [directory][emp-dir] and the `Earth_microbiome_vuegen_demo_notebook.yaml` [configuration file][emp-config] as examples, which are available in the `docs/example_data` and `docs/example_config_files` folders, respectively. Make sure to clone this reposiotry to access these contents, or use your own directory and configuration file.
119+
> Here we use the `Earth_microbiome_vuegen_demo_notebook` [directory][emp-dir] and the `Earth_microbiome_vuegen_demo_notebook.yaml` [configuration file][emp-config] as examples, which are available in the `docs/example_data` and `docs/example_config_files` folders, respectively. Make sure to clone the VueGen's GitHub reposiotry to access these contents, or use your own directory and configuration file.
107120
108121
Run VueGen using a directory with the following command:
109122

@@ -116,18 +129,20 @@ vuegen --directory docs/example_data/Earth_microbiome_vuegen_demo_notebook --rep
116129
117130
### Folder structure
118131

119-
Your input directory must follow a **nested folder structure**, where first-level folders are treated as **sections** and second-level folders as **subsections**, containing the components (plots, tables, networks, Markdown text, and HTML files).
132+
Your input directory should follow a **nested folder structure**, where first-level folders are treated as **sections** and second-level folders as **subsections**, containing the components (plots, tables, networks, Markdown text, and HTML files). If the component files are in the first-level folders, an `overview` subsection will be created automatically.
120133

121134
Here is an example layout:
122135

123136
```
124137
report_folder/
125138
├── section1/
139+
│ ├── table1.tsv
126140
│ └── subsection1/
127-
│ ├── table.csv
141+
│ ├── table2.csv
128142
│ ├── image1.png
129143
│ └── chart.json
130144
├── section2/
145+
│ ├── image2.jpg
131146
│ ├── subsection1/
132147
│ │ ├── summary_table.xls
133148
│ │ └── network_plot.graphml
@@ -136,9 +151,6 @@ report_folder/
136151
│ └── summary.md
137152
```
138153

139-
> [!WARNING]
140-
> VueGen currently requires each section to contain at least one subsection folder. Defining only sections (with no subsections) or using deeper nesting levels (i.e., sub-subsections) will result in errors. In upcoming releases, we plan to support more flexible directory structures.
141-
142154
The titles for sections, subsections, and components are extracted from the corresponding folder and file names, and afterward, users can add descriptions, captions, and other details to the configuration file. Component types are inferred from the file extensions and names.
143155
The order of sections, subsections, and components can be defined using numerical suffixes in folder and file names.
144156

@@ -172,16 +184,57 @@ docker run --rm \
172184
quay.io/dtu_biosustain_dsp/vuegen:v0.3.2-docker --directory /home/appuser/Earth_microbiome_vuegen_demo_notebook --report_type streamlit
173185
```
174186

187+
### Running VueGen with Nextflow and nf-core
188+
189+
To run VueGen as a nf-core module, you should create a Nextflow pipeline and include the VueGen module in your workflow. Here is a `main.nf` example:
190+
191+
```groovy
192+
#!/usr/bin/env nextflow
193+
include { VUEGEN } from './modules/nf-core/vuegen/'
194+
195+
workflow {
196+
// Create a channel for the report type
197+
report_type_ch = Channel.value(params.report_type)
198+
199+
// Handle configuration file and directory inputs
200+
if (params.config) {
201+
file_ch = Channel.fromPath(params.config)
202+
input_type_ch = Channel.value('config')
203+
output_ch = VUEGEN(input_type_ch, file_ch, report_type_ch)
204+
205+
} else if (params.directory) {
206+
dir_ch = Channel.fromPath(params.directory, type: 'dir', followLinks: true)
207+
input_type_ch = Channel.value('directory')
208+
output_ch = VUEGEN(input_type_ch, dir_ch, report_type_ch)
209+
210+
}
211+
}
212+
```
213+
214+
You can run the pipeline with the following command:
215+
216+
```bash
217+
nextflow run main.nf --directory docs/example_data/Basic_example_vuegen_demo_notebook --report_type html
218+
```
219+
220+
> [!NOTE]
221+
> You can read the offical documentation for the nf-core module [here][nf-vuegen-nf-core]. Also, the source code and additional details are available in the [nf-VueGen repository][nf-vuegen].
222+
175223
## GUI
176224

225+
We have a simple GUI for VueGen that can be run locally or through a standalone executable.
226+
177227
### Local GUI
178228

179-
We have a simple GUI for VueGen that can be run locally or through a standalone executable.
180-
For now you will need to have a copy of this repository.
229+
To use the **local GUI**, you should clone this repository and install the required dependencies. You can do this by running the following command in the root directory of the cloned repository:
181230

182231
```bash
183232
pip install '.[gui]'
184-
cd gui
233+
```
234+
235+
Then, you should move to the `gui` folder and execute the `app.py` Python file:
236+
237+
```bash
185238
python app.py
186239
```
187240

@@ -190,53 +243,61 @@ python app.py
190243
The **bundle GUI** with the VueGen package is available under the
191244
[latest releases](https://github.com/Multiomics-Analytics-Group/vuegen/releases/latest).
192245
You will need to unzip the file and run `vuegen_gui` in the unpacked main folder.
193-
Most dependencies are included into the bundle using PyInstaller.
246+
Most dependencies are included into the bundle using [PyInstaller][pyinstaller].
194247

195-
Streamlit works out of the box as a purely Python based package. For `html` creation you will have to
196-
have a Python 3.12 installation with the `jupyter` package installed as `quarto` needs to start
248+
Streamlit works out of the box as a purely Python based package. For the rest of report types you
249+
will have to have a **Python 3.12** installation with the `jupyter` package installed, as `quarto` needs to start
197250
a kernel for execution. This is also true if you install `quarto` globally on your machine.
198251

199-
We recommend using miniforge to install Python and the conda package manager:
200-
201-
- [conda-forge.org/download/](https://conda-forge.org/download/)
252+
> [!TIP]
253+
> It is advisable to create a virtual environment to manage depenendencies and avoid conflicts with existing packages. You can use the virtual environment manager of your choice, such as `poetry`, `conda`, or `pipenv`. We recommend using [miniforge][conda-download] to install Python and the `conda` package manager.
202254
203-
We continous our example assuming you have installed the `miniforge` distribution for your
204-
machine (MacOS with arm64/ apple silicon or x86_64/ intel or Windows x86_64). Also download
205-
the [latest `vuegen_gui` bundle](https://github.com/Multiomics-Analytics-Group/vuegen/releases/latest)
255+
We assume you have installed the `miniforge` distribution for your machine (MacOS with arm64/ apple silicon
256+
or x86_64/ intel or Windows x86_64). Also, download the
257+
[latest `vuegen_gui` bundle](https://github.com/Multiomics-Analytics-Group/vuegen/releases/latest)
206258
from the releases page according to your operating system.
207259

260+
You can create a new conda environment with Python 3.12 and the `jupyter` and `vuegen` package:
261+
262+
```bash
263+
conda create -n vuegen_gui -c conda-forge python=3.12 jupyter vuegen
264+
```
265+
266+
Then, activate the environment:
267+
208268
```bash
209-
conda create -n vuegen_gui -c conda-forge python=3.12 jupyter
210-
# in case you have errors, install vuegen addtionally
211269
conda activate vuegen_gui
212-
pip install vuegen
213-
# list all conda environments to find the location of the environment
214-
conda info -e # find environment location
215270
```
216271

217-
Find the vuegen_gui path for your local `user`.
272+
> [!WARNING]
273+
> If you have errors with the `vuegen` package, you can install it separately using pip, as explained in the installation section.
218274
219-
On **MacOS** you need to add a `bin` to the path:
275+
Now, you can list all conda environments to find the location of the `vuegen_gui` environment:
220276

221277
```bash
222-
/Users/user/miniforge3/envs/vuegen_gui/bin
278+
conda info -e
223279
```
224280

225-
On **Windows** you can use the path as displayed by `conda info -e`:
281+
On **MacOS**, you need to add a `bin` to the path:
226282

227-
> Note: On Windows a base installation of miniforge with `jupyter` might work as well as
228-
> the app can see your entire Path which is not the case on MacOS.
283+
```bash
284+
/Users/user/miniforge3/envs/vuegen_gui/bin
285+
```
286+
287+
On **Windows**, you can use the path as displayed by `conda info -e`:
229288

230289
```bash
231290
C:\Users\user\miniforge3\envs\vuegen_gui
232291
```
233292

234-
More information regarding the app and builds can be found in the
235-
[GUI README](https://github.com/Multiomics-Analytics-Group/vuegen/blob/main/gui/README.md).
293+
> [!NOTE]
294+
> On Windows a base installation of miniforge with `jupyter` might work because the app can see your entire Path, which is not the case on MacOS.
295+
296+
More information regarding the app and builds can be found in the [GUI README][gui-readme].
236297

237298
## Case studies
238299

239-
VueGen’s functionality is demonstrated through two case studies:
300+
VueGen’s functionality is demonstrated through various case studies:
240301

241302
### 1. Predefined Directory
242303

@@ -376,6 +437,9 @@ We appreciate your feedback! If you have any comments, suggestions, or run into
376437
[emp]: https://earthmicrobiome.org/
377438
[emp-config]: https://github.com/Multiomics-Analytics-Group/vuegen/blob/main/docs/example_config_files/Earth_microbiome_vuegen_demo_notebook_config
378439
[emp-dir]: https://github.com/Multiomics-Analytics-Group/vuegen/blob/main/docs/example_data/Earth_microbiome_vuegen_demo_notebook
440+
[conda-download]: https://conda-forge.org/download/
441+
[gui-readme]: https://github.com/Multiomics-Analytics-Group/vuegen/blob/main/gui/README.md
442+
[pyinstaller]: https://pyinstaller.org/
379443
[st-cloud]: https://streamlit.io/cloud
380444
[stlite_repo]: https://github.com/whitphx/stlite
381445
[st-forum-exe]: https://discuss.streamlit.io/t/streamlit-deployment-as-an-executable-file-exe-for-windows-macos-and-android/6812

docs/images/vuegen_schema_diagram.png

505 KB
Loading

docs/index.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,7 @@ sections_readme/execution
1717
sections_readme/gui
1818
sections_readme/case_studies
1919
sections_readme/web_app_deploy
20-
sections_readme/contributing
2120
sections_readme/citation
22-
sections_readme/credits
23-
sections_readme/contact
24-
```
25-
26-
```{toctree}
27-
:maxdepth: 2
28-
29-
vuegen_demo
3021
```
3122

3223
```{toctree}
@@ -50,9 +41,18 @@ vuegen_Chatbot_configfile
5041
reference/vuegen
5142
```
5243

44+
```{toctree}
45+
:maxdepth: 1
46+
:caption: Project Support
47+
48+
sections_readme/contributing
49+
sections_readme/credits
50+
sections_readme/contact
51+
```
52+
5353
```{toctree}
5454
:maxdepth: 1
55-
:caption: MISC:
55+
:caption: Extra Materials
5656
:hidden:
5757
5858
README.md

gui/README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Windows and macOS specific options:
6363
6464
## Quarto notebook execution
6565
66-
- add python exe to bundle as suggested [on stackoverflow](https://stackoverflow.com/a/72639099/9684872) [not this way at least]
66+
- Add python exe to bundle as suggested [on stackoverflow](https://stackoverflow.com/a/72639099/9684872) [not this way at least]
6767
6868
## test shipping a python virtual environment with vuegen installed
6969
@@ -156,14 +156,14 @@ python -m venv .venv --copies --clear --prompt vuegenvenv
156156
On windows the default Paths is available in the application. This would allow to use
157157
the default python installation and a global quarto installation.
158158

159-
to test, one could
159+
To test, one could
160160

161-
- use global quarto and python installations can be used
162-
- add a deactivate button into app for bundled quarto (so path is not set)
161+
- Use global quarto and python installations can be used
162+
- Add a deactivate button into app for bundled quarto (so path is not set)
163163

164164
### On MacOs
165165

166-
- on MacOs the default paths are not set, but only the minimal one `/usr/bin:/bin:/usr/sbin:/sbin`,
166+
- On MacOs the default paths are not set, but only the minimal one `/usr/bin:/bin:/usr/sbin:/sbin`,
167167
see pyinstaller hints
168168
[on path manipulations](https://pyinstaller.org/en/stable/common-issues-and-pitfalls.html#macos)
169-
- requires to add path to python environment manually
169+
- Requires to add path to python environment manually

0 commit comments

Comments
 (0)