Edit on GitHub

starplast.localization

hyperLOPIT localization: both inference methods, and orthoLOPIT across three species.

hyperLOPIT assigns a compartment to 3,827 of 8,140 Toxoplasma genes — 47%. The other 53% are not "cytosolic by default"; assignment tracks protein abundance, so the unlabelled set is biased toward low-abundance proteins, which are disproportionately the secreted effectors people care about. Raising coverage therefore means transferring labels, and transfer must never be confused with measurement.

Three things this module keeps distinct:

  • MAP and MCMC are separate columns. They are two inferences over the same experiment and they disagree for 980 of 3,827 genes (26%). Collapsing to one hides that; lopit_methods_agree exposes it.
  • orthoLOPIT is a transfer, not a measurement. For a gene with no native call, the measured labels of its orthologs in P. falciparum and C. parvum are consulted. Compartment vocabularies differ per species (Toxo says "micronemes", Plasmodium "Micronemes", Crypto "Microneme"), so everything is mapped through lopit_vocabulary_dictionary.csv to one of 12 unified categories first. A label transfers only when every donor agrees; disagreement is left unlabelled rather than resolved by vote.
  • compartment stays measured. compartment_best carries the fallback and compartment_source records which of the two any given label came from, so nothing downstream can silently mistake an inference for an observation.

C. parvum deserves a note: MASTER_parasite_wide_by_orthogroup.csv carries a cpar_lopit_native column that is empty for every row, even though the measured Crypto hyperLOPIT exists on disk with 1,742 assignments. This module joins it from the source file instead of trusting that column.

SPECIES = {'tgon': ('lopit_toxoplasma_gondii_ME49.csv', 'gene_source_id', 'MAP_location'), 'pfal': ('lopit_plasmodium_falciparum_3D7.csv', 'gene_source_id', 'simplified'), 'cpar': ('lopit_cryptosporidium_parvum_MEASURED_Guerin2023.csv', 'gene_source_id', 'MAP_location')}
DONORS = ('pfal', 'cpar')
UNMAPPED = '(lineage-specific: unmapped)'
MIN_TRANSFER_ACCURACY = 0.8
MIN_CALIBRATION = 10
def lopit_labels( ds: str, nodes: pandas.DataFrame, log=<built-in function print>) -> pandas.DataFrame:

Attach measured hyperLOPIT (MAP + MCMC) and orthoLOPIT transfer to nodes, in place.