SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.08198 · AAAI · 2024

PSC-CPI: Multi-Scale Protein Sequence-Structure Contrasting for Efficient and Generalizable Compound-Protein Interaction Prediction

Zicheng Liu, Lirong Wu, Stan Li, Cheng Tan, Zhangyang Gao, Haitao Lin, Yufei Huang, Bozhen Hu

arXiv · PDF · Open in the Atlas

Code that ran

7 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (3 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 3 failures of our instrument; 5 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/2402.08198.json · badge: /api/ran/2402.08198.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
lirongwu/psc-cpi canonical (classifier label)
classifier basis: census
3 ran · 3 no recorded run
LirongWu/PSC-CPI community
Papers with Code archive
4 ran · 2 no recorded run
FunctionStatusWhere it lives
load_test_data Ran
ran; our contract draft was wrong, not the code
lirongwu/psc-cpi/code/dataset.py
code served (permissive licence) · get_code("62050b71a90939d5")
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 numpy as np
import tempfile
import os

# Create a temporary directory to hold the mock .npy files
temp_dir = tempfile.mkdtemp()
data_processed_dir = temp_dir + '/'

# Create small mock numpy arrays and save them
np.save(data_processed_dir + 'protein_test.npy', np.random.rand(2, 4))
np.save(data_processed_dir + 'compound_test_ver.npy', np.random.rand(2, 4))
np.save(data_processed_dir + 'compound_test_adj.npy', np.random.rand(2, 4, 4))
np.save(data_processed_dir + 'prot_test_contacts.npy', np.random.rand(2, 4))
np.save(data_processed_dir + 'prot_test_contacts_true.npy', np.random.rand(2, 4))
np.save(data_processed_dir + 'prot_test_inter.npy', np.random.rand(2, 4))
np.save(data_processed_dir + 'prot_test_inter_exist.npy', np.random.rand(2, 4))
np.save(data_processed_dir + 'IC50_test.npy', np.random.rand(2, 4))

ARGS = {
    'data_processed_dir': data_processed_dir
}
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 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_train_data Ran
ran; our contract draft was wrong, not the code
lirongwu/psc-cpi/code/dataset.py
code served (permissive licence) · get_code("8c6bf9fb947dc45b")
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 numpy as np
import tempfile
import os

# Create a temporary directory for mock data files
temp_dir = tempfile.mkdtemp()
data_processed_dir = temp_dir + '/'

# Create small mock numpy arrays and save them
np.save(data_processed_dir + 'protein_train.npy', np.random.rand(2, 4))
np.save(data_processed_dir + 'compound_train_ver.npy', np.random.rand(2, 4))
np.save(data_processed_dir + 'compound_train_adj.npy', np.random.rand(2, 4, 4))
np.save(data_processed_dir + 'prot_train_contacts.npy', np.random.rand(2, 4))
np.save(data_processed_dir + 'prot_train_contacts_true.npy', np.random.rand(2, 4))
np.save(data_processed_dir + 'prot_train_inter.npy', np.random.rand(2, 4))
np.save(data_processed_dir + 'prot_train_inter_exist.npy', np.random.rand(2, 4))
np.save(data_processed_dir + 'IC50_train.npy', np.random.rand(2, 4))

ARGS = {
    'data_processed_dir': data_processed_dir
}
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 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_val_data Ran
ran; our contract draft was wrong, not the code
lirongwu/psc-cpi/code/dataset.py
code served (permissive licence) · get_code("df364977b3dd312f")
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 numpy as np
import tempfile
import os

# Create a temporary directory to store the .npy files
temp_dir = tempfile.mkdtemp()
data_processed_dir = temp_dir + '/'

# Create small dummy numpy arrays and save them
np.save(os.path.join(temp_dir, 'protein_dev.npy'), np.random.rand(2, 4))
np.save(os.path.join(temp_dir, 'compound_dev_ver.npy'), np.random.rand(2, 3))
np.save(os.path.join(temp_dir, 'compound_dev_adj.npy'), np.random.rand(2, 5, 5))
np.save(os.path.join(temp_dir, 'prot_dev_contacts.npy'), np.random.rand(2, 6))
np.save(os.path.join(temp_dir, 'prot_dev_contacts_true.npy'), np.random.rand(2, 6))
np.save(os.path.join(temp_dir, 'prot_dev_inter.npy'), np.random.rand(2, 7))
np.save(os.path.join(temp_dir, 'prot_dev_inter_exist.npy'), np.random.rand(2, 7))
np.save(os.path.join(temp_dir, 'IC50_dev.npy'), np.random.rand(2, 1))

ARGS = {
    'data_processed_dir': data_processed_dir
}
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 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
net_comp_gcn Ran
ran on a synthesized input · constructed an object; no result was computed
LirongWu/PSC-CPI/code/model.py
code served (permissive licence) · get_code("a20bfac5c8f895fa")
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 an instance of its own class, net_comp_gcn: the run constructed the object and did not call it, so no result was computed. 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)

