Author: Aashna Bansal, Himani Barmola, Shivam Yadav, Satyanarayan Rao
Date: 2025-06-12

# SMTrackR

Aashna Bansal, Himani Barmola, Shivam Yadav, Satyanarayan Rao

#### 2025-06-12

# Contents

## 0.1 Introduction

Single-molecule assays like NOMe-seq, and dSMF are superior to DNase-seq and ATAC-seq as they do not cleave DNA (see schematics below). Thus, they enable quantification of all three i.e., protein-free, Transcription Factor-bound and histone-complex-bound states. But a user-friendly tool to visualize and quantify such states is lacking. SMTrackR, a Bioconductor package visualizes protein-DNA binding states on individual sequenced DNA molecules. SMTrackR queries the single-molecule footprint database we built and hosted at Galaxy Server. It comprises of BigBed files generated from NOMe-seq and dSMF datasets. SMTrackR exploits UCSC REST API to query a BigBed file and plot footprint heatmap categorized in different binding states as well as report their occupancies.

## 0.2 Installation

    # if (!require("BiocManager", quietly = TRUE))
    #     install.packages("BiocManager")
    #
    # BiocManager::install("SMTrackR")
    # rmarkdown::html_vignette

## 0.3 Loading the package

    library(SMTrackR)

## 0.4 Plot Single Molecules from SMF Data

`SMTrackR::plotFootprints()` will generate the heatmap `pdf` file stored in `<target_dir>/plots/<label>.heatmap.pdf` if `target_dir` option is provided, otherwise the plot will be saved in the `tempdir`, the fuction reports the path in both the cases. A `Gviz` compatible code can also be generated by running the `generateGvizCodeforSMF` function. See the code chunk below.

    SMTrackR::plotFootprints(organism = "mmusculus", model = "16cell", condition = "WT",
                             genome_assembly = "mm39", type = "SMF", chromosome = "chr1",
                             start = 191450362,  end = 191450392, tr = "16cell",
                             label = "tss_mm39", fp_cap = 50, remove_dup = FALSE, target_dir = "smf")

    ## Using UCSC API to get JSON dump from BigBed Track ...

    ## Heatmap is saved in the file smf/plots/tss_mm39.heatmap.pdf

    ##

    ## [1] "smf/plots/tss_mm39.heatmap.pdf"

    SMTrackR::generateGvizCodeforSMF(organism = "mmusculus", model = "16cell", condition = "WT",
                             genome_assembly = "mm39", type = "SMF", chromosome = "chr1",
                             start = 191450362,  end = 191450392, tr = "16cell",
                             label = "tss_mm39", fp_cap = 50, remove_dup = FALSE, gviz_left = 500,
                             gviz_right = 500, target_dir = "smf")

    ## A R code file smf/tss_mm39.gviz.R is written. Please run the command: Rscript smf/tss_mm39.gviz.R to place the heatmap on gene track!

