SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · aaai_20388 · AAAI · 2022

RepBin: Constraint-Based Graph Representation Learning for Metagenomic Binning

Yu Lin, Hansheng Xue, Vaibhav Rajan, Yujia Zhang, Vijini Mallawaarachchi

Open in the Atlas

Code that ran

8 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 7 have no contract verdict; 1 failure of our instrument; 3 no recorded run), measured 2026-11-22; 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/aaai_20388.json · badge: /api/ran/aaai_20388.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
xuehansheng/RepBin canonical (classifier label)
classifier basis: census
8 ran · 3 no recorded run
FunctionStatusWhere it lives
Graph_Diffusion_Convolution Ran
ran on a synthesized input
xuehansheng/RepBin/models.py
code served (permissive licence) · get_code("5bf86d19328d85c0")
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 csr_matrix. 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 scipy.sparse as sp

# Create a small sparse adjacency matrix (4x4)
# This represents a graph with 4 nodes
np.random.seed(0)
n_nodes = 4
# Create a sparse matrix with some random entries
data = np.array([0.5, 0.3, 0.7, 0.2, 0.6])
row = np.array([0, 1, 2, 1, 3])
col = np.array([1, 2, 3, 0, 2])
A = sp.csr_matrix((data, (row, col)), shape=(n_nodes, n_nodes))

# Make it symmetric for a more realistic graph
A = A + A.T

alpha = 0.15  # Diffusion parameter (typically in range [0, 1])
eps = 1e-5    # Threshold for sparsification

