SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2501.05644 · 2025

Interpretable Enzyme Function Prediction via Residue-Level Detection

arXiv · PDF · Open in the Atlas

Code that ran

7 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 1 failure of our instrument; 4 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2501.05644.json · badge: /api/ran/2501.05644.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
yangzhao1230/protdetr canonical (classifier label)
classifier basis not recorded on the link
7 ran · 4 no recorded run
FunctionStatusWhere it lives
build_matcher Ran
ran; our contract draft was wrong, not the code
yangzhao1230/protdetr/models/matcher.py
code served (permissive licence) · get_code("f8af81a0530fa25f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned HungarianMatcher. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from torch import nn

torch.manual_seed(0)

# Create a simple args class with the required attribute
class Args:
    def __init__(self):
        self.set_cost_class = 1.0

ARGS = {
    'args': Args()
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type HungarianMatcher — a HungarianMatcher output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a HungarianMatcher output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
build_position_encoding Ran
ran on a synthesized input
yangzhao1230/protdetr/models/position_encoding.py
code served (permissive licence) · get_code("ea84c6853134f470")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned SinusoidalPositionalEncoding. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from torch import nn

torch.manual_seed(0)

class MockArgs:
    def __init__(self, position_embedding, hidden_dim):
        self.position_embedding = position_embedding
        self.hidden_dim = hidden_dim

ARGS = {
    'args': MockArgs(position_embedding='sine', hidden_dim=4)
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SinusoidalPositionalEncoding — a SinusoidalPositionalEncoding output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SinusoidalPositionalEncoding output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
build_record Ran
ran on a synthesized input
yangzhao1230/protdetr/predict_multi.py
code served (permissive licence) · get_code("c491cd32e6fc4323")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# build_record takes two parameters: entry and sequence
# entry is used with .strip()
# sequence is used with .strip(), .upper(), slicing [:1022], and len()

entry = "  test_entry  "
sequence = "  acgtacgtacgt  "

ARGS = {
    "entry": entry,
    "sequence": sequence
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
decode_multi_predictions Ran
ran on a synthesized input
yangzhao1230/protdetr/engine.py
code served (permissive licence) · get_code("d733fdfa80e18d23")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create logits tensor: (batch_size=2, num_queries=3, num_labels_plus_one=5)
# The function expects logits of shape (batch_size, num_queries, num_labels)
# but it also slices with :-1 and compares with num_labels, so we add 1 extra dimension
batch_size = 2
num_queries = 3
num_labels = 4
logits = torch.randn(batch_size, num_queries, num_labels + 1)

# Create label_to_ec mapping
# The function indexes into this dict with label indices from 0 to num_labels-1
label_to_ec = {
    0: "1.1.1.1",
    1: "2.3.4.5",
    2: "3.4.5.6",
    3: "4.5.6.7"
}

# Set infer_threshold to filter low-confidence predictions
infer_threshold = 0.3

ARGS = {
    "logits": logits,
    "label_to_ec": label_to_ec,
    "infer_threshold": infer_threshold
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_esm_emb Ran
ran on a synthesized input
yangzhao1230/protdetr/engine.py
code served (permissive licence) · get_code("6db2c31c1869c0e5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal ESM-like model that returns the expected structure
class MockESMModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.embedding = nn.Embedding(33, 64)  # vocab_size, embedding_dim
        self.layer = nn.Linear(64, 64)
    
    def forward(self, tokens, repr_layers=None, return_contacts=False):
        # tokens shape: (batch_size, seq_length)
        embeddings = self.embedding(tokens)  # (batch_size, seq_length, 64)
        # Apply layer to get representations
        output = self.layer(embeddings)  # (batch_size, seq_length, 64)
        
        representations = {}
        if repr_layers:
            for layer_idx in repr_layers:
                representations[layer_idx] = output
        
        return {
            'representations': representations,
            'contacts': None if not return_contacts else torch.zeros(tokens.shape[0], tokens.shape[1], tokens.shape[1])
        }

# Create a minimal alphabet class
class MockAlphabet:
    def __init__(self):
        self.cls_idx = 0
        self.eos_idx = 1
        self.padding_idx = 2
        # Create a mapping for amino acids
        self.aa_to_idx = {
            'A': 3, 'C': 4, 'D': 5, 'E': 6, 'F': 7, 'G': 8, 'H': 9,
            'I': 10, 'K': 11, 'L': 12, 'M': 13, 'N': 14, 'P': 15,
            'Q': 16, 'R': 17, 'S': 18, 'T': 19, 'V': 20, 'W': 21,
            'Y': 22, 'X': 23, 'Z': 24, 'U': 25, 'O': 26
        }
    
    def get_idx(self, amino_acid):
        return self.aa_to_idx.get(amino_acid, 23)  # default to 'X'

model = MockESMModel()
alphabet = MockAlphabet()
esm_layer = 12
batch_sequences = ['ACDEFGHIKLMNPQRSTVWY', 'ACDE']
device = 'cpu'

ARGS = {
    'model': model,
    'alphabet': alphabet,
    'esm_layer': esm_layer,
    'batch_sequences': batch_sequences,
    'device': device
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_fasta Ran
ran on a synthesized input
yangzhao1230/protdetr/predict_multi.py
code served (permissive licence) · get_code("5b532509f4daac7b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tempfile
import os

# Create a temporary FASTA file for testing
temp_fasta_content = """>sequence1
ACGTACGTACGT
ACGTACGT
>sequence2
AAAAAAAAAA
>sequence3
""" + "G" * 1500  # Create a sequence longer than 1022 to test truncation

# Write to a temporary file
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.fasta')
temp_file.write(temp_fasta_content)
temp_file.close()

ARGS = {
    'input_path': temp_file.name
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
unit_length_norm2_normalize Ran
ran on a synthesized input
yangzhao1230/protdetr/infer_important_site.py
code served (permissive licence) · get_code("0d1b4c009d74fcab")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# The function takes a vector (vec_score) and normalizes it to unit length using L2 norm
# It expects a sequence/array-like input

# Create a small test vector
test_vector = np.array([3.0, 4.0, 0.0, 1.0], dtype=np.float64)

ARGS = {
    "vec_score": test_vector
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float — no output shape is stated: observe_signature.py could not observe it (no_result)
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
build_backbone Not yet run
unverified (harvested, no recorded run)
yangzhao1230/protdetr/models/backbone.py
code served (permissive licence) · get_code("e54a325f11c4d6ab")
How it ran

no invocation recorded.

build_transformer Not yet run
unverified (harvested, no recorded run)
yangzhao1230/protdetr/models/transformer.py
code served (permissive licence) · get_code("d8c3057c1f1df693")
How it ran

no invocation recorded.

fetch_sequence Not yet run
unverified (harvested, no recorded run)
yangzhao1230/protdetr/infer_important_site.py
code served (permissive licence) · get_code("cacd990d8432b0d5")
How it ran

no invocation recorded.

load_table Not yet run
unverified (harvested, no recorded run)
yangzhao1230/protdetr/predict_multi.py
code served (permissive licence) · get_code("b265994c34bba886")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 1 later) and 9 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
build_transformer 32 other papers
29 dated earlier, 3 later
2005.12872 (2020-05)
End-to-End Object Detection with Transformers
2103.12115 (2021-03)
End-to-End Trainable Multi-Instance Pose Estimation with Transformers
2104.04369 (2021-04)
Video-aided Unsupervised Grammar Induction
and 29 more not named here
build_matcher 1 other paper
1 dated earlier
2307.07947 (2023-07)
Language Conditioned Traffic Generation

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Predicting multiple functions labeled with Enzyme Commission (EC) numbers from the enzyme sequence is of great significance but remains a challenge due to its sparse multi-label classification nature, i.e., each enzyme is typically associated with only a few labels out of more than 6000 possible EC numbers. However, existing machine learning algorithms generally learn a fixed global representation for each enzyme to classify all functions, thereby they lack interpretability and the fine-grained information of some function-specific local residue fragments may be overwhelmed. Here we present an attention-based framework, namely ProtDETR (Protein Detection Transformer), by casting enzyme function prediction as a detection problem. It uses a set of learnable functional queries to adaptatively extract different local representations from the sequence of residue-level features for predicting different EC numbers. ProtDETR not only significantly outperforms existing deep learning-based enzyme function prediction methods, but also provides a new interpretable perspective on automatically detecting different local regions for identifying different functions through cross-attentions between queries and residue-level features. Code is available at https://github.com/yangzhao1230/ProtDETR.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2501.05644")
get_code_for_paper("2501.05644")
have("2501.05644")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2501.05644.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2501.05644.svg)](https://syntology.ai/paper/2501.05644)

Connect an agent — have() is free.