neurosnap.algos.wolfpsort package#
- class neurosnap.algos.wolfpsort.WoLFPSortPredictor(organism_type='fungi')[source]#
Bases:
objectPure Python WoLF PSORT port with structured outputs.
- VALID_ORGANISMS = {'animal', 'fungi', 'plant'}#
- __init__(organism_type='fungi')[source]#
Initialize a WoLF PSORT predictor for one bundled organism model.
- Parameters:
organism_type (
str) – Bundled model to use. Supported values are"fungi","animal", and"plant".- Returns:
None. The predictor is initialized in place.
- compute_features_dataframe(sequences)[source]#
Compute WoLF PSORT features and return them as a DataFrame.
- predict(sequences, include_features=False, include_neighbors=False)[source]#
Predict localization scores for one or more protein sequences.
- Parameters:
- Return type:
- Returns:
List of dictionaries containing the predicted class, ranked class scores, human-readable labels, best
kvalue, and optional feature / neighbor details.
- neurosnap.algos.wolfpsort.compute_features(sequences)[source]#
Compute WoLF PSORT features using the fungi feature definition.
- neurosnap.algos.wolfpsort.compute_features_dataframe(sequences)[source]#
Compute WoLF PSORT features and return them in DataFrame form.
- neurosnap.algos.wolfpsort.predict_localization(sequences, organism_type='fungi', include_features=False, include_neighbors=False, as_dataframe=True)[source]#
Predict WoLF PSORT localization scores for one or more sequences.
- Parameters:
sequences (
Iterator[Tuple[str,str]]) – Iterator yielding(identifier, sequence)tuples.organism_type (
str) – Bundled organism model to use. Supported values are"fungi","animal", and"plant".include_features (
bool) – WhenTrue, include the computed feature dictionary in dictionary output or expand feature columns in DataFrame output.include_neighbors (
bool) – WhenTrue, include the ranked training neighbors in dictionary output. This is not supported in DataFrame mode.as_dataframe (
bool) – WhenTrue, return a DataFrame summary. WhenFalse, return a list of dictionaries.
- Returns:
DataFrame or list of dictionaries, depending on
as_dataframe.