ARGS = {
    "A": A,
    "alpha": alpha,
    "eps": eps
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type csr_matrix — a csr_matrix output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a csr_matrix 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
getARI Ran
ran on a synthesized input
xuehansheng/RepBin/evaluation.py
code served (permissive licence) · get_code("48eba81104b80097")
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 float64, ndim 0, 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 scipy.special
import numpy as np

# Analyze the function:
# - mat: 2D indexable structure, accessed as mat[i][j]
# - k: number of rows in mat
# - s: number of columns in mat
# - N: total count for normalization
# The function computes Adjusted Rand Index from a confusion matrix

# Create a small confusion matrix
mat = [
    [10, 5, 2],
    [3, 15, 1],
    [1, 2, 8]
]

k = 3  # number of rows
s = 3  # number of columns
N = sum(sum(row) for row in mat)  # total elements = 10+5+2+3+15+1+1+2+8 = 47

ARGS = {
    "mat": mat,
    "k": k,
    "s": s,
    "N": N
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
getPrecision Ran
ran on a synthesized input
xuehansheng/RepBin/evaluation.py
code served (permissive licence) · get_code("fa532a2b6fab225e")
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 float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 numpy as np

torch.manual_seed(0)

# Analyze the function:
# - mat: 2D indexable structure, accessed as mat[i][j]
# - k: number of rows to iterate over
# - s: number of columns to iterate over
# - total: divisor for final result
# The function finds the max value in each of k rows, sums them, divides by total

# Create a small 2D matrix (k=3 rows, s=4 columns)
mat = [
    [0.5, 0.2, 0.8, 0.1],
    [0.3, 0.9, 0.4, 0.6],
    [0.7, 0.1, 0.5, 0.2]
]

k = 3  # number of rows
s = 4  # number of columns
total = 10  # divisor

ARGS = {
    "mat": mat,
    "k": k,
    "s": s,
    "total": total
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
getRecall Ran
ran on a synthesized input
xuehansheng/RepBin/evaluation.py
code served (permissive licence) · get_code("d6f0aafbb5b01c91")
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 float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 numpy as np

torch.manual_seed(0)

# Analyze the function:
# - mat: 2D indexable structure, mat[j][i] accesses elements
# - k: number of rows in mat (loop range(k))
# - s: number of columns in mat (loop range(s))
# - total: integer for division
# - unclassified: integer for division

# Create a small 2D matrix with distinct dimensions
mat = [
    [0.5, 0.3, 0.8, 0.2],
    [0.9, 0.7, 0.4, 0.6],
    [0.2, 0.5, 0.3, 0.9]
]

k = 3  # number of rows
s = 4  # number of columns
total = 100
unclassified = 10

ARGS = {
    "mat": mat,
    "k": k,
    "s": s,
    "total": total,
    "unclassified": unclassified
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
load_contigs Ran
ran on a synthesized input
xuehansheng/RepBin/loader.py
code served (permissive licence) · get_code("053fc3d7f99df510")
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 tempfile
import os

# Create a temporary file with valid contig data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
temp_file.write(">NODE_1_length_100_cov_5.5\n")
temp_file.write("seg1,seg2,seg3\n")
temp_file.write(">NODE_2_length_150_cov_6.2\n")
temp_file.write("seg4,seg5\n")
temp_file.write(">NODE_3_length_200_cov_7.1\n")
temp_file.write("seg6,seg7,seg8,seg9\n")
temp_file.close()

contig_paths = temp_file.name

ARGS = {
    'contig_paths': contig_paths
}
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 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
preprocess_graph Ran
ran on a synthesized input
xuehansheng/RepBin/utils.py
code served (permissive licence) · get_code("43e37d9c03b582a1")
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 coo_matrix. 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 scipy.sparse as sp

# Create a small adjacency matrix for testing
# Using a 4x4 sparse matrix to keep it small but realistic
# Create a simple graph with a few edges
row = np.array([0, 1, 2, 3, 0, 1])
col = np.array([1, 2, 3, 0, 2, 3])
data = np.array([1, 1, 1, 1, 1, 1])
adj = sp.coo_matrix((data, (row, col)), shape=(4, 4))

ARGS = {
    "adj": adj
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type coo_matrix — a coo_matrix output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a coo_matrix 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
remove_duplicates Ran
ran on a synthesized input
xuehansheng/RepBin/loader.py
code served (permissive licence) · get_code("857a6989a9141e71")
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. 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)

# The function takes a list of constraints where each constraint is a list
# that gets sorted and then deduplicated
# Building test data: list of lists with some duplicates

constraints = [
    [3, 1, 2],
    [1, 2, 3],  # duplicate of above after sorting
    [5, 4],
    [4, 5],     # duplicate of above after sorting
    [7, 6, 8],
]

ARGS = {
    "constraints": constraints
}
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 list — a list 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
sparse_to_tuple Ran
ran; our contract draft was wrong, not the code
xuehansheng/RepBin/utils.py
code served (permissive licence) · get_code("eaa82e9c7a22e930")
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 scipy.sparse as sp

# Create a small sparse matrix
row = np.array([0, 1, 2, 3])
col = np.array([1, 2, 0, 3])
data = np.array([1.0, 2.0, 3.0, 4.0])
sparse_matrix = sp.coo_matrix((data, (row, col)), shape=(4, 4))

# Test with single sparse matrix
ARGS = {
    "sparse_mx": sparse_matrix
}

# Also test with a list of sparse matrices to verify the list branch
sparse_matrix_2 = sp.csr_matrix(([5.0, 6.0], ([0, 1], [1, 2])), shape=(3, 4))
sparse_matrix_3 = sp.lil_matrix((2, 5))
sparse_matrix_3[0, 1] = 7.0
sparse_matrix_3[1, 3] = 8.0

ARGS_list = {
    "sparse_mx": [sparse_matrix, sparse_matrix_2, sparse_matrix_3]
}

# Use the single matrix version as default
ARGS = {
    "sparse_mx": sparse_matrix
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — 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_contigs_fasta_markers Not yet run
unverified (harvested, no recorded run)
xuehansheng/RepBin/loader.py
code served (permissive licence) · get_code("fea3e4f03233b7ba")
How it ran

no invocation recorded.

reLabel Not yet run
unverified (harvested, no recorded run)
xuehansheng/RepBin/visualize.py
code served (permissive licence) · get_code("7d39744d65465a68")
How it ran

no invocation recorded.

remove_self_loops Not yet run
unverified (harvested, no recorded run)
xuehansheng/RepBin/utils.py
code served (permissive licence) · get_code("e63b90a141267137")
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, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 10 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
sparse_to_tuple 7 other papers
1 dated earlier, 4 later, 2 same year, order not determinable
1903.04154 (2019-03)
Fisher-Bures Adversary Graph Convolutional Networks
ijcai2022_0310 (2022 (year only))
Beyond Homophily: Structure-aware Path Aggregation Graph Neural Network
2203.03315 (2022-03)
Deep Reinforcement Learning for Entity Alignment
and 4 more not named here

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

Mixed communities of organisms are found in many environments -from the human gut to marine ecosystems -and can have profound impact on human health and the environment. Metagenomics studies the genomic material of such communities through high-throughput sequencing that yields DNA subsequences for subsequent analysis. A fundamental problem in the standard workflow, called binning, is to discover clusters, of genomic subsequences, associated with the unknown constituent organisms. Inherent noise in the subsequences, various biological constraints that need to be imposed on them and the skewed cluster size distribution exacerbate the difficulty of this unsupervised learning problem. In this paper, we present a new formulation using a graph where the nodes are subsequences and edges represent homophily information. In addition, we model biological constraints providing heterophilous signal about nodes that cannot be clustered together. We solve the binning problem by developing new algorithms for (i) graph representation learning that preserves both homophily relations and heterophily constraints (ii) constraint-based graph clustering method that addresses the problems of skewed cluster size distribution. Extensive experiments, on real and synthetic datasets, demonstrate that our approach, called RepBin, outperforms a wide variety of competing methods. Our constraint-based graph representation learning and clustering methods, that may be useful in other domains as well, advance the state-of-the-art in both metagenomics binning and graph representation learning.

For agents

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

get_harvested_code_for_paper("aaai_20388")
get_code_for_paper("aaai_20388")
have("aaai_20388")

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

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

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

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

Connect an agent — have() is free.