SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2312.03865 · NeurIPS · 2023

Learning Genomic Sequence Representations using Graph Neural Networks over De Bruijn Graphs

Gunnar Rätsch, Manuel Burger, Kacper Kapuśniak, Amir Joudaki

arXiv · PDF · Open in the Atlas

Code that ran

9 of 10 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 8 failures of our instrument; 1 no recorded run), measured 2026-11-23; 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/2312.03865.json · badge: /api/ran/2312.03865.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
ratschlab/genomic-gnn canonical (classifier label)
classifier basis: census
9 ran · 1 no recorded run
FunctionStatusWhere it lives
build_deBruijn_graph Ran
ran; our contract draft was wrong, not the code
ratschlab/genomic-gnn/src/utils.py
code served (permissive licence) · get_code("ada8792296b3465d")
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 DiGraph. 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 networkx as nx
import numpy as np
from collections import defaultdict

# Create a small pair_frequency dict
# The function expects pairs of kmers as keys (tuples of two strings)
# and weights as values (numbers)
pair_frequency = {
    ('AAA', 'AAC'): 10,
    ('AAA', 'AAG'): 5,
    ('AAC', 'ACG'): 8,
    ('AAC', 'ACC'): 3,
    ('ACG', 'CGA'): 12,
    ('CGA', 'GAT'): 7,
    ('GAT', 'ATT'): 9,
    ('ATT', 'TTT'): 6,
}

ARGS = {
    'pair_frequency': pair_frequency,
    'normalise': False,
    'remove_N': False,
    'edge_weight_threshold': None,
    'keep_top_k': None,
    'create_all_kmers': True,
    'disable_tqdm': True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx, numpy, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DiGraph — a DiGraph output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DiGraph output the recorded ndim 1 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
count_edge_types Ran
ran, honoured the contract we drafted
ratschlab/genomic-gnn/src/representations/gnn_tasks_miniBatch/utils.py
code served (permissive licence) · get_code("31823930fdfb0734")
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 int, ndim 0, dtype family int, 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
from collections import Counter

def count_edge_types(layers: list):
    """
    Counts the number of occurrences for each edge type in a given list of layers.

    Parameters:
        layers (list): List of layers where each layer is a string. The expected format
                       of each string is 'nodeType_edgeType_nodeType', e.g., 'node_DB_node'.

    Returns:
        int: The maximum count of any edge type, or 2 if the format doesn't match the
             expected pattern. (for MLP and RGCN models)
    """
    if len(layers[0].split('_')) > 1:
        edge_types = [layer.split('_')[1] for layer in layers]
        counts = Counter(edge_types)
        return max(counts.values())
    return 2

torch.manual_seed(0)

ARGS = {
    "layers": [
        "node_DB_node",
        "node_DB_node",
        "node_FOLLOWS_node",
        "node_FOLLOWS_node",
        "node_FOLLOWS_node",
        "node_KNOWS_node"
    ]
}
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 int, ndim 0, dtype family int, 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
interpret_layers_config Ran
ran; our contract draft was wrong, not the code
ratschlab/genomic-gnn/src/representations/gnn_common/gnn_models.py
code served (permissive licence) · get_code("461609f0a0623b19")
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 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)

# The function takes a list of string configurations
# Each string has format: "channels_edge" where both are parseable as strings
# The function splits on '_' and converts channels to int

ARGS = {
    'layers_config': [
        '64_0',
        '128_1',
        '256_2'
    ]
}
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, ndim 1, 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
kf_faiss_to_edge_index_weight Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ratschlab/genomic-gnn/src/representations/gnn_common/gnn_utils.py
code served (permissive licence) · get_code("2c08899864cd705c")
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 faiss

# Set random seed for reproducibility
np.random.seed(0)

# Create a small dataset with distinct dimensions
# Using 8 vectors of dimension 4
n_vectors = 8
n_dims = 4
X = np.random.randn(n_vectors, n_dims).astype(np.float32)

# Normalize for better numerical stability
X = X / (np.linalg.norm(X, axis=1, keepdims=True) + 1e-8)

