GeneTrackR deterministic example data

Introduction

GeneTrackR ships one deterministic demo genome under inst/extdata. The files are small enough for package examples but deliberately share the same chromosomes, genes, variants, samples, and phenotype truth so that different modules can be demonstrated without silently changing the biological context.

library(GeneTrackR)

Package documentation: https://renscq.github.io/GeneTrackR/.

Installation

After Bioconductor acceptance, install GeneTrackR with BiocManager:

if (!requireNamespace("BiocManager", quietly = TRUE)) {
  install.packages("BiocManager")
}
BiocManager::install("GeneTrackR")
library(GeneTrackR)

The development version remains available from the GeneTrackR GitHub repository.

File inventory

extdata_dir <- system.file("extdata", package = "GeneTrackR")

sort(list.files(
  extdata_dir,
  pattern = "^gtr_demo",
  full.names = FALSE
))
#>  [1] "gtr_demo_features.bed"           "gtr_demo_pheno.tsv"             
#>  [3] "gtr_demo_riboseq_minus.bedgraph" "gtr_demo_riboseq_plus.bedgraph" 
#>  [5] "gtr_demo_rnaseq_minus.bedgraph"  "gtr_demo_rnaseq_plus.bedgraph"  
#>  [7] "gtr_demo_variants.vcf"           "gtr_demo.chrom.sizes"           
#>  [9] "gtr_demo.genePredExt"            "gtr_demo.gff3"                  
#> [11] "gtr_demo.gtf"

The main files are:

File Role
gtr_demo.genePredExt Canonical gene/transcript annotation used by most examples
gtr_demo.gtf The same annotation represented as GTF
gtr_demo.gff3 The same annotation represented as GFF3
gtr_demo_features.bed Promoter, enhancer, candidate-region, QTL, repeat, and conserved features
gtr_demo_variants.vcf Shared variant/genotype input for variant, haplotype, LD, refinement, and variant-effect workflows
gtr_demo_pheno.tsv Numeric and categorical phenotypes for all VCF samples
gtr_demo_rnaseq_plus.bedgraph Plus-strand synthetic RNA-seq coverage
gtr_demo_rnaseq_minus.bedgraph Minus-strand synthetic RNA-seq coverage
gtr_demo_riboseq_plus.bedgraph Plus-strand synthetic Ribo-seq P-site-like counts
gtr_demo_riboseq_minus.bedgraph Minus-strand synthetic Ribo-seq P-site-like counts
gtr_demo.chrom.sizes Chromosome lengths for the demo genome

Core dimensions

The deterministic model contains:

  • 2 chromosomes (chr1, chr2);
  • 20 genes and 24 transcripts;
  • 36 samples (S01-S36);
  • 56 designed variants;
  • one primary positive-strand locus, GeneA;
  • one primary negative-strand locus, GeneB.

The same annotation is represented in GenePredExt, GTF, and GFF3 so reader and conversion workflows can be compared against one biological model.

Coordinate conventions

The canonical model tables are 1-based closed. Output files follow their native format conventions:

  • GTF, GFF3, and VCF use 1-based coordinates;
  • GenePredExt, BED, and bedGraph are written using their standard 0-based conventions;
  • GeneTrackR readers standardize imported genomic intervals for package-level analysis.

Do not manually shift coordinates after reading files through GeneTrackR unless a downstream external format explicitly requires it.

Load representative objects

gp_file <- system.file(
  "extdata",
  "gtr_demo.genePredExt",
  package = "GeneTrackR"
)

vcf_file <- system.file(
  "extdata",
  "gtr_demo_variants.vcf",
  package = "GeneTrackR"
)

pheno_file <- system.file(
  "extdata",
  "gtr_demo_pheno.tsv",
  package = "GeneTrackR"
)

gp <- read_genepred(
  gp_file,
  format = "genePredExt",
  verbose = FALSE,
  progress = FALSE
)

vcf <- read_vcf(
  vcf_file,
  mode = "memory",
  keep_genotype = TRUE,
  verbose = FALSE,
  progress = FALSE
)

pheno <- read_pheno(
  pheno_file,
  verbose = FALSE,
  progress = FALSE
)

summary_feature(gp)
#>      chrom        type n_features median_feature_length
#>     <char>      <char>      <int>                 <num>
#>  1:   chr1        3UTR         11                   200
#>  2:   chr1        5UTR         11                   200
#>  3:   chr1         CDS         37                   900
#>  4:   chr1        exon         43                  1000
#>  5:   chr1        gene         10                  9000
#>  6:   chr1 start_codon         11                     3
#>  7:   chr1  stop_codon         11                     3
#>  8:   chr1  transcript         12                  9000
#>  9:   chr2        3UTR         11                   300
#> 10:   chr2        5UTR         11                   300
#> 11:   chr2         CDS         33                   900
#> 12:   chr2        exon         39                  1000
#> 13:   chr2        gene         10                  8500
#> 14:   chr2 start_codon         11                     3
#> 15:   chr2  stop_codon         11                     3
#> 16:   chr2  transcript         12                  9000
summary_vcf(vcf)
#>     chrom variant_type n_variants
#>    <char>       <char>      <int>
#> 1:   chr1          DEL          1
#> 2:   chr1          INS          2
#> 3:   chr1          SNP         33
#> 4:   chr2          SNP         20
summary_pheno(pheno)
#>              trait        type sample_n missing_n missing_rate unique_n   min
#>             <char>      <char>    <int>     <int>        <num>    <int> <num>
#> 1:     seed_weight     numeric       36         0            0       32 18.80
#> 2: protein_content     numeric       36         0            0       18 37.58
#> 3:    plant_height     numeric       36         0            0       36 98.20
#> 4:  flowering_time     numeric       36         0            0        5 43.00
#> 5:    flower_color categorical       36         0            0        2    NA
#>     mean median    max
#>    <num>  <num>  <num>
#> 1:    25     25  31.20
#> 2:    41     41  44.42
#> 3:   104    104 109.80
#> 4:    45     45  47.00
#> 5:    NA     NA     NA

