Edit on GitHub

starplast.structure_catalog

Index local AF3 predictions without copying coordinates into the package.

Models are matched to the bundled coding sequences, never by a numeric suffix alone. Fragments retain residue ranges; complexes and controls stay out of the single-protein feature table. Confidence describes a prediction, not an assay.

DATA = PosixPath('/home/runner/work/starplast/starplast/starplast/data')
def catalog_path() -> pathlib.Path:

User-selected index, or the ordinary user cache location.

def protein_sequences( cds_path=PosixPath('/home/runner/work/starplast/starplast/starplast/data/toxodb_cds.tsv.gz')) -> dict[str, str]:

Translate complete CDS records; omit internal stops and conflicting isoforms.

A terminal stop is removed. Ambiguous amino acids remain X and participate in exact sequence matching. No missing sequence is inferred from gene names.

def uniprot_aliases( mapping_path, node_ids, identity_path=PosixPath('/home/runner/work/starplast/starplast/starplast/data/toxodb_identity.tsv')):

Resolve explicit UniProt/gene pairs through current and previous accessions.

def model_files(roots):

Yield root-ranked AF3 models and flat mirrors, excluding seed replicates.

def match_sequence(sequence, sequences, exact, alias=None):

Return unique gene, zero-based interval and match status; ambiguity abstains.

def read_chain(path):

Read one peptide chain and residue pLDDT from an AF3 model using Gemmi.

C-alpha B factors are AF3's residue-level confidence proxy. Coordinates are only used for descriptive geometry; this function does not infer function.

def geometry(coords, plddt):

Describe only confident C-alpha coordinates (pLDDT >= 70).

def inventory(roots, sequences, aliases=None, log=<built-in function print>):

Return model inventory and overlap-aware gene features from local AF3 files.

Every coordinate file is fingerprinted. Identical mirrors are recorded but contribute once. Overlapping fragments use the highest residue confidence; whole-protein geometry is computed only from complete models. Missing residues stay missing rather than receiving a pLDDT of zero.

def local_model(gene_id, index_path=None):

Best available indexed single-protein file, preferring complete models.

def main():

Build a portable feature table and machine-local structure index.

def attach_features( nodes, feature_path=PosixPath('/home/runner/work/starplast/starplast/starplast/data/af3_features.parquet')):

Attach sequence-verified AF3 features by gene ID, preserving row order/index.