An open API service indexing awesome lists of open source software.

https://github.com/colossal-compsci/tfboot

R package for bootstrapping motifbreakR results
https://github.com/colossal-compsci/tfboot

bioconductor bioinformatics r-package

Last synced: 13 days ago
JSON representation

R package for bootstrapping motifbreakR results

Awesome Lists containing this project

README

        

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
options(tibble.width = Inf)
options(width = 500)
```

```{r build, include=FALSE, eval=FALSE}
devtools::build_readme()
devtools::build_vignettes()
devtools::install(build_vignettes = TRUE, upgrade=FALSE)
devtools::build_manual(pkg=".", path=".")
file.rename(sprintf("tfboot_%s.pdf", packageVersion("tfboot")), "tfboot.pdf")
postdoc::render_package_manual("tfboot", outdir=".")
pkgdown::build_site()
```

# tfboot

[![R-CMD-check](https://github.com/colossal-compsci/tfboot/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/colossal-compsci/tfboot/actions/workflows/R-CMD-check.yaml)
[![pkgdown](https://img.shields.io/badge/documentation-pkgdown-9164cc.svg)](https://colossal-compsci.github.io/tfboot)
[![bioRxiv](https://img.shields.io/badge/biorRxiv-2023.07.14.549004-b31b1b.svg)](https://doi.org/10.1101/2023.07.14.549004)

The goal of tfboot is to facilitate statistical analysis of SNPs disrupting transcription factor binding sites (TFBS) using bootstrapping resampling to create empirical null distributions.

If you use tfboot, please consider citing the [paper](https://www.biorxiv.org/content/10.1101/2023.07.14.549004): Turner, S.D., et al. (2023). tfboot: Bootstrapping and statistical analysis for transcription factor binding site-disrupting variants in gene sets. bioRxiv 2023.07.14.549004. DOI: [10.1101/2023.07.14.549004](https://doi.org/10.1101/2023.07.14.549004).

## Installation

You can install tfboot from [GitHub](https://github.com/colossal-compsci/tfboot) with the code below. To install only tfboot:

```{r, eval=FALSE}
# install.packages("devtools")
devtools::install_github("colossal-compsci/tfboot")
```

To install required and suggested packages, including motifbreakR and those needed to build the vignette:

```{r, eval=FALSE}
# install.packages("devtools")
devtools::install_github("colossal-compsci/tfboot",
build_vignettes = TRUE,
dependencies = c("Imports", "Suggests"))
```

See the [pkgdown documentation](https://colossal-compsci.github.io/tfboot) for an [introductory vignette](https://colossal-compsci.github.io/tfboot/articles/intro.html) and function documentation.

## Example

Let's use an example from the vignette. First, let's load some pre-baked motifbreakR results. `mbres` is a set of motifbreakR results run on SNPs in the 5kb promoter region of a random selection of 5 genes. `mball` is the precomputed set of motifbreakR results run on SNPs in the promoter region of _all_ genes.

```{r, include=FALSE}
library(tibble)
library(tfboot)
```

```{r}
library(tfboot)
```

```{r}
mbres <- vignettedata$mbres
mbres
mball <- vignettedata$mball
mball
```

Summarize motifbreakR results on our 5 genes of interest. This shows us the actual values for the number of SNPs in the upstream regions of these genes, and summary statistics on the allele differences, effect sizes, etc. See the vignette and `?mb_summarize` for details.

```{r}
mbsmry <- mb_summarize(mbres)
mbsmry
```

Bootstrap resample motifbreakR results for all genes. Resample sets of 5 genes 250 times.

```{r}
set.seed(42)
mbboot <- mb_bootstrap(mball, ngenes=5, boots = 250)
mbboot$bootwide
mbboot$bootdist
```

Compare the values from our five genes of interest to the empirical null distribution from bootstrap resampling.

```{r}
bootstats <- mb_bootstats(mbsmry, mbboot)
bootstats
```

Visualize the results:

```{r plot_bootstats, fig.width=7, fig.height=5}
plot_bootstats(bootstats)
```

See `vignette("intro", package="tfboot")` or the articles on the [pkgdown documentation website](https://colossal-compsci.github.io/tfboot) for more.