class net_comp_gcn(nn.Module):

    def __init__(self, param):
        super().__init__()
        self.linear = nn.ModuleList([nn.Linear(43, param['hidden_dim']), nn.Linear(param['hidden_dim'], param['hidden_dim']), nn.Linear(param['hidden_dim'], param['hidden_dim'])])
        self.linear_final = nn.Linear(param['hidden_dim'], param['hidden_dim'])
        self.relu = nn.ReLU()

    def forward(self, x, adj):
        for l in range(3):
            x = self.linear[l](x)
            x = torch.einsum('bij,bjd->bid', adj, x)
            x = self.relu(x)
        x = self.linear_final(x)
        return x

param = {
    'hidden_dim': 7
}

model = net_comp_gcn(param)

batch_size = 2
num_nodes = 4
input_dim = 43

x = torch.randn(batch_size, num_nodes, input_dim)
adj = torch.randn(batch_size, num_nodes, num_nodes)

ARGS = {
    'param': param
}
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 net_comp_gcn — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a net_comp_gcn 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
net_prot_gat Ran
ran on a synthesized input · constructed an object; no result was computed
LirongWu/PSC-CPI/code/model.py
code served (permissive licence) · get_code("d013c2038d58b73d")
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 an instance of its own class, net_prot_gat: the run constructed the object and did not call it, so no result was computed. 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)

class net_prot_gat(nn.Module):

    def __init__(self, param):
        super().__init__()
        self.linear0 = nn.ModuleList([nn.Linear(param['hidden_dim'], param['hidden_dim']) for _ in range(7)])
        self.linear1 = nn.ModuleList([nn.Linear(param['hidden_dim'], param['hidden_dim']) for _ in range(7)])
        self.w_attn = nn.ModuleList([nn.Linear(param['hidden_dim'], param['hidden_dim']) for _ in range(7)])
        self.linear_final = nn.Linear(param['hidden_dim'], param['hidden_dim'])
        self.relu = nn.ReLU()
        self.sigmoid = nn.Sigmoid()

    def forward(self, x, adj):
        adj[:, list(range(1000)), list(range(1000))] = 1
        for l in range(7):
            x0 = x
            adj_attn = self.sigmoid(torch.einsum('bij,bkj->bik', self.w_attn[l](x), x))
            adj_attn = adj_attn + 1e-05 * torch.eye(1000).to(x.device)
            adj_attn = torch.einsum('bij,bij->bij', adj_attn, adj)
            adj_attn_sum = torch.einsum('bij->bi', adj_attn)
            adj_attn = torch.einsum('bij,bi->bij', adj_attn, 1 / adj_attn_sum)
            x = torch.einsum('bij,bjd->bid', adj_attn, x)
            x = self.relu(self.linear0[l](x))
            x = self.relu(self.linear1[l](x))
            x += x0
        x = self.linear_final(x)
        return x

# Construct arguments for forward pass
param = {
    'hidden_dim': 4
}

# Create model instance
model = net_prot_gat(param)

# Create input tensors
# x: (batch_size=2, num_nodes=1000, hidden_dim=4)
x = torch.randn(2, 1000, 4)

# adj: (batch_size=2, num_nodes=1000, num_nodes=1000)
adj = torch.randn(2, 1000, 1000)

ARGS = {
    'param': param
}
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 net_prot_gat — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a net_prot_gat 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
net_prot_gcn Ran
ran on a synthesized input · constructed an object; no result was computed
LirongWu/PSC-CPI/code/model.py
code served (permissive licence) · get_code("a9f813a5b779bf7b")
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 an instance of its own class, net_prot_gcn: the run constructed the object and did not call it, so no result was computed. 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)

class net_prot_gcn(nn.Module):

    def __init__(self, param):
        super().__init__()
        self.linear = nn.ModuleList([nn.Linear(param['hidden_dim'], param['hidden_dim']) for _ in range(7)])
        self.linear_final = nn.Linear(param['hidden_dim'], param['hidden_dim'])
        self.relu = nn.ReLU()

    def forward(self, x, adj):
        adj[:, list(range(1000)), list(range(1000))] = 1
        degrees = adj.sum(dim=2)
        degree_mat_inv_sqrt = torch.diag_embed(torch.pow(degrees, -0.5))
        adj_norm = torch.einsum('bij,bjk->bik', torch.einsum('bij,bjk->bik', degree_mat_inv_sqrt, adj), degree_mat_inv_sqrt)
        for l in range(7):
            x0 = x
            x = torch.einsum('bij,bjd->bid', adj_norm, x)
            x = self.relu(self.linear[l](x))
            x += x0
        x = self.linear_final(x)
        return x

