pairctrl / README.md
tstomar's picture
PairCtrl 0.1.0
2ef5bc2
|
Raw History Blame Contribute Delete
10.4 kB
metadata
license:
  - cc-by-4.0
  - cc-by-nc-sa-4.0
pretty_name: PairCtrl
tags:
  - biology
  - genomics
  - bacteria
  - protein-protein interactions
  - operons
  - enhancers
  - benchmark
  - genomic language models
size_categories:
  - 1M<n<10M
configs:
  - config_name: ppi_exp
    data_files:
      - split: items
        path: ppi_exp/items.parquet
  - config_name: operon_expr
    data_files:
      - split: items
        path: operon_expr/items.parquet
  - config_name: operon_regulondb_exp
    data_files:
      - split: items
        path: operon_regulondb_exp/items.parquet
  - config_name: etgp_nodist
    data_files:
      - split: items
        path: etgp_nodist/items.parquet

PairCtrl

PairCtrl is a benchmark for genomic language models on gene pairs. On many gene-pair tasks, gene position alone (adjacency, strand, intergenic distance) or a close relative in the training data predicts the label. In PairCtrl the labels come from experiments rather than from genome layout. Every model is compared with row zero, a position-only baseline (see "Baselines and metrics"), and the scores are also reported with gene position held fixed. This dataset holds the data, the per-item scores of the leaderboard models and the leaderboard tables. The evaluation code is the pairctrl package (https://github.com/tejasvi/pairctrl).

Tasks

task what is predicted items labels from primary metric
ppi_exp interaction between the proteins of two genes 1,783,791 pairs; 14 data sets from 4 genomes two-hybrid, affinity-purification and cross-linking screens, curated complexes, small-scale studies AUROC on the strict subset
operon_expr two neighbouring genes on one transcript 12,636 adjacent pairs in 3 genomes, 6,268 of them labelled full-length transcript reads (nanopore direct RNA, Cappable-seq) gain of row zero when the model's score is added
operon_regulondb_exp the same, on DGEB's E. coli pairs 4,314 pairs RegulonDB transcription units with experimental evidence, rebuilt locally gain of row zero when the model's score is added
etgp_nodist whether a regulatory element controls a gene 5,534 element-gene pairs in 3 data sets CRISPR interference screens, as collected by DNALongBench AUROC with loci held out

In ppi_exp every data set appears twice, once with degree-preserving negatives and once with negatives drawn from the screened space. The 41,070 positive pairs include 25,007 in the strict subset. In a strict pair, the two genes are more than 20 genes apart and do not share an operon, neither encodes a ribosomal protein, and no neighbourhood, fusion or co-occurrence evidence links them in other genomes. In operon_expr a pair counts as a negative only when both genes are expressed. In etgp_nodist, input length does not depend on the distance between element and gene, and whole loci are held out.

Evaluation

  1. Install the evaluation package with pip install pairctrl and download this dataset into a directory:

    python -c "from huggingface_hub import snapshot_download; snapshot_download('tstomar/pairctrl', repo_type='dataset', local_dir='DATA_DIR')"
    

    Then check the download with sha256sum -c SHA256SUMS inside that directory.

  2. Before evaluating operon_regulondb_exp, rebuild its labels, and before running a model on etgp_nodist, build its inputs (see "Labels and inputs rebuilt locally" below).

  3. For a zero-shot score on ppi_exp or an operon task, embed the genes listed in genomes/genes.parquet and take the cosine similarity of the embeddings of the two genes of each item:

    python -m pairctrl.zeroshot DATA_DIR/ppi_exp/items.parquet embeddings.npz submission.parquet
    

    Here embeddings.npz holds one array per genome record, keyed by accession, with one row per gene in gene_index order.

  4. For a supervised score, predict each item out of fold under the task's frozen folds, which are in its items.parquet: clade folds for ppi_exp and one genome held out per fold for operon_expr. operon_regulondb_exp takes zero-shot scores only, and etgp_nodist holds out loci.

  5. Write the scores to a parquet or CSV file with one score per item and the columns item_id and score; this file is the submission. Then run

    python -m pairctrl.evaluate --task ppi_exp --data DATA_DIR --submission submission.parquet --out metrics.json
    

    and add --oof for out-of-fold predictions, which are then compared only within folds. Items without a score are left out, and the command reports the coverage; a leaderboard entry needs a score for every item.

Baselines and metrics

Row zero is the position model: a logistic regression on spline bases of the position features that is fitted out of fold on the task's frozen folds. The distance rule is an untrained baseline. For gene pairs it scores 1[same strand] x exp(-gap / 500 bp), with a score of 0 above a gap of 500 bp and ties broken in favour of pairs fewer genes apart, and for element-gene pairs it is the negative distance. A view is a label column with a row filter, and the strict subset of ppi_exp is one such view; pairctrl/specs.py in the code repository defines the views of each task.

The output of pairctrl.evaluate lists the submission next to row zero and the distance rule, for each view and evaluation unit (data set, genome or screen class), with 95% bootstrap intervals. It reports:

  • AUROC;
  • AUROC with positives compared only with negatives at the same gene position;
  • AUPRC;
  • the gain of row zero when the score is added;
  • lower and upper bounds on the share of the score's AUROC above 0.5 that is due to gene position.

The bootstrap behind the 95% intervals resamples blocks of neighbouring genes within genomes for the bacterial tasks and loci for etgp_nodist. pairctrl/metrics.py in the code repository defines every reported quantity.

On the leaderboard, the two baselines reach these AUROCs:

task view row zero distance rule
ppi_exp strict subset, degree-preserving negatives 0.519 0.512
operon_expr all labelled pairs of the three genomes 0.990 0.987
operon_regulondb_exp positives in one experimentally supported unit, negatives in none 0.936 0.924
etgp_nodist each of the three data sets 0.805 to 0.830 0.786 to 0.839

Each value pools all items of its view. On the operon tasks, position alone is close to perfect, so their primary metric asks what a model's score adds to row zero. leaderboard/<task>.csv gives each value with its 95% interval and per evaluation unit, and the page leaderboard/index.html lists the models.

Labels and inputs rebuilt locally

  • operon_regulondb_exp: RegulonDB data may not be integrated into other databases without permission, so the labels are not included. Run python -m pairctrl.joins.regulondb TUSet.txt GeneProductSet.txt items.parquet labels_regulondb.parquet on your own RegulonDB v14.5 download and place the output next to items.parquet.
  • etgp_nodist: python -m pairctrl.joins.etgp_inputs hg19.fa items.parquet inputs.parquet builds the model inputs from your copy of the hg19 reference genome. Only coordinates are included here.

Leaderboard submissions

Open an issue in the code repository (https://github.com/tejasvi/pairctrl) with a link to per-item scores for every item of a task and a short model card. The card gives the model and the layer or readout, says whether the scores are zero-shot or supervised, and describes how the training data relate to the test genomes. The maintainer evaluates the scores with the pairctrl package and adds the model to the leaderboard tables. Numbers without per-item scores are not added.

Files

  • <task>/items.parquet: one row per item, with item_id, the label where it may be redistributed, position features, frozen folds or split columns, and the resampling units of the confidence intervals.
  • <task>/scores.parquet: per-item scores of the baselines and of the leaderboard models. Zero-shot scores are cosine similarities of the two genes' embeddings. Supervised scores are out-of-fold predictions.
  • scores_nc/<task>/scores_noncommercial.parquet: the per-item scores of six models whose weights have non-commercial licences, with their attribution in scores_nc/README.md.
  • ppi_exp/relatedness.tsv and operon_expr/relatedness.tsv: MinHash similarity of each test genome to its nearest training genome, per split.
  • genomes/genes.parquet and genomes/contigs.parquet: the 18,998 genes and the DNA of the 6 genome records that the tasks use. A task's columns accession, gene_a and gene_b point to accession and gene_index here, so the genes can be embedded with any model.
  • leaderboard/: the tables as CSV and JSON, and a static page, index.html.
  • DATASHEET.md: answers to the "Datasheets for Datasets" questions, with the maintenance plan.
  • NOTICE.md, LICENSE, LICENSES/, SHA256SUMS.

Not included

  • Three ppi_exp data sets from a structure-prediction screen (CC BY-NC-ND 4.0).
  • Two positive controls built on STRING's database channel, which imports third-party content that keeps its providers' terms.
  • DGEB's own operon labels.

Licence and attribution

The data are released under CC BY 4.0, except where NOTICE.md names a different upstream licence. NOTICE.md lists every source with its licence and citation and reproduces the BioGRID notice. The tables taken from BacBench keep its Apache 2.0 licence, whose text is in LICENSES/. The scores in scores_nc/ follow the non-commercial licences of the models that produced them and are released under CC BY-NC-SA 4.0.

Limitations

  • The zero-shot tasks use reference genomes that most models probably saw during pretraining. They test what a representation encodes, not generalisation to new genomes.
  • An unreported pair in an interaction screen was not necessarily tested. Degree-preserving negatives control for hub proteins but not for every detection bias.
  • The operon labels depend on the growth conditions under which the transcripts were sequenced.
  • In etgp_nodist, the benchmark set has only 7 loci, so the Gasperini data set, with 184 loci, carries most of the information.

Citation

Cite the release with the code repository's CITATION.cff or the archive at https://doi.org/10.5281/zenodo.23717097.