Skip to content
Closed
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
08a8985
Fixed Online vs. Local Mode section in User Guide
Imama-Kainat Mar 17, 2025
a2fa72b
fix the online vs local mode in user guide
Imama-Kainat Mar 17, 2025
8a9b110
Updated Windows Executable Logo to Match Documentation
Imama-Kainat Mar 18, 2025
dd68862
add verification of virtual environment
Imama-Kainat Mar 18, 2025
2295fc2
Fix the documentation
Imama-Kainat Mar 19, 2025
781d369
i have made a auto python script for my own ease for running stramlit…
Imama-Kainat Mar 19, 2025
7e61eaa
removed unnecessary imports from app.py
Imama-Kainat Mar 28, 2025
cd1bbf2
fix the user_guid.md online mode
Imama-Kainat Mar 28, 2025
c5a0605
fix the extra python environment checking in win_exe_with_pyinstaller
Imama-Kainat Mar 28, 2025
d72b090
Merge branch 'main' into fix-docs-aligned
Imama-Kainat Mar 28, 2025
2d4f431
fix the common/common.py in build_app.md
Imama-Kainat Mar 28, 2025
965bef6
removed the old logo and add the newlogo.ico and fix it
Imama-Kainat Mar 28, 2025
d4d3393
Merge branch 'fix-docs-aligned' of https://github.com/Imama-Kainat/st…
Imama-Kainat Mar 28, 2025
4452552
fix the documenation of toppworkflow of quickstart
Imama-Kainat Mar 28, 2025
95974c4
fix the file upload with current folder and code structure in toppfra…
Imama-Kainat Mar 29, 2025
ff1b149
Fix: update parameter input docs to match current file structure
Imama-Kainat Mar 29, 2025
2c0d864
fixing all
Imama-Kainat Mar 29, 2025
4d37db6
Revert "fixing all"
Imama-Kainat Mar 29, 2025
33ce177
Revert "Fix: update parameter input docs to match current file struct…
Imama-Kainat Mar 29, 2025
86846e7
fix comon/common.py file
Imama-Kainat Mar 29, 2025
64ea787
fix the paramters in toppframework.py
Imama-Kainat Mar 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions .github/workflows/build-windows-executable-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ jobs:
$content.version = $VERSION
$content | ConvertTo-Json -Depth 100 | Set-Content settings.json


- name: Download package as artifact
uses: actions/download-artifact@v4
with:
Expand All @@ -209,7 +210,7 @@ jobs:
cp -r openms-package/share ../share

- name: Set up Python (regular distribution)
uses: actions/setup-python@v5
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }} # Use the same version as the embeddable version

Expand Down Expand Up @@ -258,15 +259,7 @@ jobs:

- name: Create .bat file
run: |
echo '@echo off' > ${{ env.APP_NAME }}.bat
echo '' >> ${{ env.APP_NAME }}.bat
echo 'REM Create .streamlit directory in user''s home if it doesn''t exist' >> ${{ env.APP_NAME }}.bat
echo 'if not exist "%USERPROFILE%\.streamlit" mkdir "%USERPROFILE%\.streamlit"' >> ${{ env.APP_NAME }}.bat
echo '' >> ${{ env.APP_NAME }}.bat
echo 'REM Create credentials.toml with empty email to disable email prompt' >> ${{ env.APP_NAME }}.bat
echo 'copy /Y ".streamlit\credentials.toml" "%USERPROFILE%\.streamlit\credentials.toml" > nul' >> ${{ env.APP_NAME }}.bat
echo '' >> ${{ env.APP_NAME }}.bat
echo 'start /min .\python-${{ env.PYTHON_VERSION }}\python -m streamlit run app.py local' >> ${{ env.APP_NAME }}.bat
echo " start /min .\python-${{ env.PYTHON_VERSION }}\python -m streamlit run app.py local" > ${{ env.APP_NAME }}.bat

- name: Create All-in-one executable folder
run: |
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ jobs:
pip install pytest
- name: Test
run: |
python -m pytest test_gui.py tests/