NOTE: The Nov 2020 Ensembl Archive (nov2020.archive.ensembl.org is down almost always. Thus, it is a gentle advice to use may2025 archive. You have to manually change the host argument in the gviz R file (for instance, tss_mm39.gviz.R) according to the need. Snapshot for heatmap embedded with ideogram and axis is below.

## 0.5 Plot Single Molecules from dSMF Data

To learn more about dSMF data, please read the article Krebs et al., Mol. Cell., 2017. Briefly, it uses two exogenous methyltransferases in tandem to map protein-DNA binding on individual sequenced DNA molecules.

The command below will generate `plots/peak229.plot.pdf` file.

    SMTrackR::plotFootprints(target_dir = "dsmf")

    ## Using UCSC API to get JSON dump from BigBed Track ...

    ## Heatmap is saved in the file dsmf/plots/peak229.heatmap.pdf

    ##

    ## [1] "dsmf/plots/peak229.heatmap.pdf"

Below is the snapshot (png) of the saved pdf.

## 0.6 Plot Single Molecules from Nanopore Data

Running the command below will generate a pdf file `plots/smac_seq.plot.pdf`.

    SMTrackR::plotMethylationCallsNanopore(target_dir = "nanopore")

    ## Using UCSC API to get JSON dump from BigBed Track ...

    ## Heatmap is saved in the file nanopore/plots/smac_seq.heatmap.pdf

    ##

Here is the `png` version of the saved pdf.

## 0.7 Listing Available Track

All uptodate tracks are available here and can be listed using the following command.

    #SMTrackR::listTracks()

## 0.8 Session Info

    sessionInfo()

    ## R version 4.6.0 RC (2026-04-17 r89917)
    ## Platform: x86_64-pc-linux-gnu
    ## Running under: Ubuntu 24.04.4 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] stats     graphics  grDevices utils     datasets  methods   base
    ##
    ## other attached packages:
    ## [1] SMTrackR_1.1.0   BiocStyle_2.41.0
    ##
    ## loaded via a namespace (and not attached):
    ##  [1] SummarizedExperiment_1.43.0 httr2_1.2.2
    ##  [3] rjson_0.2.23                xfun_0.57
    ##  [5] bslib_0.10.0                Biobase_2.73.0
    ##  [7] lattice_0.22-9              vctrs_0.7.3
    ##  [9] tools_4.6.0                 bitops_1.0-9
    ## [11] generics_0.1.4              stats4_4.6.0
    ## [13] curl_7.1.0                  parallel_4.6.0
    ## [15] tibble_3.3.1                RSQLite_2.4.6
    ## [17] blob_1.3.0                  pkgconfig_2.0.3
    ## [19] Matrix_1.7-5                dbplyr_2.5.2
    ## [21] S4Vectors_0.51.0            cigarillo_1.3.0
    ## [23] lifecycle_1.0.5             compiler_4.6.0
    ## [25] stringr_1.6.0               Rsamtools_2.29.0
    ## [27] Biostrings_2.81.0           Seqinfo_1.3.0
    ## [29] codetools_0.2-20            htmltools_0.5.9
    ## [31] sass_0.4.10                 RCurl_1.98-1.18
    ## [33] yaml_2.3.12                 pillar_1.11.1
    ## [35] crayon_1.5.3                jquerylib_0.1.4
    ## [37] BiocParallel_1.47.0         cachem_1.1.0
    ## [39] DelayedArray_0.39.0         abind_1.4-8
    ## [41] tidyselect_1.2.1            digest_0.6.39
    ## [43] stringi_1.8.7               purrr_1.2.2
    ## [45] dplyr_1.2.1                 restfulr_0.0.16
    ## [47] bookdown_0.46               fastmap_1.2.0
    ## [49] grid_4.6.0                  cli_3.6.6
    ## [51] SparseArray_1.13.0          magrittr_2.0.5
    ## [53] S4Arrays_1.13.0             XML_3.99-0.23
    ## [55] withr_3.0.2                 filelock_1.0.3
    ## [57] rappdirs_0.3.4              bit64_4.8.0
    ## [59] rmarkdown_2.31              XVector_0.53.0
    ## [61] httr_1.4.8                  matrixStats_1.5.0
    ## [63] bit_4.6.0                   otel_0.2.0
    ## [65] memoise_2.0.1               evaluate_1.0.5
    ## [67] knitr_1.51                  GenomicRanges_1.65.0
    ## [69] IRanges_2.47.0              BiocIO_1.23.0
    ## [71] BiocFileCache_3.3.0         rtracklayer_1.73.0
    ## [73] rlang_1.2.0                 glue_1.8.1
    ## [75] DBI_1.3.0                   BiocManager_1.30.27
    ## [77] BiocGenerics_0.59.0         jsonlite_2.0.0
    ## [79] R6_2.6.1                    MatrixGenerics_1.25.0
    ## [81] GenomicAlignments_1.49.0