Package 'blotbench'

Title: Easy, reproducible Westen blot editing
Description: blotbench includes a rudimentary visual image editor that helps you write reproducible, declarative, auditable code for editing western blots. Additionally, it provides tools for easily producing annotated, publication-ready images quickly.
Authors: Kai Aragaki [aut, cre]
Maintainer: Kai Aragaki <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2024-11-03 06:45:26 UTC
Source: https://github.com/KaiAragaki/blotbench

Help Index


Manually apply transforms to imgs

Description

While functions like wb_present will automatically apply transformations, this function allows you to apply them manually.

Usage

apply_transforms(wb)

Arguments

wb

A wb object


Get or set column annotation for a wb object

Description

Get or set column annotation for a wb object

Usage

col_annot(x)

col_annot(x) <- value

Arguments

x

A wb object

value

A data.frame with each column representing a variable, and each row representing a lane in the blot. NOTE: the order of the rows should annotate the lanes left-to-right AFTER image manipulation, which might include mirroring.


Get or set images for a wb object

Description

Get or set images for a wb object

Usage

imgs(x)

imgs(x) <- value

wb_add_img(x, imgs, names)

Arguments

x

A wb object

value

Unused.

imgs

A magick-image containing one or more images

names

A character vector of names with length equal to imgs. Can be NULL if row_annot is NULL

Details

Note that ⁠imgs<-⁠ is unused - add images using wb_add_img


Test if the object is a wb

Description

Test if the object is a wb

Usage

is_wb(x)

Arguments

x

Object to be tested

Value

Logical. TRUE if object inherits from the wb class


Get or set row annotation for a wb object

Description

Get or set row annotation for a wb object

Usage

row_annot(x)

row_annot(x) <- value

Arguments

x

A wb object

value

Either a data.frame with a single column name, or a character vector


Get or set transforms of a wb object

Description

Get or set transforms of a wb object

Usage

transforms(x)

transforms(x) <- value

Arguments

x

A wb object

value

A data.frame with the same number of rows as row_annot, if not null, and with columns width, height, xpos, ypos, rotate, and flip


Create a wb object

Description

Create a wb object

Usage

wb(imgs, col_annot = NULL, row_annot = NULL, transforms = NULL)

Arguments

imgs

A vector of magick-images

col_annot

A data.frame, where each row is a lane and each column is a condition

row_annot

A data.frame, where each row is a band and the first column contains band names

transforms

A data.frame, where each row contains image transformation parameters for an item in imgs. Typically left blank unless you know what you're doing


Convert a .scn file to another format

Description

The BioRad ChemiDoc produces .scn files that can be converted to .tif(f) files using bfconvert.

Usage

wb_convert_scn(file, dest_name = NULL, overwrite = FALSE)

Arguments

file

Character. Path to the file to be converted.

dest_name

Character. File name and path to save to. If not supplied, will be same name and location as input, but with a .tif extension.

overwrite

Logical. Should the file be overwritten if it already exists?

Details

This function requires bftools to be installed

Value

Path to the saved file

Examples

## Not run: 
wb_convert_scn("path/to/file.scn", dest_name = "~/new/path.tif")

## End(Not run)

Render a wb object into an image

Description

This function takes a wb object and (optionally) row and column annotations and produces an image from them.

Usage

wb_present(wb)

Arguments

wb

A wb object with at least images and transformations


Interactively edit blots

Description

This function helps generate code needed to transform a blot to your specifications via a Shiny app

Usage

wb_visual_edit(wb)

Arguments

wb

A wb object