# HG changeset patch # User tduigou # Date 1761546387 0 # Node ID 7a57f54c130f3e330dda7abde66477b5329f50c2 # Parent 6bcd8f09158d16d2347a97b236ea860d9f6d93a4 planemo upload for repository https://github.com/brsynth/synbiocad-galaxy-wrappers commit dda8b49daae051df39f4a58d5c0d81fbc393cdf4 diff -r 6bcd8f09158d -r 7a57f54c130f get_infos.py --- a/get_infos.py Tue Apr 01 10:00:36 2025 +0000 +++ b/get_infos.py Mon Oct 27 06:26:27 2025 +0000 @@ -1,7 +1,6 @@ from argparse import ArgumentParser from libsbml import readSBMLFromFile -from taxonid import get_taxonid -from requests import get as r_get +from requests import RequestException, get as r_get def get_biomass_rxn(sbml_doc): @@ -62,12 +61,32 @@ return organism except Exception as e: print(f"Error querying BiGG: {e}") - return None + return -1 + -def get_taxon_id(input_name): +def get_taxonid(organism_name: str) -> str: + """Query NCBI Taxonomy for a given organism name and return its Taxon ID.""" + url = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi" + params = { + "db": "taxonomy", + "term": organism_name, + "retmode": "json" + } + try: + response = r_get(url, params=params, timeout=10) + response.raise_for_status() + data = response.json() + ids = data.get("esearchresult", {}).get("idlist", []) + return ids[0] if ids else -1 + except RequestException as e: + print(f"Error querying NCBI for '{organism_name}': {e}") + return -1 + + +def get_taxon_id(input_name: str) -> str: """Try BiGG model name first, then NCBI directly.""" print(f"Trying input: {input_name}") - + # Try resolving as a BiGG model organism = get_organism_from_bigg_model(input_name) if organism: diff -r 6bcd8f09158d -r 7a57f54c130f get_sbml_model.xml --- a/get_sbml_model.xml Tue Apr 01 10:00:36 2025 +0000 +++ b/get_sbml_model.xml Mon Oct 27 06:26:27 2025 +0000 @@ -1,11 +1,10 @@ - + Get an SBML model (BiGG) curl gzip python-libsbml requests - taxonid Select file from the History - +
- - - + + +
@@ -55,23 +59,27 @@ - + - + - + - + @@ -81,17 +89,21 @@ - + - + - - + + @@ -113,10 +125,12 @@ cond_src['from_src'] == 'from_history' - + cond_src['from_src'] == 'from_history' - + cond_src['from_src'] == 'from_history' @@ -205,15 +219,15 @@ Download the selected SBML model fromg BiGG database or get statistics from local SBML model. ]]> - + @unpublished{get_sbml_model - author = {Joan Hérisson}, - title = {{get_sbml_model}}, - url = {https://github.com/brsynth/}, + author = {Joan Hérisson}, + title = {{get_sbml_model}}, + url = {https://github.com/brsynth/}, } -
+
\ No newline at end of file