Skip to content

Python API

Annotation lifecycle

Public in-memory FASTA annotation API.

FastaAnnotationParameters dataclass

Configuration shared by peptide validation and protein annotation.

__post_init__()

Reject a separator that cannot define protein-group members.

FastaAnnotationReports dataclass

Persistable aggregate evidence from one annotation application.

FastaAnnotationResult dataclass

A replacement APB2 result and its FASTA reports.

FastaAnnotator

Bind one protein database and its FASTA annotation behavior.

proteins property

The bound protein table, one row per FASTA entry in file order.

__init__(proteins, parameters=DEFAULT_FASTA_ANNOTATION_PARAMETERS)

Validate and bind a reusable protein database and configuration.

annotate(parsed)

Verify peptides and then merge protein annotations in memory.

merge_annotations(parsed)

Merge FASTA annotations for every reported protein-group member.

read(fasta, formats=('uniprotkb', 'refseq'), parameters=DEFAULT_FASTA_ANNOTATION_PARAMETERS) classmethod

Read FASTA files, or the protein-fasta database Parquet written from them.

verify_peptides(parsed)

Verify every canonical stripped peptide against the protein sequences.

add_peptide_properties(parsed)

Attach sequence-derived properties to every peptide-derived level.

Writes a feature-aligned varm["peptide_properties"] computed by protein_fasta.peptide_frame.peptide_property_frame from each level's ProForma_peptide. No protein database is needed. A feature without a sequence, or with a residue outside the 20 standard amino acids, has null properties.

Raises:

Type Description
FastaAnnotationError

If the result has no peptide-derived level, already contains the output, or already records the operation.

ValueError

If a sequence is not stripped upper-case letters.

Configuration

User-selected FASTA annotation behavior.

FastaAnnotationParameters dataclass

Configuration shared by peptide validation and protein annotation.

__post_init__()

Reject a separator that cannot define protein-group members.

Errors

Expected APB FASTA annotation failures.

FastaAnnotationError

Bases: ValueError

The supplied APB2 result or protein frame cannot be annotated safely.

Reports

Immutable calculation values returned to the APB2 integration boundary.

FastaAnnotationReports dataclass

Persistable aggregate evidence from one annotation application.

PeptideCoverage dataclass

Aggregate FASTA coverage for one APB2 feature level.

decoy_feature_count instance-attribute

Rows apb2 marked apb_Decoy; a decoy is neither matched nor unmatched.

il_only_matched_feature_count instance-attribute

Targets in matched_feature_count whose peptide matches only as another I/L spelling.

matched_feature_count instance-attribute

Targets, rows apb2 did not mark apb_Decoy, whose peptide the FASTA contains.

unmatched_feature_count instance-attribute

Targets whose peptide the FASTA does not contain.

PeptideLevelMatch dataclass

Feature-aligned peptide facts and their aggregate coverage.

ProteinGroupCoverage dataclass

Aggregate FASTA coverage for reported protein-group members.

ProteinGroupMatch dataclass

Lossless member expansion, group summaries, and source relation.