torchcell.metabolism.parameters.load_swissprot

load_swissprot(model_dir: str) → dict[str, dict[str, str]][source]

Read data/databases/swissprot.tsv, keyed by systematic ORF name.

The ``gene_id`` column is an alias LIST, not a two-field pair, and reading it as a pair is a quiet 63 % data loss. It holds every name UniProt knows for the locus, space separated and in no fixed order or length – "RAM2 YKL019W" is two tokens, but "ERG20 BOT3 FDS1 FPP1 YJL167W J0525" is six, with the systematic name fifth and an ordered-locus alias last. Token counts across the file run from 1 to 11.

Taking the last token therefore matches only 430 of the GEM’s 1,161 genes (37 %), and taking the first matches 38. Selecting the token that is a systematic ORF name matches 1,161 of 1,161. The lesson is the general one: a column whose separator is a space is a list until proven otherwise, and the check that catches it is joining against a known key set and looking at the hit rate rather than at the first few rows.