This vignette shows how to process long-read PacBio HiFi variant calls from a validated trio (HG002–HG003–HG004) and prepare them for UPDhmm analysis.

Data source

Ashkenazi trio (GIAB, NIST) – PacBio HiFi Revio, DeepVariant calls (GRCh38).

1. Download phased VCFs for each individual


# Proband (HG002)
wget ftp://ftp-trace.ncbi.nlm.nih.gov/giab/ftp/data/AshkenazimTrio/analysis/PacBio_HiFi-Revio_20231031/pacbio-wgs-wdl_germline_20231031/HG002.GRCh38.deepvariant.phased.vcf.gz
wget ftp://ftp-trace.ncbi.nlm.nih.gov/giab/ftp/data/AshkenazimTrio/analysis/PacBio_HiFi-Revio_20231031/pacbio-wgs-wdl_germline_20231031/HG002.GRCh38.deepvariant.phased.vcf.gz.tbi

# Father (HG003)
wget ftp://ftp-trace.ncbi.nlm.nih.gov/giab/ftp/data/AshkenazimTrio/analysis/PacBio_HiFi-Revio_20231031/pacbio-wgs-wdl_germline_20231031/HG003.GRCh38.deepvariant.phased.vcf.gz
wget ftp://ftp-trace.ncbi.nlm.nih.gov/giab/ftp/data/AshkenazimTrio/analysis/PacBio_HiFi-Revio_20231031/pacbio-wgs-wdl_germline_20231031/HG003.GRCh38.deepvariant.phased.vcf.gz.tbi

# Mother (HG004)
wget ftp://ftp-trace.ncbi.nlm.nih.gov/giab/ftp/data/AshkenazimTrio/analysis/PacBio_HiFi-Revio_20231031/pacbio-wgs-wdl_germline_20231031/HG004.GRCh38.deepvariant.phased.vcf.gz
wget ftp://ftp-trace.ncbi.nlm.nih.gov/giab/ftp/data/AshkenazimTrio/analysis/PacBio_HiFi-Revio_20231031/pacbio-wgs-wdl_germline_20231031/HG004.GRCh38.deepvariant.phased.vcf.gz.tbi

2. Merge individual VCFs into a trio VCF

bcftools merge \
  -O z \
  -o trio_HiFi_GRCh38_phased.vcf.gz \
  HG002.GRCh38.deepvariant.phased.vcf.gz \
  HG003.GRCh38.deepvariant.phased.vcf.gz \
  HG004.GRCh38.deepvariant.phased.vcf.gz

bcftools index trio_HiFi_GRCh38_phased.vcf.gz

3. Filter variants for UPDhmm input

The following filtering steps are applied:

  • keep only biallelic variants

  • remove sites where all trio members are reference (0/0 or 0|0)

  • remove sites where all trio members are missing (./. or .|.)

bcftools view \
  -m2 -M2 \
  -e 'COUNT(GT="0/0" || GT="0|0")==3 || COUNT(GT="./." || GT=".|.")==3' \
  -O z \
  -o trio_HiFi_GRCh38_phased_biallelic_nonref_nomissing.vcf.gz \
  trio_HiFi_GRCh38_phased.vcf.gz

bcftools index trio_HiFi_GRCh38_phased_biallelic_nonref_nomissing.vcf.gz

4. UPDhmm analysis in R

library(UPDhmm)
library(VariantAnnotation)

vcf <- readVcf(
  "trio_HiFi_GRCh38_phased_biallelic_nonref_nomissing.vcf.gz"
)

vcf_check <- vcfCheck(
  <!-- vcf, -->
  proband = "HG002",
  father  = "HG003",
  mother  = "HG004"
)

events <- calculateEvents(
  vcf_check,
  add_ratios = TRUE
)

Session Info

