callingcards / README.md
cmatkhan's picture
adding metadata to 2025_analysis_set
849a2cf
metadata
license: mit
language:
  - en
tags:
  - biology
  - genomics
  - yeast
  - transcription-factors
  - callingcards
  - transposon
  - binding
  - gene-expression
pretty_name: Calling Cards Transcription Factor Binding Dataset
experimental_conditions:
  temperature_celsius: room
  media:
    name: synthetic_complete_minus_ura_his_leu
    carbon_source:
      - compound: D-galactose
        concentration_percent: 2
    nitrogen_source:
      - compound: amino_acid_dropout_mix
        concentration_percent: unspecified
        specifications:
          - minus_ura
          - minus_his
          - minus_leu
configs:
  - config_name: annotated_features
    description: >-
      Calling Cards transcription factor binding data with enrichment scores and
      statistical significance
    dataset_type: annotated_features
    default: true
    data_files:
      - split: train
        path: annotated_features/*/*.parquet
    dataset_info:
      features:
        - name: id
          dtype: string
          description: Unique identifier for each binding measurement
        - name: regulator_locus_tag
          dtype: string
          description: Systematic gene name (ORF identifier) of the transcription factor
        - name: regulator_symbol
          dtype: string
          description: Standard gene symbol of the transcription factor
        - name: target_locus_tag
          dtype: string
          description: Systematic gene name (ORF identifier) of the target gene
        - name: target_symbol
          dtype: string
          description: Standard gene symbol of the target gene
        - name: experiment_hops
          dtype: float64
          description: >-
            Number of transposon insertion events (hops) at target locus in
            experimental sample
        - name: background_hops
          dtype: float64
          description: >-
            Number of transposon insertion events (hops) at target locus in
            background control
        - name: background_total_hops
          dtype: float64
          description: >-
            Total number of background hops across all loci in the control
            sample
        - name: experiment_total_hops
          dtype: float64
          description: >-
            Total number of experimental hops across all loci in the
            experimental sample
        - name: callingcards_enrichment
          dtype: float64
          description: >-
            Enrichment score calculated as ratio of normalized experimental to
            background hops
        - name: poisson_pval
          dtype: float64
          description: >-
            P-value from Poisson test for statistical significance of binding
            enrichment
        - name: hypergeometric_pval
          dtype: float64
          description: >-
            P-value from hypergeometric test for statistical significance of
            binding enrichment
        - name: batch
          dtype: string
          description: Experimental batch identifier for controlling batch effects
  - config_name: annotated_features_meta
    description: >-
      Metadata for annotated features datasets including regulator informatioand
      data quality indicators
    dataset_type: metadata
    applies_to:
      - annotated_features
    data_files:
      - split: train
        path: annotated_features_meta.parquet
    dataset_info:
      features:
        - name: db_id
          dtype: string
          description: Database identifier for the dataset
          role: experimental_condition
        - name: regulator_locus_tag
          dtype: string
          description: Systematic identifier for the regulatory factor
          role: regulator_identifier
        - name: regulator_symbol
          dtype: string
          description: Standard symbol for the regulatory factor
          role: regulator_identifier
        - name: data_usable
          dtype: string
          description: Indicator of whether the data is suitable for analysis
          role: experimental_condition
        - name: preferred_replicate
          dtype: string
          description: Boolean indicator for preferred biological replicate
          role: experimental_condition
        - name: batch
          dtype: string
          description: Experimental batch identifier
          role: experimental_condition
        - name: single_binding
          dtype: int64
          description: Count or score for single binding events
          role: quantitative_measure
        - name: composite_binding
          dtype: int64
          description: Count or score for composite binding events
          role: quantitative_measure
        - name: analysis_set
          dtype: bool
          description: >-
            TRUE if this record is to be used for analysis. FALSE otherwise.
            This was determined in 2025. Replicates needed `>=`3k hops and DTO
            `<=` 0.01 in either kemmeren or hackett
        - name: id
          dtype: string
          description: Unique identifier for the metadata record
  - config_name: annotated_features_combined
    description: >-
      Calling Cards replicate data combined at the qbed (genome map) level, with
      enrichment and significance called via callingCardsTools. Partitioned by
      genome_map_id_set, where each partition corresponds to a set of combined
      replicate genome maps for a single regulator.
    dataset_type: annotated_features
    data_files:
      - split: train
        path: annotated_features_combined/*/*.parquet
    dataset_info:
      partitioning:
        enabled: true
        partition_by:
          - genome_map_id_set
        path_template: >-
          annotated_features_combined/genome_map_id_set={genome_map_id_set}/*.parquet
      features:
        - name: genome_map_id_set
          dtype: string
          description: >-
            Hyphen-delimited set of genome map IDs corresponding to the combined
            replicates for this regulator (partition key)
        - name: target_locus_tag
          dtype: string
          description: Systematic gene identifier for the target gene
          role: target_identifier
        - name: target_symbol
          dtype: string
          description: Standard gene symbol for the target gene
          role: target_identifier
        - name: experiment_hops
          dtype: float64
          description: >-
            Number of transposon insertion events (hops) at target locus in the
            experimental sample
          role: quantitative_measure
        - name: background_hops
          dtype: float64
          description: >-
            Number of transposon insertion events (hops) at target locus in the
            background control
          role: quantitative_measure
        - name: background_total_hops
          dtype: float64
          description: >-
            Total number of background hops across all loci in the control
            sample
          role: quantitative_measure
        - name: experiment_total_hops
          dtype: float64
          description: >-
            Total number of experimental hops across all loci in the
            experimental sample
          role: quantitative_measure
        - name: callingcards_enrichment
          dtype: float64
          description: >-
            Enrichment score calculated as ratio of normalized experimental to
            background hops
          role: quantitative_measure
        - name: poisson_pval
          dtype: float64
          description: >-
            P-value from Poisson test for statistical significance of binding
            enrichment
          role: quantitative_measure
        - name: hypergeometric_pval
          dtype: float64
          description: >-
            P-value from hypergeometric test for statistical significance of
            binding enrichment
          role: quantitative_measure
  - config_name: annotated_features_combined_meta
    description: >-
      Sample-level metadata for combined Calling Cards experiments including
      regulator information, QC flags, and experimental conditions
    dataset_type: metadata
    applies_to:
      - annotated_features_combined
    data_files:
      - split: train
        path: annotated_features_combined_meta.parquet
    dataset_info:
      features:
        - name: genome_map_id_set
          dtype: string
          description: >-
            Hyphen-delimited set of genome map IDs used as the partition key in
            annotated_features_combined
        - name: pss_id
          dtype: string
          description: >-
            Passing sample set identifier grouping replicates used in this
            combined analysis
        - name: binding_id
          dtype: string
          description: Unique identifier for this combined binding measurement record
        - name: regulator_locus_tag
          dtype: string
          description: Systematic gene identifier for the transcription factor
          role: regulator_identifier
        - name: regulator_symbol
          dtype: string
          description: Standard gene symbol for the transcription factor
          role: regulator_identifier
        - name: batch
          dtype: string
          description: Experimental batch identifier for controlling batch effects
        - name: analysis_set
          dtype: bool
          description: >-
            For a TF with more than 1 passing replicate, a combined samples is
            created. This is based on the QC done in 2025 for the modeling
            paper. See the annotated_features_meta for more details
        - name: condition
          dtype: string
          description: Experimental condition for this sample
          role: experimental_condition
  - config_name: 2026_analysis_set
    description: >-
      This is a combination of the combined annotated_features_combined dataset,
      and the passing single replicates from the annotated_features dataset.
      This is the data that is used for the 2026 modeling paper as predictors
    dataset_type: annotated_features
    metadata_fields:
      - gm_id
      - regulator_locus_tag
      - regulator_symbol
      - experiment_total_hops
      - background_total_hops
    data_files:
      - split: train
        path: 2026_analysis_set.parquet
    dataset_info:
      features:
        - name: gm_id
          dtype: string
          description: >-
            genome_map id. If the sample is a combination of multiple samples,
            then it is a hyphen-delimited set of genome map IDs corresponding to
            the combined replicates for this regulator.
        - name: target_locus_tag
          dtype: string
          description: Systematic gene identifier for the target gene
          role: target_identifier
        - name: target_symbol
          dtype: string
          description: Standard gene symbol for the target gene
          role: target_identifier
        - name: experiment_hops
          dtype: float64
          description: >-
            Number of transposon insertion events (hops) at target locus in the
            experimental sample
          role: quantitative_measure
        - name: background_hops
          dtype: float64
          description: >-
            Number of transposon insertion events (hops) at target locus in the
            background control
          role: quantitative_measure
        - name: background_total_hops
          dtype: float64
          description: >-
            Total number of background hops across all loci in the control
            sample
          role: quantitative_measure
        - name: experiment_total_hops
          dtype: float64
          description: >-
            Total number of experimental hops across all loci in the
            experimental sample
          role: quantitative_measure
        - name: callingcards_enrichment
          dtype: float64
          description: >-
            Enrichment score calculated as ratio of normalized experimental to
            background hops
          role: quantitative_measure
        - name: poisson_pval
          dtype: float64
          description: >-
            P-value from Poisson test for statistical significance of binding
            enrichment
          role: quantitative_measure
  - config_name: genome_map
    description: Genome-wide calling cards insertion density data partitioned by batch
    dataset_type: genome_map
    data_files:
      - split: train
        path: genome_map/*/*.parquet
    dataset_info:
      features:
        - name: id
          dtype: string
          description: Unique identifier for each genomic interval
        - name: chr
          dtype: string
          description: Chromosome name (e.g., chrI, chrII, etc.)
        - name: start
          dtype: float64
          description: Start position of genomic interval
        - name: end
          dtype: float64
          description: End position of genomic interval
        - name: depth
          dtype: float64
          description: >-
            Number of transposon insertion events (read depth) in this genomic
            interval
        - name: strand
          dtype: string
          description: Strand information (+ or -) for the genomic interval
        - name: batch
          dtype: string
          description: Experimental batch identifier
      partitioning:
        enabled: true
        partition_by:
          - batch
        path_template: genome_map/batch={batch}/*.parquet
  - config_name: genome_map_meta
    description: >-
      Metadata for genome map datasets including regulator information and
      experimental details
    dataset_type: metadata
    applies_to:
      - genome_map
      - annotated_features_orig_reprocess
    data_files:
      - split: train
        path: genome_map_meta.parquet
    dataset_info:
      features:
        - name: id
          dtype: string
          description: Unique identifier for the metadata record
        - name: binding_id
          dtype: string
          description: >-
            current django managed database identifier for the dataset to the
            'binding' table
        - name: regulator_locus_tag
          dtype: string
          description: Systematic identifier for the regulatory factor
          role: regulator_identifier
        - name: regulator_symbol
          dtype: string
          description: Standard symbol for the regulatory factor
          role: regulator_identifier
        - name: batch
          dtype: string
          description: Experimental batch identifier
          role: experimental_condition
        - name: replicate
          dtype: int64
          description: Biological replicate number, within batch
        - name: notes
          dtype: string
          description: Additional notes or comments about the experiment
        - name: condition
          dtype:
            class_label:
              names:
                - standard
                - rapa
                - starvation
                - glu_1_gal_1
                - del_MET28
                - glu_1_gal_2
                - del_FKH2
                - del_TYE7
          description: >-
            Experimental condition of the sample, including standard growth,
            rapamycin treatment, nutrient starvation, mixed carbon source
            conditions, and gene deletion strains
          role: experimental_condition
          definitions:
            standard:
              media:
                name: synthetic_complete
                carbon_source:
                  - compound: D-glucose
                    concentration_percent: 2
            rapa:
              perturbation_method:
                type: chemical_treatment
                compound: rapamycin
                description: Rapamycin treatment to inhibit TORC1 signaling
            starvation:
              description: >-
                Nutrient starvation condition - specific media composition not
                defined in source
            glu_1_gal_1:
              media:
                carbon_source:
                  - compound: D-glucose
                    concentration_percent: 1
                  - compound: D-galactose
                    concentration_percent: 1
            glu_1_gal_2:
              media:
                carbon_source:
                  - compound: D-glucose
                    concentration_percent: 1
                  - compound: D-galactose
                    concentration_percent: 2
            del_MET28:
              genotype:
                deletions:
                  - gene: MET28
                    description: MET28 deletion strain
            del_FKH2:
              genotype:
                deletions:
                  - gene: FKH2
                    description: FKH2 deletion strain
            del_TYE7:
              genotype:
                deletions:
                  - gene: TYE7
                    description: TYE7 deletion strain
  - config_name: annotated_features_orig_reprocess
    description: >-
      Calling Cards annotated features reprocessed from the original qbed genome
      maps using scripts/quantify_regions.R. Each record corresponds to a single
      genome map (replicate-level), where the id field links to genome_map_meta.
      Includes log-transformed p-values and FDR-adjusted q-values not present in
      the original annotated_features_combined.
    dataset_type: annotated_features
    data_files:
      - split: train
        path: annotated_features_orig_reprocess/*/*.parquet
    dataset_info:
      features:
        - name: id
          dtype: int64
          description: >-
            Genome map identifier linking to the genome_map and genome_map_meta
            dataset
        - name: target_locus_tag
          dtype: string
          description: Systematic gene identifier for the target gene
          role: target_identifier
        - name: target_symbol
          dtype: string
          description: Standard gene symbol for the target gene
          role: target_identifier
        - name: experiment_hops
          dtype: float64
          description: >-
            Number of transposon insertion events (hops) at target locus in the
            experimental sample
          role: quantitative_measure
        - name: background_hops
          dtype: float64
          description: >-
            Number of transposon insertion events (hops) at target locus in the
            background control
          role: quantitative_measure
        - name: total_background_hops
          dtype: float64
          description: >-
            Total number of background hops across all loci in the control
            sample
          role: quantitative_measure
        - name: total_experiment_hops
          dtype: float64
          description: >-
            Total number of experimental hops across all loci in the
            experimental sample genomic (not mito) chromosomes
          role: quantitative_measure
        - name: callingcards_enrichment
          dtype: float64
          description: >-
            Enrichment score calculated as ratio of normalized experimental to
            background hops
          role: quantitative_measure
        - name: poisson_pval
          dtype: float64
          description: >-
            P-value from Poisson test for statistical significance of binding
            enrichment
          role: quantitative_measure
        - name: log_poisson_pval
          dtype: float64
          description: >-
            Log-transformed Poisson p-value. This has greater numeric resolution
            for significant loci
          role: quantitative_measure
        - name: poisson_qval
          dtype: float64
          description: FDR-adjusted q-value from Poisson test (multiple testing correction)
          role: quantitative_measure
        - name: hypergeometric_pval
          dtype: float64
          description: >-
            P-value from hypergeometric test for statistical significance of
            binding enrichment
          role: quantitative_measure
        - name: log_hypergeometric_pval
          dtype: float64
          description: Log-transformed hypergeometric p-value
          role: quantitative_measure
        - name: hypergeometric_qval
          dtype: float64
          description: >-
            FDR-adjusted q-value from hypergeometric test (multiple testing
            correction)
          role: quantitative_measure
        - name: batch
          dtype: string
          description: >-
            Experimental batch identifier for controlling batch effects
            (parition key)