GeneA haplotype truth

The GeneA gene body contains 11 variants used by the canonical haplotype example. They define four balanced genotype groups with nine samples per group.

The genotype geometry is hierarchical:

  • Hap1 and Hap2 are the nearest pair;
  • Hap3 and Hap4 are the second nearest pair;
  • cross-cluster haplotypes differ at more loci.

This structure is reused in phenotype-guided refinement and variant-effect examples rather than creating an unrelated dataset for each function.

Phenotype truth and controls

The phenotype rows are deliberately stored in a different order from VCF sample columns. Analyses must align samples by sample_id, never by row position.

The designed traits have different roles:

  • protein_content follows the major GeneA two-cluster structure and is used for refinement and variant-effect examples;
  • seed_weight and plant_height retain four ordered haplotype means;
  • flowering_time is a negative-control trait with the same within-group value pattern across the four GeneA haplotypes;
  • the phenotype table also contains a categorical trait for phenotype-type handling examples.

These known positive and negative controls make documentation examples testable: a workflow is expected to recover the designed structure rather than merely produce a plot.

LD truth

The primary LD region contains 12 SNPs (varLD01-varLD12).

  • varLD01-varLD06 form a perfect high-LD core;
  • varLD07-varLD12 progressively decorrelate downstream, creating strong, intermediate, and weak pairwise r2 values;
  • the added LD variants lie outside the GeneA body, so they do not change the 11-variant GeneA haplotype definition.

A second region around GeneT on chromosome 2 contains exactly two variants (varPair01, varPair02) and is retained as a deterministic two-variant LD plotting case.

RNA-seq and Ribo-seq signal truth

The four signal files preserve assay type and strand separately.

RNA-seq tracks contain exon-enriched coverage, including UTRs, while intronic and intergenic regions have no records. Ribo-seq tracks contain sparse 1-bp positive integer P-site-like counts restricted to CDS positions.

The Ribo-seq design has approximately 80%/10%/10% of total counts in frame 0/frame 1/frame 2. Initiation and termination frame-0 counts are approximately twice the internal frame-0 mean. Frame assignment follows transcript orientation for both positive- and negative-strand genes.

Session information

sessionInfo()
#> R version 4.6.1 (2026-06-24)
#> Platform: x86_64-pc-linux-gnu
#> Running under: Ubuntu 26.04.1 LTS
#> 
#> Matrix products: default
#> BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.32.so;  LAPACK version 3.12.0
#> 
#> locale:
#>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
#>  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
#>  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
#>  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
#>  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
#> 
#> time zone: Etc/UTC
#> tzcode source: system (glibc)
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] GeneTrackR_0.99.2 rmarkdown_2.32   
#> 
#> loaded via a namespace (and not attached):
#>  [1] gtable_0.3.6         jsonlite_2.0.0       crayon_1.5.3        
#>  [4] compiler_4.6.1       Biostrings_2.81.9    bitops_1.1-0        
#>  [7] Rsamtools_2.29.0     GenomicRanges_1.65.4 parallel_4.6.1      
#> [10] jquerylib_0.1.4      IRanges_2.47.5       Seqinfo_1.3.2       
#> [13] scales_1.4.0         BiocParallel_1.47.0  yaml_2.3.12         
#> [16] fastmap_1.2.0        XVector_0.53.0       ggplot2_4.0.3       
#> [19] R6_2.6.1             patchwork_1.3.2      labeling_0.4.3      
#> [22] generics_0.1.4       knitr_1.52           BiocGenerics_0.59.12
#> [25] maketools_1.3.2      bslib_0.12.0         RColorBrewer_1.1-3  
#> [28] rlang_1.3.0          cachem_1.1.0         xfun_0.61           
#> [31] sass_0.4.10          sys_3.4.3            S7_0.2.2            
#> [34] otel_0.2.0           cli_3.6.6            withr_3.0.3         
#> [37] digest_0.6.39        grid_4.6.1           lifecycle_1.0.5     
#> [40] S4Vectors_0.51.10    vctrs_0.7.3          evaluate_1.0.5      
#> [43] glue_1.8.1           data.table_1.18.6.1  farver_2.1.2        
#> [46] codetools_0.2-20     buildtools_1.0.0     stats4_4.6.1        
#> [49] tools_4.6.1          htmltools_0.5.9