Summary
ccbr_annotate_bed.R and ccbr_annotate_peaks.R do not handle hs1 or hs1_chrR genomes. Any rule that calls these scripts crashes with object 'tdb' not found because neither genome is present in the genome→TxDb dispatch chain.
Discovered during the Biowulf test run for PR #120.
Error
Error in is(TxDb, "GRanges") : object 'tdb' not found
Affected rules: atac_genrich_peakcalling, atac_annotate_fixed_width_consensus_peaks, annotate_roi
Scripts: workflow/scripts/ccbr_annotate_bed.R, workflow/scripts/ccbr_annotate_peaks.R
Root cause
Both scripts dispatch on args$genome to assign tdb (TxDb annotation database) and adb (OrgDb). The current if-chain covers: hg19, hg38, mm9, mm10, mmul10, bosTau9 — but not hs1 or hs1_chrR. When neither matches, tdb is never assigned and downstream usage crashes.
Modern viable solutions (in order of preference)
1. Use a real T2T TxDb — a pre-built one now exists ✅ (preferred)
The BiocT2T package provides a TxDb built from the actual CHM13v2.0 annotation. Install via:
BiocT2T::install_early_t2t_txdb()
library(TxDb.Hsapiens.NCBI.CHM13v2)
This gives correct T2T coordinates rather than an hg38 stand-in.
2. Build the TxDb from the NCBI GFF (officially documented method)
makeTxDbFromUCSC() does not support hs1, so the recommended route is the GFF file provided by NCBI. Download GCF_009914755.1_T2T-CHM13v2.0_genomic.gff.gz from NCBI, then:
library(rtracklayer); library(txdbmaker)
gff <- import("GCF_009914755.1_T2T-CHM13v2.0_genomic.gff.gz")
seqinfo(gff) <- Seqinfo(genome="T2T-CHM13v2.0")
txdb <- makeTxDbFromGRanges(gff, taxonomyId=9606)
This produces a proper TxDb with ~188,205 transcripts on the T2T-CHM13v2.0 genome. The resulting .sqlite file could be shipped as a cached resource in ASPEN's resource bundle so it isn't rebuilt each run.
3. BSgenome / sequence side
BSgenome.Hsapiens.NCBI.T2T.CHM13v2.0 wraps the T2T-CHM13v2.0 assembly (GCA_009914755.4) and is installable via BiocManager. There's also BSgenome.Hsapiens.UCSC.hs1 if UCSC-style seqnames are needed.
OrgDb (adb): org.Hs.eg.db is correct as-is
An OrgDb holds no positional data — it maps gene identifiers and pathways only. Reusing org.Hs.eg.db for hs1/hs1_chrR is correct; only the TxDb needs a real T2T source.
⚠️ Seqname convention caveat
T2T RefSeq/Liftoff annotations use NCBI-style seqnames (1, 2, ..., X, Y, MT) while ASPEN's hs1 index uses UCSC-style names (chr1, chr2, ..., chrX, chrY). Any TxDb built from the NCBI GFF must be harmonized before use, or annotation will silently produce no overlaps:
seqlevelsStyle(tdb) <- "UCSC"
This must be applied to tdb before passing it to annotatePeak().
Recommended fix for the PR
Add the hs1 / hs1_chrR case to both scripts, assigning:
tdb = T2T TxDb (option 1 via BiocT2T, or option 2 pre-cached .sqlite), not hg38
adb = "org.Hs.eg.db" (already correct)
- Apply
seqlevelsStyle(tdb) <- "UCSC" after loading
Blocked by / Dependencies
Related
⚡ Generated using AI ⚡
Summary
ccbr_annotate_bed.Randccbr_annotate_peaks.Rdo not handlehs1orhs1_chrRgenomes. Any rule that calls these scripts crashes withobject 'tdb' not foundbecause neither genome is present in the genome→TxDb dispatch chain.Discovered during the Biowulf test run for PR #120.
Error
Affected rules:
atac_genrich_peakcalling,atac_annotate_fixed_width_consensus_peaks,annotate_roiScripts:
workflow/scripts/ccbr_annotate_bed.R,workflow/scripts/ccbr_annotate_peaks.RRoot cause
Both scripts dispatch on
args$genometo assigntdb(TxDb annotation database) andadb(OrgDb). The current if-chain covers:hg19,hg38,mm9,mm10,mmul10,bosTau9— but noths1orhs1_chrR. When neither matches,tdbis never assigned and downstream usage crashes.Modern viable solutions (in order of preference)
1. Use a real T2T TxDb — a pre-built one now exists ✅ (preferred)
The
BiocT2Tpackage provides a TxDb built from the actual CHM13v2.0 annotation. Install via:This gives correct T2T coordinates rather than an hg38 stand-in.
2. Build the TxDb from the NCBI GFF (officially documented method)
makeTxDbFromUCSC()does not support hs1, so the recommended route is the GFF file provided by NCBI. DownloadGCF_009914755.1_T2T-CHM13v2.0_genomic.gff.gzfrom NCBI, then:This produces a proper TxDb with ~188,205 transcripts on the T2T-CHM13v2.0 genome. The resulting
.sqlitefile could be shipped as a cached resource in ASPEN's resource bundle so it isn't rebuilt each run.3. BSgenome / sequence side
BSgenome.Hsapiens.NCBI.T2T.CHM13v2.0wraps the T2T-CHM13v2.0 assembly (GCA_009914755.4) and is installable viaBiocManager. There's alsoBSgenome.Hsapiens.UCSC.hs1if UCSC-style seqnames are needed.OrgDb (
adb):org.Hs.eg.dbis correct as-isAn OrgDb holds no positional data — it maps gene identifiers and pathways only. Reusing
org.Hs.eg.dbforhs1/hs1_chrRis correct; only the TxDb needs a real T2T source.T2T RefSeq/Liftoff annotations use NCBI-style seqnames (
1, 2, ..., X, Y, MT) while ASPEN's hs1 index uses UCSC-style names (chr1, chr2, ..., chrX, chrY). Any TxDb built from the NCBI GFF must be harmonized before use, or annotation will silently produce no overlaps:This must be applied to
tdbbefore passing it toannotatePeak().Recommended fix for the PR
Add the
hs1/hs1_chrRcase to both scripts, assigning:tdb= T2T TxDb (option 1 viaBiocT2T, or option 2 pre-cached.sqlite), not hg38adb="org.Hs.eg.db"(already correct)seqlevelsStyle(tdb) <- "UCSC"after loadingBlocked by / Dependencies
ccbr_atacseq:v12withTxDb.Hsapiens.NCBI.CHM13v2Related
⚡ Generated using AI ⚡