python -m pytest test_gui.py
7 changes: 2 additions & 5 deletions .streamlit/config.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
[browser]
gatherUsageStats = false

[global]
developmentMode = false

[server]
maxUploadSize = 200 #MB
port = 8501 # should be same as configured in deployment repo

[theme]

# The preset Streamlit theme that your custom theme inherits from. One of "light" or "dark".
# base =

Expand All @@ -25,4 +22,4 @@ primaryColor = "#29379b"
# textColor =

# Font family for all text in the app, except code blocks. One of "sans serif", "serif", or "monospace".
# font =
# font =
2 changes: 0 additions & 2 deletions .streamlit/credentials.toml

This file was deleted.

82 changes: 25 additions & 57 deletions content/file_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,14 @@
import streamlit as st
import pandas as pd

from src.common.common import (
page_setup,
save_params,
v_space,
show_table,
TK_AVAILABLE,
tk_directory_dialog,
)
from src.common.common import page_setup, save_params, v_space, show_table, TK_AVAILABLE, tk_directory_dialog
from src import fileupload

params = page_setup()

st.title("File Upload")

# Check if there are any files in the workspace
mzML_dir = Path(st.session_state.workspace, "mzML-files")
if not any(Path(mzML_dir).iterdir()):
# No files present, load example data
fileupload.load_example_mzML_files()

tabs = ["File Upload"]
tabs = ["File Upload", "Example Data"]
if st.session_state.location == "local":
tabs.append("Files from local folder")

Expand All @@ -41,74 +28,55 @@
else:
st.warning("Select files first.")

# Example mzML files
with tabs[1]:
st.markdown("Short information text on example data.")
cols = st.columns(3)
if cols[1].button("Load Example Data", type="primary"):
fileupload.load_example_mzML_files()

# Local file upload option: via directory path
if st.session_state.location == "local":
with tabs[1]:
with tabs[2]:
st_cols = st.columns([0.05, 0.95], gap="small")
with st_cols[0]:
st.write("\n")
st.write("\n")
dialog_button = st.button(
"📁",
key="local_browse",
help="Browse for your local directory with MS data.",
disabled=not TK_AVAILABLE,
)
dialog_button = st.button("📁", key='local_browse', help="Browse for your local directory with MS data.", disabled=not TK_AVAILABLE)
if dialog_button:
st.session_state["local_dir"] = tk_directory_dialog(
"Select directory with your MS data",
st.session_state["previous_dir"],
)
st.session_state["local_dir"] = tk_directory_dialog("Select directory with your MS data", st.session_state["previous_dir"])
st.session_state["previous_dir"] = st.session_state["local_dir"]
with st_cols[1]:
# with st.form("local-file-upload"):
local_mzML_dir = st.text_input(
"path to folder with mzML files", value=st.session_state["local_dir"]
)
local_mzML_dir = st.text_input("path to folder with mzML files", value=st.session_state["local_dir"])
# raw string for file paths
local_mzML_dir = rf"{local_mzML_dir}"
cols = st.columns([0.65, 0.3, 0.4, 0.25], gap="small")
copy_button = cols[1].button(
"Copy files to workspace", type="primary", disabled=(local_mzML_dir == "")
)
use_copy = cols[2].checkbox(
"Make a copy of files",
key="local_browse-copy_files",
value=True,
help="Create a copy of files in workspace.",
)
copy_button = cols[1].button("Copy files to workspace", type="primary", disabled=(local_mzML_dir == ""))
use_copy = cols[2].checkbox("Make a copy of files", key="local_browse-copy_files", value=True, help="Create a copy of files in workspace.")
if not use_copy:
st.warning(
"**Warning**: You have deselected the `Make a copy of files` option. "
"This **_assumes you know what you are doing_**. "
"This means that the original files will be used instead. "
)
st.warning(
"**Warning**: You have deselected the `Make a copy of files` option. "
"This **_assumes you know what you are doing_**. "
"This means that the original files will be used instead. "
)
if copy_button:
fileupload.copy_local_mzML_files_from_directory(local_mzML_dir, use_copy)

