From c616dd30bc9ad6b690046491cd62347ea30b7802 Mon Sep 17 00:00:00 2001 From: Nils Hoffmann <3309580+nilshoffmann@users.noreply.github.com> Date: Tue, 30 Jan 2024 12:05:27 +0100 Subject: [PATCH] Revert "Adaptations for SDRF file creation from MetabolLights studies mentioned in https://github.com/bigbio/proteomics-sample-metadata/issues/678" This reverts commit da0bd61fc31026b91c32b4dc22d831b0d2b9e993. --- Home.py | 13 +++++-------- pages/1_1. Mapping_local_metadata.py | 6 ++---- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/Home.py b/Home.py index 2636a04..ddf43dd 100644 --- a/Home.py +++ b/Home.py @@ -13,9 +13,6 @@ from PIL import Image import base64 import io - -max_samples = 350 - st.set_page_config( page_title="lesSDRF", layout="wide", @@ -108,12 +105,12 @@ def load_data(): Upload your intermediate SDRF file here:""") upload_df = st.file_uploader( - "Upload intermediate SDRF file", type=["tsv"], accept_multiple_files=False, help=f'Upload a previously saved SDRF file. It should be in tsv format and should not contain more than {max_samples} samples' + "Upload intermediate SDRF file", type=["tsv"], accept_multiple_files=False, help='Upload a previously saved SDRF file. It should be in tsv format and should not contain more than 250 samples' ) if upload_df is not None: template_df = pd.read_csv(upload_df, sep='\t') - if template_df.shape[0]>max_samples: - st.error(f'Too many samples, please upload a maximum of {max_samples}') + if template_df.shape[0]>250: + st.error('Too many samples, please upload a maximum of 250 samples') else: st.write(template_df) st.session_state["template_df"] = template_df @@ -153,8 +150,8 @@ def load_data(): #remove trailing and leading spaces uploaded_names = [name.strip() for name in uploaded_names] filenames.append(uploaded_names) - if len(filenames[0]) > max_samples: - st.error(f'Too many samples, please upload a maximum of {max_samples} samples') + if len(filenames[0]) > 250: + st.error('Too many samples, please upload a maximum of 250 samples') else: st.write(f"Added filenames: {filenames[0]}") ## Store filenames in the dataframe diff --git a/pages/1_1. Mapping_local_metadata.py b/pages/1_1. Mapping_local_metadata.py index fd0a04b..4226696 100644 --- a/pages/1_1. Mapping_local_metadata.py +++ b/pages/1_1. Mapping_local_metadata.py @@ -53,7 +53,7 @@ def get_base64_image(image): """If you have a local metadata file available, you can use this file to map the data to the required SDRF information. """ ) st.markdown( - """**Important:** you can upload the file in csv, tsv, txt (tab-separated), or xlsx format. + """**Important:** you can upload the file in csv, tsv or xlsx format. The order of your raw file names should match the order in which you inputted them in the previous step""" ) @@ -77,7 +77,7 @@ def get_base64_image(image): *The experimental metadata has been generated using lesSDRF and is available through ProteomeXchange with the dataset identifier [PXDxxxxxxx]*""") # Ask the user to upload their own metadata file and to map it to the columns of the template file metadata_sheet = st.file_uploader( - "Upload your local metadata file (.csv, .tsv, .txt (tab-separated), or .xls)", type=["csv", "tsv", "txt", "xlsx"] + "Upload your local metadata file (.csv, .tsv or .xls)", type=["csv", "tsv", "xlsx"] ) if metadata_sheet is not None: file_extension = metadata_sheet.name.split(".")[-1] @@ -85,8 +85,6 @@ def get_base64_image(image): metadata_df = pd.read_csv(metadata_sheet) elif file_extension == "tsv": metadata_df = pd.read_csv(metadata_sheet, sep="\t") - elif file_extension == "txt": - metadata_df = pd.read_csv(metadata_sheet, sep="\t") elif file_extension == "xlsx": metadata_df = pd.read_excel(metadata_sheet) st.write("Your metadata file:")