From abb658bc53a3a95493eaeaf5d6a380e287699bb7 Mon Sep 17 00:00:00 2001 From: Eduard Kerkhoven Date: Wed, 28 Oct 2026 22:37:52 +0100 Subject: [PATCH] getECstring: split EC numbers on semicolons as well as spaces A database cell that joins codes with ';' and no space, such as '1.1.1.1;2.2.2.2', gave the single string 'EC1.1.1.12.2.2.2'. The cell is now split on white space and semicolons, as geckopy does. --- src/get_enzyme_data/getECstring.m | 6 ++++-- test/VerificationMatrix.tsv | 4 ++-- test/unit_tests/parityDecisionTests.m | 13 +++++++++++++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/get_enzyme_data/getECstring.m b/src/get_enzyme_data/getECstring.m index 8f4f2e45..e06955d8 100644 --- a/src/get_enzyme_data/getECstring.m +++ b/src/get_enzyme_data/getECstring.m @@ -10,7 +10,8 @@ % EC_set : char % existing EC string to which the EC numbers are appended. % ecNumbers : char -% space-separated EC numbers associated to the protein. +% EC numbers associated to the protein, separated by white space and/or +% semicolons. % % Returns % ------- @@ -25,7 +26,8 @@ % -------- % findECInDB %In case of several ec numbers for the same protein -new_EC_set = replace(strsplit(ecNumbers,' '),';',''); +new_EC_set = regexp(strtrim(ecNumbers),'[;\s]+','split'); +new_EC_set = new_EC_set(~cellfun(@isempty,new_EC_set)); for l = 1:length(new_EC_set) EC_set = [EC_set 'EC' new_EC_set{l}]; if l