Package 'chromr'

Title: Read and Plot FPLC Chromatograms
Description: For reading files from BioRad QuadTec machines and making plots of the charomatograms.
Authors: Brady Johnston
Maintainer: Brady Johnston <[email protected]>
License: MIT + file LICENSE
Version: 0.2.0
Built: 2024-11-21 03:34:55 UTC
Source: https://github.com/bradyajohnston/chromr

Help Index


Check if Column is Present in DataFrame Ignoring Case

Description

Check if Column is Present in DataFrame Ignoring Case

Usage

check_column_exist(data, name)

Arguments

data

Dataframe

name

string of column name

Value

Logical TRUE/FALSE if the column exists.


Add Volume Column From Time Units

Description

Adds a column with calculated volums from the time column given a particular flow rate. Currently only constant flow rates are supported.

Usage

chrom_add_volume(.data, flow_rate = 0.5, time = "second")

Arguments

.data

Data frame or tibble with a column called 'time'.

flow_rate

Flow rate in ml/min.

time

Time unit when exported.

Value

a [tibble][tibble::tibble-package]

Examples

fl <- system.file(
  "extdata",
  "sec_no_volume.txt",
  package = "chromr"
)
# read just the data
dat <- fl %>%
  chrom_read_quadtech()
dat
# add a volume given a constant flow rate
dat %>%
  chrom_add_volume(0.3)

Append a Chromatogram to Another Run

Description

Sums the volume and the time columns. Optionally continues the numbering of the fractions after the previous runs.

Usage

chrom_append_run(.data, ..., adjust_fractions = FALSE)

Arguments

.data

A data frame created through 'chrom_read_*()'

...

Runs created through 'chrom_read_*()'

adjust_fractions

Logical. FALSE keeps the fraction numbering as-is. TRUE starts the number of the subsequent fractions by adding the previous fractions.

Value

a [tibble][tibble::tibble-package] which combines the given runs.

Examples

fl1 <- system.file("extdata",
  "20220809_SFPQfl_TEVdig_S200_part1.TXT",
  package = "chromr"
)
fl2 <- system.file("extdata",
  "20220809_SFPQfl_TEVdig_S200_part2.TXT",
  package = "chromr"
)
df1 <- chrom_read_quadtech(fl1)
df2 <- chrom_read_quadtech(fl2)


df1 %>%
  chrom_append_run(df2)

Find the Line Where Data Begins

Description

Finds the line where the tabular data begins. This is then used to start the reading of the data with 'readr::read_csv()' and end the reading of the metadata.

Usage

chrom_find_data_start_line(file, n_lines = 50)

Arguments

file

File path to the file to read.

n_lines

Number of lines to search for the start of the data.

Value

Single integer of the start of the data.


Reads Metadata from QuadTech Chromatogram

Description

Reads Metadata from QuadTech Chromatogram

Usage

chrom_get_meta_quadtech(file, start_line)

Arguments

file

Path to the chromatogram file.

start_line

Start of the data and thus end of the metadata. Determined with 'chromr::chrom_find_data_start_line()'

Value

a [tibble][tibble::tibble-package]


Plot a Chromatogram

Description

Plot a Chromatogram

Usage

chrom_plot(data, xlim = NULL, ylim = NULL)

Arguments

data

Data frame that contains columns for wavelength ('wl'), volume ('volume') and absorbance ('abs').

xlim

Limits for the x axis.

ylim

Limits for the y axis.

Value

a 'ggplot2::ggplot()' plot.

Examples

fl <- system.file(
  "extdata",
  "sec_no_volume.txt",
  package = "chromr"
)

fl %>%
  chrom_read_quadtech() %>%
  chrom_add_volume(0.3) %>%
  chrom_plot(xlim = c(0, 3), ylim = c(NA, 0.01))

Plot Chromatogram with Fractions

Description

Plot Chromatogram with Fractions

Usage

chrom_plot_fractions(
  data,
  wl_frac = 280,
  fractions = TRUE,
  frac_include = "all",
  frac_labelling = 5,
  frac_text_size = 3,
  frac_text_adjust = 1.3
)

Arguments

data

Datafram containing values.

wl_frac

Wavelengths to show the fractionation scheme for.

fractions

Logical, whether to incude fractions on the plot.

frac_include

Specific fractions to include. Either "all" for all fractions, or a numeric vector of length 2, specifying the limits for the fractions to be included (e.g. c(10, 30) includes fractions from 10 till 30, including both).

frac_labelling

How often to label the fractions. Every $n_th$ fraction is labelled.

frac_text_size

Size of the labels for the fractionation.

frac_text_adjust

'vjust' for the labels for the fractionation.

Value

a ggplot object.

Examples

fl1 <- system.file("extdata",
  "20220809_SFPQfl_TEVdig_S200_part1.TXT",
  package = "chromr"
)
fl2 <- system.file("extdata",
  "20220809_SFPQfl_TEVdig_S200_part2.TXT",
  package = "chromr"
)
df1 <- chrom_read_quadtech(fl1)
df2 <- chrom_read_quadtech(fl2)
dat <- chrom_append_run(df1, df2)
chrom_plot_fractions(dat, wl_frac = c(280, 488))

Read .csv Chromatogram from the BioRad NGC

Description

Read .csv Chromatogram from the BioRad NGC

Usage

chrom_read_ngc(file, skip = 1)

Arguments

file

File path to the '.csv' file.

skip

Number of lines to skip before begin reading. Usually 1 line.

Value

a [tibble][tibble::tibble-package]

Examples

fl <- system.file(
  "extdata",
  "ngc_sec.csv",
  package = "chromr"
)

dat <- chrom_read_ngc(fl)
dat

Read BioRad QuadTech Chromatogram Files

Description

Read BioRad QuadTech Chromatogram Files

Usage

chrom_read_quadtech(file, interp_volume = TRUE)

Arguments

file

Exported '.TXT' chromatogram file from the BioRad QuadTech.

interp_volume

Logical. If TRUE, interpolates the values in the volume column based on the values in the time column.

Value

a [tibble][tibble::tibble-package]

Examples

fl <- system.file("extdata",
  "sec.txt",
  package = "chromr"
)
# just read
fl %>%
  chrom_read_quadtech()

# read without interpolating volume
fl %>%
  chrom_read_quadtech(interp_volume = FALSE)
# read then plot
fl %>%
  chrom_read_quadtech() %>%
  chrom_plot()

Interpolate Interpolate Given Column

Description

Interpolate Interpolate Given Column

Usage

interpolate_column(data, col)

Arguments

data

Dataframe with column to interpolate.

col

Name of the column to interpolate.

Value

a [tibble][tibble::tibble-package]


Title

Description

Title

Usage

rename_columns(data)

Arguments

data

Dataframe to rename the columns of.

Value

Dataframe with renamed column.