Calling Cards

This is data produced in both the Brent Lab and Mitra Lab at Washington University

This repo provides 2 dataset and associated metadata:

  • annotated_features: This data scores promoter regions associated with the nearest gene
  • genome_map: The binding location data in qbed format

In the annotated features, in order to get the analysis set (you can use duckdb directory instead of tfbpapi -- see the usage section below):

import pandas as pd
from tfbpapi.HfQueryAPI import HfQueryAPI

# Initialize the Hugging Face query API with the calling cards dataset
callingcards_hf = HfQueryAPI(
    repo_id="BrentLab/callingcards", 
    repo_type="dataset"
)

# Set a filter to only include records where data quality passes QC
callingcards_hf.set_filter("annotated_features", data_usable="pass")

# Query all columns from the annotated_features table
# Returns the data as a pandas DataFrame
callingcards_data = callingcards_hf.query(
    "SELECT * FROM annotated_features", 
    "annotated_features"
)

analysis_data = (
    callingcards_data
    .assign(
        # Create a flag: does this regulator have any composite binding?
        has_composite = lambda df: df.groupby('regulator_locus_tag')['composite_binding']
                                      .transform(lambda x: x.notna().any())
    )
    .query(
        # If composite exists for this regulator, require composite to be non-null
        # Otherwise, require single_binding to be non-null
        '(has_composite & composite_binding.notna()) | '
        '(~has_composite & single_binding.notna())'
    )
    .drop(columns=['has_composite'])  # Remove the helper column
)

