knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
summerrband
plays for you gel-shift data from "tapes" recorded on Cytiva's
ImageQuant TL. Wherever the data comes from, once it's in a table (data.frame
),
this package gives you also a handle on fitting dissociation constants in various
ways.
Since this package is not part of CRAN, you must install and update the development version from GitHub with:
# install.packages("devtools") devtools::install_github("benjbuch/summerrband")
library(summerrband)
my_file <- system.file("extdata", "gel_01.txt", package = "summerrband")
This is how a raw IQTL file looks like (truncated):
data.table::fread(my_file)[, 1:14]
This is how the same file will look like after tidy importing. As an extra benefit
of calling iqtl_view
instead of iqtl_read
, we'll play a preview alongside:
iqtl_view(my_file)
Let's assign some metadata along with the tunes:
my_data <- iqtl_meta(my_file, meta_data = list(conc = c(2^seq(10, 0), 1), protein = "protA", ligand = "DNA1")) head(my_data)
Of course, there is a batch function (iqtl_import_all
) too.
Four lines to sing:
library(magrittr) # for the pipe operator my_data %>% dplyr::filter(band_id == "band_1") %>% dplyr::group_by(protein, ligand) %>% model_cleanly_groupwise(fit_Kd, formula = vol_frac ~ conc, newdata = data.frame(conc = 10^seq(0, 3, length.out = 100))) %>% model_display(color = ligand) + ggplot2::facet_wrap(ggplot2::vars(protein))
my_data %>% dplyr::filter(band_id == "band_1") %>% dplyr::group_by(protein, ligand) %>% model_cleanly_groupwise(fit_Kd, formula = vol_frac ~ conc) %>% dplyr::select(tidy) %>% tidyr::unnest(tidy)
We can also employ a model that doesn't assume excess of the non-titrated species
R. So, when we provide its intial (total) concentration R0
before the equilibrium
is reached:
my_data %>% dplyr::filter(band_id == "band_1") %>% dplyr::group_by(protein, ligand) %>% model_cleanly_groupwise(fit_Kd, formula = vol_frac ~ conc, R0 = 2.0) %>% dplyr::select(tidy) %>% tidyr::unnest(tidy)
It is further possible to include a Hill slope if need be and to switch between differen fitting algorithms in R.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.