param = {
    'hidden_dim': 4
}

model = net_prot_gcn(param)

x = torch.randn(2, 1000, 4)
adj = torch.randn(2, 1000, 1000)

ARGS = {
    'param': param
}
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 net_prot_gcn — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a net_prot_gcn 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
net_prot_sage Ran
ran on a synthesized input
LirongWu/PSC-CPI/code/model.py
code served (permissive licence) · get_code("38f5c9dd907c04bc")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, 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
import torch.nn as nn

class net_prot_sage(nn.Module):

    def __init__(self, param):
        super().__init__()
        self.linear = nn.ModuleList([nn.Linear(param['hidden_dim'] * 2, param['hidden_dim']) for _ in range(7)])
        self.linear_final = nn.Linear(param['hidden_dim'], param['hidden_dim'])
        self.relu = nn.ReLU()

    def forward(self, x, adj):
        adj[:, list(range(1000)), list(range(1000))] = 1
        degrees = adj.sum(dim=2)
        degree_mat_inv_sqrt = torch.diag_embed(torch.pow(degrees, -0.5))
        adj_norm = torch.einsum('bij,bjk->bik', torch.einsum('bij,bjk->bik', degree_mat_inv_sqrt, adj), degree_mat_inv_sqrt)
        for l in range(7):
            x0 = x
            neigh_x = torch.einsum('bij,bjd->bid', adj_norm, x)
            x = torch.cat([neigh_x, x], dim=-1)
            x = self.relu(self.linear[l](x))
            x += x0
        x = self.linear_final(x)
        return x


INIT_ARGS = {
    'param': {
        'hidden_dim': 8
    }
}

ARGS = {
    'x': torch.randn(2, 1000, 8),
    'adj': torch.randn(2, 1000, 1000)
}

if __name__ == '__main__':
    model = net_prot_sage(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Expected shape: (2, 1000, 8)")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
ProteinEmbed_Model Not yet run
unverified (harvested, no recorded run)
LirongWu/PSC-CPI/code/model.py
code served (permissive licence) · get_code("dea0d167bbce280d")
How it ran

no invocation recorded.

cal_affinity_torch Not yet run
unverified (harvested, no recorded run)
lirongwu/psc-cpi/code/utils.py
code served (permissive licence) · get_code("772e096dc3151918")
How it ran

no invocation recorded.

cal_interaction_torch Not yet run
unverified (harvested, no recorded run)
lirongwu/psc-cpi/code/utils.py
code served (permissive licence) · get_code("cc2cef35a651c681")
How it ran

no invocation recorded.

crossInteraction Not yet run
unverified (harvested, no recorded run)
LirongWu/PSC-CPI/code/model.py
code served (permissive licence) · get_code("129b91ead96554d8")
How it ran

no invocation recorded.

get_root_logger Not yet run
unverified (harvested, no recorded run)
lirongwu/psc-cpi/code/utils.py
code served (permissive licence) · get_code("4208189d0b4f5a46")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 12 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.

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

Compound-Protein Interaction (CPI) prediction aims to predict the pattern and strength of compound-protein interactions for rational drug discovery. Existing deep learningbased methods utilize only the single modality of protein sequences or structures and lack the co-modeling of the joint distribution of the two modalities, which may lead to significant performance drops in complex real-world scenarios due to various factors, e.g., modality missing and domain shifting. More importantly, these methods only model protein sequences and structures at a single fixed scale, neglecting more fine-grained multi-scale information, such as those embedded in key protein fragments. In this paper, we propose a novel multi-scale Protein Sequence-structure Contrasting framework for CPI prediction (PSC-CPI), which captures the dependencies between protein sequences and structures through both intra-modality and cross-modality contrasting. We further apply length-variable protein augmentation to allow contrasting to be performed at different scales, from the amino acid level to the sequence level. Finally, in order to more fairly evaluate the model generalizability, we split the test data into four settings based on whether compounds and proteins have been observed during the training stage. Extensive experiments have shown that PSC-CPI generalizes well in all four settings, particularly in the more challenging "Unseen-Both" setting, where neither compounds nor proteins have been observed during training. Furthermore, even when encountering a situation of modality missing, i.e., inference with only single-modality data, PSC-CPI still exhibits comparable or even better performance than previous approaches.

For agents

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

get_harvested_code_for_paper("2402.08198")
get_code_for_paper("2402.08198")
have("2402.08198")

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

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

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

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

Connect an agent — have() is free.