Usage

The python package tfbpapi provides an interface to this data which eases examining the datasets, field definitions and other operations. You may also download the parquet datasets directly from hugging face by clicking on "Files and Versions", or by using the huggingface_cli and duckdb directly. In both cases, this provides a method of retrieving dataset and field definitions.

tfbpapi

After installing tfbpapi, you can adapt this tutorial in order to explore the contents of this repository.

huggingface_cli/duckdb

You can retrieves and displays the file paths for each configuration of the "BrentLab/callingcards" dataset from Hugging Face Hub.

from huggingface_hub import ModelCard
from pprint import pprint

card = ModelCard.load("BrentLab/callingcards", repo_type="dataset")

# cast to dict
card_dict = card.data.to_dict()

# Get partition information
dataset_paths_dict = {d.get("config_name"): d.get("data_files")[0].get("path") for d in card_dict.get("configs")}

pprint(dataset_paths_dict)

The entire repository is large. It may be preferable to only retrieve specific files or partitions. You can use the metadata files to choose which files to pull.

from huggingface_hub import snapshot_download
import duckdb
import os
# Download only the metadata first
repo_path = snapshot_download(
    repo_id="BrentLab/callingcards",
    repo_type="dataset",
    allow_patterns="annotated_features_meta.parquet"
)

