|
| 1 | +# NPLinker Web Application |
| 2 | + |
| 3 | +[](https://doi.org/10.5281/zenodo.6875502) |
| 4 | + |
| 5 | +👉 **[Webapp Live Demo](https://nplinker-webapp.onrender.com)** |
| 6 | + |
| 7 | +The [NPLinker](https://nplinker.github.io/nplinker/latest/) web application, built with [Plotly Dash](https://dash.plotly.com/), provides an interactive interface for visualizing NPLinker predictions. |
| 8 | + |
| 9 | +## Online Demo |
| 10 | + |
| 11 | +A live demo of the NPLinker webapp is automatically deployed to [Render](https://render.com/) from `main` branch. |
| 12 | +You can try out the webapp directly in your browser [here](https://nplinker-webapp.onrender.com). |
| 13 | + |
| 14 | +### Getting Started with Demo Data |
| 15 | + |
| 16 | +The webapp includes a convenient **"Load Demo Data"** button that automatically loads some sample data for you to try. Simply: |
| 17 | + |
| 18 | +1. Open the [live demo link](https://nplinker-webapp.onrender.com/) |
| 19 | +2. Click the **"Load Demo Data"** button below the file uploader |
| 20 | +3. The app will automatically download and process the sample dataset from [`tests/data/mock_obj_data.pkl`](https://github.com/NPLinker/nplinker-webapp/blob/main/tests/data/mock_obj_data.pkl) |
| 21 | +4. Start exploring natural product linking features! |
| 22 | + |
| 23 | +This demo web server is intended only for lightweight demo purposes. For full functionality, including large-scale data processing and persistent storage, please install the application locally or via Docker as described below. |
| 24 | + |
| 25 | +<details> |
| 26 | +<summary>⚠️ Demo Server Limitations</summary> |
| 27 | + |
| 28 | +<p>Please note the following limitations of the hosted demo:</p> |
| 29 | + |
| 30 | +<ul> |
| 31 | + <li><strong>Cold start delay</strong>: Free-tier apps on Render sleep after 15 minutes of inactivity and may take 20–30 seconds to wake up.</li> |
| 32 | + <li><strong>Performance</strong>: This is a minimal deployment on a free tier and is not optimized for large datasets or concurrent users.</li> |
| 33 | + <li><strong>File size limits</strong>: The demo data button loads a small sample dataset suitable for testing. Uploading large datasets via the file uploader may lead to errors or timeouts.</li> |
| 34 | + <li><strong>No persistent storage</strong>: Uploaded files are not saved between sessions.</li> |
| 35 | +</ul> |
| 36 | + |
| 37 | +</details> |
| 38 | + |
| 39 | +## Using the webapp |
| 40 | + |
| 41 | +### Input Data |
| 42 | + |
| 43 | +The webapp accepts data generated by NPLinker and saved as described in the [NPLinker quickstart section](https://nplinker.github.io/nplinker/latest/quickstart/). For testing purposes, a small sample dataset is provided in [`tests/data/mock_obj_data.pkl`](https://github.com/NPLinker/nplinker-webapp/blob/main/tests/data/mock_obj_data.pkl) that can be used to try out the webapp. |
| 44 | + |
| 45 | +Please note that links between genomic and metabolomic data must currently be computed using the NPLinker API separately, as this functionality is not yet implemented in the webapp (see [issue #19](https://github.com/NPLinker/nplinker-webapp/issues/19)). If no links are present in your data, the scoring table will be disabled. |
| 46 | + |
| 47 | +### Filtering Table Data |
| 48 | + |
| 49 | +The "Candidate Links" tables support data filtering to help you focus on relevant results. You can enter filter criteria directly into each column’s filter cell by hovering over the cell. |
| 50 | + |
| 51 | +For numeric columns like "Average Score" or "# Links": |
| 52 | + |
| 53 | +- `34.6` or `= 34.6` (exact match) |
| 54 | +- `> 30` (greater than) |
| 55 | +- `<= 50` (less than or equal to) |
| 56 | + |
| 57 | +For text columns like "BGC Classes" or "MiBIG IDs": |
| 58 | + |
| 59 | +- `Polyketide` or `contains Polyketide` (contains text) |
| 60 | +- `= Polyketide` (exact match) |
| 61 | + |
| 62 | +Multiple filters can be applied simultaneously across different columns to narrow down results. |
| 63 | + |
| 64 | +For a full list of supported filter operators, see the [official Plotly documentation](https://dash.plotly.com/datatable/filtering#filtering-operators). |
| 65 | + |
| 66 | +## Installation |
| 67 | + |
| 68 | +Before installing NPLinker webapp, ensure you have: |
| 69 | + |
| 70 | +- [Python ≥3.10](https://www.python.org/downloads/) |
| 71 | +- [Git](https://git-scm.com/downloads) |
| 72 | +- [Conda](https://docs.conda.io/en/latest/miniconda.html) |
| 73 | + |
| 74 | +You can install and run the NPLinker webapp in two ways: directly on your local machine or using Docker. |
| 75 | + |
| 76 | +### Option 1: Local Installation (using Conda) |
| 77 | + |
| 78 | +Follow these steps to install the application directly on your system: |
| 79 | + |
| 80 | +1. **Clone the repository** |
| 81 | + ```bash |
| 82 | + git clone https://github.com/NPLinker/nplinker-webapp.git |
| 83 | + cd nplinker-webapp |
| 84 | + ``` |
| 85 | + |
| 86 | +2. **Set up a conda environment** |
| 87 | + ```bash |
| 88 | + # Create a new conda environment with Python 3.10 |
| 89 | + conda create -n nplinker-webapp python=3.10 |
| 90 | + |
| 91 | + # Activate the environment |
| 92 | + conda activate nplinker-webapp |
| 93 | + ``` |
| 94 | + |
| 95 | +3. **Install dependencies** |
| 96 | + ```bash |
| 97 | + pip install -e . |
| 98 | + ``` |
| 99 | + |
| 100 | +4. **Run the application** |
| 101 | + ```bash |
| 102 | + python app/main.py |
| 103 | + ``` |
| 104 | + |
| 105 | +5. **Access the webapp** |
| 106 | + |
| 107 | + Open your web browser and navigate to `http://0.0.0.0:8050/` |
| 108 | + |
| 109 | +<details> |
| 110 | +<summary>Troubleshooting Local Installation</summary> |
| 111 | + |
| 112 | +<h4>Common issues and solutions</h4> |
| 113 | + |
| 114 | +<ul> |
| 115 | + <li><strong>Port already in use</strong>: If port 8050 is already in use, modify the port in <code>app/main.py</code> by changing <code>app.run_server(debug=True, port=8050)</code></li> |
| 116 | + <li><strong>Package installation errors</strong>: Make sure you're using Python 3.10 and that your pip is up-to-date</li> |
| 117 | +</ul> |
| 118 | + |
| 119 | +<p>If you encounter other problems, please check the <a href="https://github.com/NPLinker/nplinker-webapp/issues">Issues</a> page or create a new issue.</p> |
| 120 | + |
| 121 | +</details> |
| 122 | + |
| 123 | +### Option 2: Docker Installation |
| 124 | + |
| 125 | +Using Docker is the quickest way to get started with NPLinker webapp. Make sure you have [Docker](https://www.docker.com/) installed on your system before proceeding: |
| 126 | + |
| 127 | +1. **Pull the Docker image** |
| 128 | + ```bash |
| 129 | + docker pull ghcr.io/nplinker/nplinker-webapp:latest |
| 130 | + ``` |
| 131 | + |
| 132 | +2. **Run the container** |
| 133 | + ```bash |
| 134 | + docker run -p 8050:8050 ghcr.io/nplinker/nplinker-webapp:latest |
| 135 | + ``` |
| 136 | + |
| 137 | +3. **Access the webapp** |
| 138 | + |
| 139 | + Open your web browser and navigate to `http://0.0.0.0:8050/` |
| 140 | + |
| 141 | +<details> |
| 142 | +<summary>Docker Image Information</summary> |
| 143 | + |
| 144 | +<ul> |
| 145 | + <li><strong>Available Tags</strong>: |
| 146 | + <ul> |
| 147 | + <li><code>latest</code>: The most recent build</li> |
| 148 | + <li>Specific version tags based on GitHub releases</li> |
| 149 | + </ul> |
| 150 | + </li> |
| 151 | + |
| 152 | + <li><strong>Performance Note</strong>: The application running in Docker might be slower than running it directly on your machine, depending on your Docker resource allocation settings. If you experience performance issues, consider increasing Docker's CPU and memory limits in your Docker Desktop settings, or use the local installation method.</li> |
| 153 | + |
| 154 | + <li><strong>More Details</strong>: For additional information about the Docker image, see its <a href="https://github.com/NPLinker/nplinker-webapp/pkgs/container/nplinker-webapp">GitHub Container Registry page</a>.</li> |
| 155 | +</ul> |
| 156 | + |
| 157 | +</details> |
0 commit comments