Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-slim
FROM python:3.12-slim

WORKDIR /app

Expand All @@ -24,4 +24,4 @@ EXPOSE 8501

HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health

ENTRYPOINT ["streamlit", "run", "Home.py", "--server.port=8501", "--server.address=0.0.0.0"]
ENTRYPOINT ["streamlit", "run", "Home.py", "--server.port=8501", "--server.address=0.0.0.0"]
29 changes: 18 additions & 11 deletions ParsingModule.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
import pronto
from pronto import Ontology
from collections import defaultdict
import json
import gzip
import json
import os
import pickle
import streamlit as st
import re
import subprocess
import tempfile
from collections import defaultdict

import numpy as np
import pandas as pd
import re
from st_aggrid import AgGrid, GridOptionsBuilder, GridUpdateMode, DataReturnMode
import pronto
import streamlit as st
from pronto import Ontology
from st_aggrid import (AgGrid, DataReturnMode, GridOptionsBuilder,
GridUpdateMode)
from streamlit_tree_select import tree_select
import subprocess


def help():
"""This module contains all parsable functions necessary to build the SDRF GUI"""
Expand Down Expand Up @@ -277,7 +282,7 @@ def multiple_ontology_tree(column, element_list, nodes, df, multiple_in_one = Fa

else:
df.fillna("empty", inplace=True)
st.write(f"If all cells are correctly filled in click twice on the update button")
st.write("If all cells are correctly filled in click twice on the update button")
cell_style = {"background-color": "#ffa478"}
builder = GridOptionsBuilder.from_dataframe(df)
builder.configure_columns(columns_to_adapt,editable=True,cellEditor="agSelectCellEditor",cellEditorParams={"values": all},cellStyle=cell_style)
Expand Down Expand Up @@ -403,9 +408,11 @@ def convert_df(df):
df.columns = [re.sub(r"(_\d+)", "", i) for i in df.columns]
#remove leading and trailing whitespaces from all columns
df = df.apply(lambda x: x.str.strip() if x.dtype == "object" else x)
file_path = "temp_sdrf.tsv"

_, file_path = tempfile.mkstemp()
df.to_csv(file_path, index=False, sep="\t", encoding="utf-8")
is_valid, message = validate_sdrf(file_path)
os.remove(file_path)

if is_valid is None:
st.error(message)
Expand Down Expand Up @@ -452,4 +459,4 @@ def autocomplete_species_search(taxum_list, search_term):
if len(filtered_options) > 500:
st.write("Too many closely related options to display (>500). Please refine your search.")
if len(filtered_options) == 0:
st.write("No options found. Please refine your search.")
st.write("No options found. Please refine your search.")
11 changes: 2 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
version: '3.7'
services:
version: '3.7'
services:
lessdrf:
#env_file:
# - .env
build:
context: .
dockerfile: Dockerfile
Expand All @@ -21,8 +19,3 @@
restart: on-failure
ports:
- 8501:8501
networks:
- network
networks:
network:
driver: bridge