From 8d9c2145541aeeb41b02a863bc9e0b0a394df9ee Mon Sep 17 00:00:00 2001 From: ddeightmore Date: Thu, 17 Jul 2025 13:15:47 -0700 Subject: [PATCH 1/3] Update extract.py: add NCBI taxonomy RRIDs --- scibot/extract.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scibot/extract.py b/scibot/extract.py index d380bde..8ebf791 100644 --- a/scibot/extract.py +++ b/scibot/extract.py @@ -340,6 +340,12 @@ def find_rrids(text): for prefix, a, b, nums, suffix in matches4: yield prefix, f'RRID:SAMN{nums.strip()}', f'{a}{b}{nums}', suffix + # fifth round for NCBI Taxonomy + regex5 = '(.{0,32})(NCBI)(((\s|:){0,2})((txid|Taxon)(_|:)?))([0-9]{3,8})([^\w].{0,31})' + matches5 = re.findall(regex5, text) + for prefix, ncbi, tax, nums, suffix in matches5: + yield prefix, f'RRID:NCBITaxon_{nums.strip()}', f'{a}{b}{nums}', suffix + # extract from post From be93cda5917aff27ee3044732f362cdc6be513ba Mon Sep 17 00:00:00 2001 From: ddeightmore Date: Thu, 17 Jul 2025 13:27:32 -0700 Subject: [PATCH 2/3] Update extract.py --- scibot/extract.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scibot/extract.py b/scibot/extract.py index 8ebf791..aa1d4d4 100644 --- a/scibot/extract.py +++ b/scibot/extract.py @@ -341,10 +341,10 @@ def find_rrids(text): yield prefix, f'RRID:SAMN{nums.strip()}', f'{a}{b}{nums}', suffix # fifth round for NCBI Taxonomy - regex5 = '(.{0,32})(NCBI)(((\s|:){0,2})((txid|Taxon)(_|:)?))([0-9]{3,8})([^\w].{0,31})' + regex5 = '(.{0,32})(NCBI)(((:|(:\s))?)(((t|T)(a)?x((id)|(Id)|(ID))|Taxon)(_|:)?(\s)?))([0-9]{3,8})([^\w].{0,31})' matches5 = re.findall(regex5, text) for prefix, ncbi, tax, nums, suffix in matches5: - yield prefix, f'RRID:NCBITaxon_{nums.strip()}', f'{a}{b}{nums}', suffix + yield prefix, f'RRID:NCBITaxon_{nums.strip()}', f'{ncbi}{tax}{nums}', suffix # extract from post From 57de8d9c6a3596dcb1257f7e9e03fa0bb4d76d2f Mon Sep 17 00:00:00 2001 From: ddeightmore Date: Fri, 18 Jul 2025 11:56:48 -0700 Subject: [PATCH 3/3] Update extract.py --- scibot/extract.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scibot/extract.py b/scibot/extract.py index aa1d4d4..2198fca 100644 --- a/scibot/extract.py +++ b/scibot/extract.py @@ -341,9 +341,9 @@ def find_rrids(text): yield prefix, f'RRID:SAMN{nums.strip()}', f'{a}{b}{nums}', suffix # fifth round for NCBI Taxonomy - regex5 = '(.{0,32})(NCBI)(((:|(:\s))?)(((t|T)(a)?x((id)|(Id)|(ID))|Taxon)(_|:)?(\s)?))([0-9]{3,8})([^\w].{0,31})' + regex5 = r'(.{0,32})(NCBI)(:?\s?)(taxid|Taxid|taxId|TaxId|taxID|TaxID|txid|txId|txID|Txid|TxId|TxID|Taxon|Taxonomy)(_|:)(\s?)([0-9]{3,8})([^\w].{0,31})' matches5 = re.findall(regex5, text) - for prefix, ncbi, tax, nums, suffix in matches5: + for prefix, ncbi, delim1, tax, delim2, delim3, nums, suffix in matches5: yield prefix, f'RRID:NCBITaxon_{nums.strip()}', f'{ncbi}{tax}{nums}', suffix