YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

Supplementary: tokenizer characterization benchmark

Code, data, and results behind Supplementary Figure 2:

  • (a) motif preservation β€” perfect match rate and motif fragmentation
  • (b) Jensen–Shannon distance between functional-region token distributions and a matched random genomic background

Tokenizers compared: DNABERT-2 BPE, Grover BPE, cCRE-guided BPE, motif-guided BPE, DNAMotifTokenizer.

Layout

Shared

  • tokenizers/ β€” all five tokenizers used in both panels
    • DNAbert2_tokenizer.json, Grover_tokenizer.json β€” original DNABERT-2 / Grover tokenizers
    • cCRE_region_BPE_tokenizer.json, motif_region_BPE_tokenizer.json
    • DNAMotifTokenizer/ β€” trie, motif list, vocab (loaded via code/dna_motif_tokenizer.py, seed = 42)
  • code/dna_motif_tokenizer.py β€” wrapper exposing DNAMotifTokenizer through a tokenizers-like interface

Panel a β€” motif preservation

  • data/motifs.txt β€” 904 unique motifs; wildcard (*) motifs are expanded to all A/C/G/T variants (≀5 wildcards), giving 3,737 test sequences of length 5–12
  • code/motif_coverage_eval.py β€” tokenizes each variant (no special tokens) and computes per-tokenizer metrics
  • results/summary_by_tokenizer.csv β€” per-tokenizer metrics plotted in the figure
  • results/motif_variant_results.csv, results/consistency_by_motif.csv β€” per-variant and per-motif detail
  • code/plot_supp_fig2a_motif.py β†’ figures/supp_fig2a_motif.{pdf,png}

Metrics:

  • Perfect match rate β€” % of motif variants encoded as exactly one token
  • Avg. tokens per motif β€” mean number of tokens per motif variant (lower = less fragmentation)

Panel b β€” region vs random-background JS distance

  • data/regions/ β€” promoter (2 kb), enhancer, and exon interval sets (merged BED)
  • data/background/ β€” chrom.sizes (canonical hg38 chromosomes), region_union.bed (union of the three region sets, used as exclusion), random.bed (exon intervals shuffled into the non-region genome with bedtools shuffle -seed 42, so total bp matches exon)
  • data/fastas/ β€” hg38 sequences for promoter, enhancer, exon, and random (bedtools getfasta)
  • code/js_vs_random_heatmap.py β€” builds the background, tokenizes each FASTA, and computes the Jensen–Shannon distance (base 2) between each region's token-frequency distribution and the random background
  • results/js_vs_random_matrix.csv β€” 5 tokenizers Γ— 3 regions matrix plotted in the figure
  • results/js_vs_random.log β€” run log with token counts per region and tokenizer
  • figures/js_vs_random_heatmap.{pdf,png} β€” heatmap from js_vs_random_heatmap.py
  • code/plot_combined_panel_a_b.py β†’ figures/combined_panel_a_b.{pdf,png} β€” combined draft of panels a and b

Reproduce

# Panel a
python code/motif_coverage_eval.py --motif-file data/motifs.txt --output-dir results
python code/plot_supp_fig2a_motif.py

# Panel b (requires bedtools and hg38.fa from UCSC)
python code/js_vs_random_heatmap.py              # full run
python code/js_vs_random_heatmap.py --plot-only  # redraw from results/js_vs_random_matrix.csv

motif_coverage_eval.py, js_vs_random_heatmap.py, and plot_combined_panel_a_b.py are uploaded as run and resolve paths relative to the original project layout (DEFAULT_TOKENIZER_PATHS, ROOT, REGION_BEDS, etc.); point them at tokenizers/ and data/ before running. The hg38 reference genome is not included (public, ~3 GB); the extracted FASTAs in data/fastas/ are what the analysis tokenized.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support