From b50fd39477a5fed20ec0419c86416877b5b95e27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20H=C3=BCbner?= Date: Fri, 6 Feb 2026 16:43:25 +0100 Subject: [PATCH 1/2] Update column short_read_platform and long_read_platform --- amdirt/core/__init__.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/amdirt/core/__init__.py b/amdirt/core/__init__.py index d3043ab..e19673a 100644 --- a/amdirt/core/__init__.py +++ b/amdirt/core/__init__.py @@ -252,13 +252,17 @@ def parse_to_mag(libraries): get_filename, orientation="rev" ) libraries["short_reads_2"] = libraries["short_reads_2"].replace("NA", "") + libraries["short_reads_platform"] = libraries["instrument_model"].apply(get_sequencing_platform) libraries["longs_reads"] = "" + libraries["long_reads_platform"] = "" col2keep = [ "archive_data_accession", "archive_sample_accession", "short_reads_1", "short_reads_2", "longs_reads", + "short_reads_platform", + "long_reads_platform", ] libraries = libraries[col2keep].rename( columns={ @@ -624,3 +628,30 @@ def is_merge_size_zero( if samples.shape[0] != 0 and library_selected.shape[0] == 0: return True return False + + +def get_sequencing_platform(instrument_model: str) -> str: + """ + Infer sequencing platform from the instrument model. + + Args: + instrument_model (str): instrument model reported on ENA + Returns: + str: sequencing platform + """ + if (instrument_model.startswith("Illumina") or + instrument_model.startswith("HiSeq") or + instrument_model.startswith("NextSeq")): + return "ILLUMINA" + elif instrument_model.startswith("454"): + return "454" + elif instrument_model.startswith("AB"): + return "AB" + elif instrument_model.startswith("BGISEQ"): + return "BGISEQ" + elif instrument_model == "Complete Genomics": + return instrument_model + elif instrument_model.startswith("Helicos"): + return "Helicos" + else: + return "Unknown" From 644d307b5083088a0843179441de5b398380711b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20H=C3=BCbner?= Date: Fri, 6 Feb 2026 16:50:15 +0100 Subject: [PATCH 2/2] Escape case when three FastQ files per sample exist By default, we evaluate whether there are more than two FastQ files available in the column download_links by checking the presence of a semicolon. If there is a semicolon, the first entry is used as R1 and the second entry as R2. However, in the case that a third FastQ file is uploaded, such as the merged reads or singletons, the first FastQ file does not contain the paired reads but the second and third do. This implements the check whether there are three FastQ files to pick the correct paired FastQ files for the assembly. --- amdirt/core/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/amdirt/core/__init__.py b/amdirt/core/__init__.py index e19673a..7e00346 100644 --- a/amdirt/core/__init__.py +++ b/amdirt/core/__init__.py @@ -233,8 +233,12 @@ def get_filename(path_string: str, orientation: str) -> Tuple[str, str]: """ if ";" in path_string: - fwd = Path(path_string.split(";")[0]).name - rev = Path(path_string.split(";")[1]).name + if path_string.count(";") == 1: + fwd = Path(path_string.split(";")[0]).name + rev = Path(path_string.split(";")[1]).name + else: # three files per sample + fwd = Path(path_string.split(";")[1]).name + rev = Path(path_string.split(";")[2]).name else: fwd = Path(path_string).name rev = "NA"