sessionInfo()
## R version 4.6.1 (2026-06-24)
## Platform: x86_64-pc-linux-gnu
## Running under: Ubuntu 24.04.5 LTS
## 
## Matrix products: default
## BLAS:   /home/biocbuild/bbs-3.24-bioc/R/lib/libRblas.so 
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.12.0  LAPACK version 3.12.0
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_GB              LC_COLLATE=C              
##  [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: America/New_York
## tzcode source: system (glibc)
## 
## attached base packages:
## [1] stats4    stats     graphics  grDevices utils     datasets  methods  
## [8] base     
## 
## other attached packages:
##  [1] karyoploteR_1.39.0          regioneR_1.45.2            
##  [3] VariantAnnotation_1.59.4    Rsamtools_2.29.0           
##  [5] Biostrings_2.81.9           XVector_0.53.0             
##  [7] SummarizedExperiment_1.43.0 Biobase_2.73.2             
##  [9] GenomicRanges_1.65.4        IRanges_2.47.5             
## [11] S4Vectors_0.51.10           Seqinfo_1.3.2              
## [13] MatrixGenerics_1.25.0       matrixStats_1.5.0          
## [15] BiocGenerics_0.59.12        generics_0.1.4             
## [17] dplyr_1.2.1                 UPDhmm_1.9.1               
## [19] BiocStyle_2.41.0           
## 
## loaded via a namespace (and not attached):
##   [1] DBI_1.3.0                bitops_1.1-0             gridExtra_2.3.1         
##   [4] rlang_1.3.0              magrittr_2.0.5           biovizBase_1.61.0       
##   [7] otel_0.3.0               compiler_4.6.1           RSQLite_3.53.3          
##  [10] GenomicFeatures_1.65.0   png_0.1-9                vctrs_0.7.3             
##  [13] ProtGenerics_1.45.0      stringr_1.6.0            pkgconfig_2.0.3         
##  [16] crayon_1.5.3             fastmap_1.2.0            magick_2.9.1            
##  [19] backports_1.5.1          rmarkdown_2.32           UCSC.utils_1.9.0        
##  [22] tinytex_0.61             bit_4.6.0                xfun_0.62               
##  [25] cachem_1.1.0             cigarillo_1.3.1          GenomeInfoDb_1.49.2     
##  [28] jsonlite_2.0.0           blob_1.3.0               DelayedArray_0.39.8     
##  [31] BiocParallel_1.47.0      parallel_4.6.1           cluster_2.1.8.3         
##  [34] R6_2.6.1                 stringi_1.8.9            bslib_0.12.0            
##  [37] RColorBrewer_1.1-3       bezier_1.1.2             rtracklayer_1.73.0      
##  [40] rpart_4.1.27             jquerylib_0.1.4          Rcpp_1.1.2              
##  [43] bookdown_0.48            knitr_1.52               base64enc_0.1-6         
##  [46] BiocBaseUtils_1.15.1     Matrix_1.7-6             nnet_7.3-21             
##  [49] tidyselect_1.2.1         rstudioapi_0.19.0        dichromat_2.0-1         
##  [52] abind_1.4-8              yaml_2.3.12              codetools_0.2-20        
##  [55] curl_8.1.0               lattice_0.23-1           tibble_3.3.1            
##  [58] KEGGREST_1.53.6          S7_0.2.2                 evaluate_1.0.5          
##  [61] foreign_0.8-92           pillar_1.11.1            BiocManager_1.30.27     
##  [64] checkmate_2.3.4          RCurl_1.98-1.20          ensembldb_2.37.3        
##  [67] ggplot2_4.0.3            scales_1.4.0             glue_1.8.1              
##  [70] lazyeval_0.2.3           Hmisc_5.3-0              tools_4.6.1             
##  [73] BiocIO_1.23.3            data.table_1.18.6.1      BSgenome_1.81.1         
##  [76] GenomicAlignments_1.49.2 XML_3.99-0.25            grid_4.6.1              
##  [79] colorspace_2.1-4         AnnotationDbi_1.75.2     htmlTable_2.5.0         
##  [82] restfulr_0.0.17          Formula_1.2-6            cli_3.6.6               
##  [85] HMM_1.0.2                S4Arrays_1.13.2          AnnotationFilter_1.37.0 
##  [88] gtable_0.3.6             sass_0.4.10              digest_0.6.39           
##  [91] SparseArray_1.13.4       rjson_0.2.23             htmlwidgets_1.6.4       
##  [94] farver_2.1.2             memoise_2.0.1            htmltools_0.5.9         
##  [97] lifecycle_1.0.5          httr_1.4.9               bit64_4.8.6             
## [100] bamsignals_1.45.1