mzML_dir = Path(st.session_state.workspace, "mzML-files")
if any(Path(mzML_dir).iterdir()):
v_space(2)
# Display all mzML files currently in workspace
df = pd.DataFrame(
{
"file name": [
f.name
for f in Path(mzML_dir).iterdir()
if "external_files.txt" not in f.name
]
}
)

df = pd.DataFrame({"file name": [f.name for f in Path(mzML_dir).iterdir() if "external_files.txt" not in f.name]})

# Check if local files are available
external_files = Path(mzML_dir, "external_files.txt")
if external_files.exists():
with open(external_files, "r") as f_handle:
external_files = f_handle.readlines()
external_files = [f.strip() for f in external_files]
df = pd.concat(
[df, pd.DataFrame({"file name": external_files})], ignore_index=True
)

df = pd.concat([df, pd.DataFrame({"file name": external_files})], ignore_index=True)

st.markdown("##### mzML files in current workspace:")
show_table(df)
v_space(1)
Expand Down
14 changes: 0 additions & 14 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,6 @@ Select the latest successfull run and download the zip file from the artifacts s

Clone the [streamlit-template repository](https://github.com/OpenMS/streamlit-template). It includes files to install dependencies via pip or conda.

### via pip in a new Python environment

Create a virtual environment

`python3 -m venv <myenvpath>`

Activate the virtual environment

`source .venv/bin/activate`

To install all required depdencies via pip in the new Python environment, run the following command in the terminal:

`pip install -r requirements.txt`

### via pip in an existing Python environment

To install all required depdencies via pip in an already existing Python environment, run the following command in the terminal:
Expand Down
31 changes: 10 additions & 21 deletions docs/user_guide.md
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should not remove this part of the documentation.

Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,18 @@ In the OpenMS web application, workspaces are designed to keep your analysis org
- **Workspace Specific Parameters and Files**: Each workspace stores parameters and files (uploaded input files and results from workflows).
- **Persistence**: Your workspaces and parameters are saved, so you can return to your analysis anytime and pick up where you left off. Simply bookmark the page!

## Online and Local Mode Differences

- **File Uploads**:
- *Local Mode*: Multiple file uploads are supported, giving you flexibility when working with large datasets.
- *Online Mode (Not Enabled in This Deployment)*: When enabled, file uploads may be limited to one file at a time to optimize server performance.

### File Uploads
- **Online Mode**: You can upload only one file at a time. This helps manage server load and optimizes performance.

- **Local Mode**: Multiple file uploads are supported, giving you flexibility when working with large datasets. Additionally, the file size upload limit can be adjusted in the following ways:
1. **Using `.streamlit/config.toml`**:
- You can modify the `.streamlit/config.toml` file and set the `maxUploadSize` parameter to your desired value. By default, this is set to 200MB.
- Example:
```toml
[server]
maxUploadSize = 500 # Set the upload limit to 500MB
```
2. **Using CLI Command**:
- You can customize the file size upload limit directly when running the application using the `--server.maxUploadSize` argument.
- Example:
```bash
python run_app.py --server.maxUploadSize 500
```
- This sets the upload limit to 500MB for the current session.

- **Workspace Access**:
- In online mode, workspaces are stored temporarily and will be cleared after seven days of inactivity.
- In local mode, workspaces are saved on your local machine, allowing for persistent storage. Workspace directory can be specified in the `settings.json`. Defaults to `..` (parent directory).
- *Local Mode*: Workspaces are saved on your local machine, allowing for persistent storage.
- The workspace directory can be specified in `settings.json` .
- Defaults to `..` (parent directory).
- *Online Mode (Not Enabled in This Deployment)*: If enabled, workspaces would be temporarily stored and cleared after seven days of inactivity.


## Downloading Results

Expand Down
Loading