# Define arguments for kf_faiss_to_edge_index_weight
ARGS = {
    'X': X,
    'k': 3,
    'index_type': 'IVFFlat',
    'distance': 'L2',
    'nlist': 2,
    'nprobe': 1,
    'm': None,
    'nbits': None,
    'useFloat16': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
faiss, 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
kmer_onehot_fit Ran
ran; our contract draft was wrong, not the code
ratschlab/genomic-gnn/src/representations/kmer_onehot.py
code served (permissive licence) · get_code("ba2b450fcf984a4f")
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
import torch.nn as nn
import numpy as np
import pandas as pd

torch.manual_seed(0)
np.random.seed(0)

# Create minimal dataframes with sequence data
df1 = pd.DataFrame({
    'sequence': ['ACGT', 'AAAA', 'TTTT'],
})

df2 = pd.DataFrame({
    'sequence': ['CGTA', 'GGGG', 'CCCC'],
})

dfs_list = [df1, df2]

k = 2

args = {
    'random_representation': False,
    'representation_k': '2',
    'representation_size': 16,
}

ARGS = {
    'dfs_list': dfs_list,
    'k': k,
    'args': args,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, 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
networkx_to_dataloader Ran
ran; our contract draft was wrong, not the code
ratschlab/genomic-gnn/src/representations/gnn_tasks/utils.py
code served (permissive licence) · get_code("04290dd7558a55b9")
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 networkx as nx
from torch_geometric.data import DataLoader

torch.manual_seed(0)

# Create a small NetworkX graph
graph = nx.Graph()
graph.add_edges_from([(0, 1), (1, 2), (2, 0)])

# Create node labels (features) - 3 nodes with 4 features each
labels = [
    [0.1, 0.2, 0.3, 0.4],
    [0.5, 0.6, 0.7, 0.8],
    [0.9, 1.0, 1.1, 1.2]
]

# Create labels to predict - one label per node
labels_to_predict = [
    [0.0],
    [1.0],
    [0.0]
]

ARGS = {
    "graph": graph,
    "labels": labels,
    "labels_to_predict": labels_to_predict,
    "batch_size": 2,
    "dummy_dataloader": True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx, torch, torch_geometric — 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
seq_to_kmers Ran
ran; our contract draft was wrong, not the code
ratschlab/genomic-gnn/src/utils.py
code served (permissive licence) · get_code("0d7ac6c324afb915")
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 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
import numpy as np

# Set seed for reproducibility
torch.manual_seed(0)

# Construct valid arguments for seq_to_kmers
ARGS = {
    "seq": "ACGTACGTNNACGT",
    "k": 3,
    "stride": 1,
    "inlcudeUNK": True
}
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 list, ndim 1, 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
setup_faiss_index Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ratschlab/genomic-gnn/src/representations/gnn_common/gnn_utils.py
code served (permissive licence) · get_code("a91306cf73d67638")
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 IndexIVFFlat. 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 faiss

np.random.seed(0)

# Create a small dataset of vectors
# Using shape (100, 16) - 100 samples, 16 dimensions
X = np.random.rand(100, 16).astype(np.float32)

ARGS = {
    'X': X,
    'index_type': 'IVFFlat',
    'distance': 'L2',
    'nlist': None,
    'nprobe': None,
    'm': None,
    'nbits': None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
faiss, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type IndexIVFFlat — a IndexIVFFlat output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a IndexIVFFlat 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
weighted_directed_edges Ran
ran; our contract draft was wrong, not the code
ratschlab/genomic-gnn/src/utils.py
code served (permissive licence) · get_code("5a7bdd65bed14ce9")
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
import numpy as np
from collections import defaultdict

# Define small stand-in sequences (DNA sequences)
sequences = [
    "ATCGATCGATCG",
    "GCTAGCTAGCTA",
    "ATATATATATAT",
]

# Define ARGS with all parameters for weighted_directed_edges
ARGS = {
    'sequences': sequences,
    'k': 3,
    'stride': 1,
    'inlcudeUNK': True,
    'disable_tqdm': True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, tqdm — 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
compute_dirichlet_energy Not yet run
unverified (harvested, no recorded run)
ratschlab/genomic-gnn/src/representations/gnn_common/gnn_utils.py
code served (permissive licence) · get_code("fd4c11670c02f2ed")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 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 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.

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-23.

Repositories linked to this paper

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

Abstract

The rapid expansion of genomic sequence data calls for new methods to achieve robust sequence representations. Existing techniques often neglect intricate structural details, emphasizing mainly contextual information. To address this, we developed k-mer embeddings that merge contextual and structural string information by enhancing De Bruijn graphs with structural similarity connections. Subsequently, we crafted a self-supervised method based on Contrastive Learning that employs a heterogeneous Graph Convolutional Network encoder and constructs positive pairs based on node similarities. Our embeddings consistently outperform prior techniques for Edit Distance Approximation and Closest String Retrieval tasks. 1

For agents

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

get_harvested_code_for_paper("2312.03865")
get_code_for_paper("2312.03865")
have("2312.03865")

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

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

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

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

Connect an agent — have() is free.