Edit on GitHub

starplast.fetch_names

Fetch the VEuPathDB identity tables -> data/toxodb_*.tsv and data/plasmodb_identity.tsv.

The literature does not cite genes by one identifier, so the identity layer needs more than symbols:

  • gene_name -- the symbol (GRA16). ToxoDB has one for ~1,600 of 8,843 ME49 genes.
  • gene_previous_ids -- pre-2012 accessions (TGME49_008830) that older papers still cite.
  • GT1 / VEG accessions -- the strain ids papers use interchangeably with ME49; they map to ME49 by numeric suffix (verified at 99.5% orthogroup agreement, see identity.py).

The Plasmodium arm needs the same thing and for the same reason. It had no identity layer at all until 2026-08-18, which was survivable only while every Pf source happened to be keyed on current PF3D7_ accessions -- the first one that was not (a 2014 ribosome-profiling deposit, keyed on the pre-2012 chromosome-based ids PFE0630c and PF13_0222) joined zero of its 3,629 genes. That is the same failure the Toxoplasma layer was built for, met on the second arm.

Run once; the outputs are committed so the build works offline.

OUT = '/home/runner/work/starplast/starplast/starplast/data'
URL = 'https://toxodb.org/toxo/service/record-types/transcript/searches/GenesByTaxon/reports/attributesTabular'
PLASMODB_URL = 'https://plasmodb.org/plasmo/service/record-types/transcript/searches/GenesByTaxon/reports/attributesTabular'
PLASMODB_IDENTITY = 'plasmodb_identity.tsv'
RENAME = {'Gene ID': 'gene_id', 'Gene Name or Symbol': 'gene_name', 'Previous ID(s)': 'previous_ids', 'Ortholog Group': 'orthogroup', 'Product Description': 'product'}
API_KEY_ENV = 'VEUPATHDB_API_KEY'
API_KEY_HEADER = 'Auth-Key'
API_KEY_HELP = 'VEuPathDB now requires an API key for its tabular reports. Register at toxodb.org or plasmodb.org, copy the key from Profile > Web Services Access, and set it in the environment:\n export VEUPATHDB_API_KEY=<your key>\nThe identity tables this fetches are COMMITTED, so a build works without it; the key is only needed to refresh them.'
def api_key() -> str:

The configured VEuPathDB key, or an empty string.

def fetch( organism: str, attributes: list, url: str = 'https://toxodb.org/toxo/service/record-types/transcript/searches/GenesByTaxon/reports/attributesTabular') -> str:

Retrieve a tabular attribute report from ToxoDB or PlasmoDB for one organizm.

Raises PermissionError with instructions when no API key is configured, rather than letting the request come back 401 from three frames down with a message about an endpoint.

def write(txt: str, path: str) -> int:

Write a fetched table to disk, creating the directory if needed.

def main():

Fetch the ToxoDB identity and strain accession tables the build joins through.