dataset_path = os.path.join(repo_path, "annotated_features_meta.parquet")
conn = duckdb.connect()
meta_res = conn.execute("SELECT * FROM read_parquet(?) LIMIT 10", [dataset_path]).df()
print(meta_res)

We might choose to take a look at the file with id = 1:

# Download only a specific sample's genome coverage data
repo_path = snapshot_download(
    repo_id="BrentLab/callingcards",
    repo_type="dataset",
    allow_patterns="annotated_features/id=1/*.parquet"
)

# Query the specific partition
dataset_path = os.path.join(repo_path, "annotated_features")
result = conn.execute("SELECT * FROM read_parquet(?) LIMIT 10", 
                     [f"{dataset_path}/**/*.parquet"]).df()
print(result)

If you wish to pull the entire repo, due to its size you may need to use an authentication token. If you do not have one, try omitting the token related code below and see if it works. Else, create a token and provide it like so:


repo_id = "BrentLab/callingcards"

hf_token = os.getenv("HF_TOKEN")

# Download entire repo to local directory
repo_path = snapshot_download(
    repo_id=repo_id,
    repo_type="dataset",
    token=hf_token
)

print(f"\n✓ Repository downloaded to: {repo_path}")

# Construct path to the annotated_features_meta parquet file
parquet_path = os.path.join(repo_path, "annotated_features_meta.parquet")
print(f"✓ Parquet file at: {parquet_path}")