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

## 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.

## 2 Installation

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

## 3 Loading the package

    library(SMTrackR)

## 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 ...

    ## adding rname 'https://api.genome.ucsc.edu/getData/track?hubUrl=https://usegalaxy.org/api/datasets/f9cad7b01a472135946f1160cf4cb4b2/display?to_ext=txt;genome=mm39;track=16cell;chrom=chr1;start=191450362;end=191450392'

    ## 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.

## 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 ...

    ## adding rname 'https://api.genome.ucsc.edu/getData/track?hubUrl=https://usegalaxy.org/api/datasets/f9cad7b01a472135e6897af4f6ed17e1/display?to_ext=txt;genome=dm6;track=fp_and_mvec;chrom=chr2L;start=480290;end=480320'

    ## 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.

## 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 ...

    ## adding rname 'https://api.genome.ucsc.edu/getData/track?hubUrl=https://usegalaxy.org/api/datasets/f9cad7b01a472135c1c27ee41f61cd34/display?to_ext=txt;genome=sacCer3;track=nanopore_meth_calls;chrom=chrIII;start=114300;end=114600'

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

    ##

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

## 7 Listing Available Track

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

    #SMTrackR::listTracks()

## 8 Session Info

    sessionInfo()

    ## R version 4.6.0 Patched (2026-05-01 r89994)
    ## Platform: aarch64-apple-darwin23
    ## Running under: macOS Tahoe 26.3.1
    ##
    ## Matrix products: default
    ## BLAS:   /Library/Frameworks/R.framework/Versions/4.6/Resources/lib/libRblas.0.dylib
    ## LAPACK: /Library/Frameworks/R.framework/Versions/4.6/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.1
    ##
    ## locale:
    ## [1] C/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
    ##
    ## time zone: America/New_York
    ## tzcode source: internal
    ##
    ## 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.11.0                Biobase_2.73.1
    ##  [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_3.52.0
    ## [17] blob_1.3.0                  pkgconfig_2.0.3
    ## [19] BiocBaseUtils_1.15.1        Matrix_1.7-5
    ## [21] dbplyr_2.5.2                S4Vectors_0.51.2
    ## [23] cigarillo_1.3.0             lifecycle_1.0.5
    ## [25] compiler_4.6.0              stringr_1.6.0
    ## [27] Rsamtools_2.29.0            Biostrings_2.81.1
    ## [29] Seqinfo_1.3.0               codetools_0.2-20
    ## [31] htmltools_0.5.9             sass_0.4.10
    ## [33] RCurl_1.98-1.18             yaml_2.3.12
    ## [35] pillar_1.11.1               crayon_1.5.3
    ## [37] jquerylib_0.1.4             BiocParallel_1.47.0
    ## [39] cachem_1.1.0                DelayedArray_0.39.2
    ## [41] abind_1.4-8                 tidyselect_1.2.1
    ## [43] digest_0.6.39               stringi_1.8.7
    ## [45] purrr_1.2.2                 dplyr_1.2.1
    ## [47] restfulr_0.0.16             bookdown_0.46
    ## [49] fastmap_1.2.0               grid_4.6.0
    ## [51] cli_3.6.6                   SparseArray_1.13.2
    ## [53] magrittr_2.0.5              S4Arrays_1.13.0
    ## [55] XML_3.99-0.23               withr_3.0.2
    ## [57] filelock_1.0.3              rappdirs_0.3.4
    ## [59] bit64_4.8.0                 rmarkdown_2.31
    ## [61] XVector_0.53.0              httr_1.4.8
    ## [63] matrixStats_1.5.0           bit_4.6.0
    ## [65] otel_0.2.0                  memoise_2.0.1
    ## [67] evaluate_1.0.5              knitr_1.51
    ## [69] GenomicRanges_1.65.0        IRanges_2.47.1
    ## [71] BiocIO_1.23.3               BiocFileCache_3.3.0
    ## [73] rtracklayer_1.73.0          rlang_1.2.0
    ## [75] glue_1.8.1                  DBI_1.3.0
    ## [77] BiocManager_1.30.27         BiocGenerics_0.59.2
    ## [79] jsonlite_2.0.0              R6_2.6.1
    ## [81] MatrixGenerics_1.25.0       GenomicAlignments_1.49.0