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 |
Check if Column is Present in DataFrame Ignoring Case
check_column_exist(data, name)
check_column_exist(data, name)
data |
Dataframe |
name |
string of column name |
Logical TRUE/FALSE if the column exists.
Adds a column with calculated volums from the time column given a particular flow rate. Currently only constant flow rates are supported.
chrom_add_volume(.data, flow_rate = 0.5, time = "second")
chrom_add_volume(.data, flow_rate = 0.5, time = "second")
.data |
Data frame or tibble with a column called 'time'. |
flow_rate |
Flow rate in ml/min. |
time |
Time unit when exported. |
a [tibble][tibble::tibble-package]
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)
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)
Sums the volume and the time columns. Optionally continues the numbering of the fractions after the previous runs.
chrom_append_run(.data, ..., adjust_fractions = FALSE)
chrom_append_run(.data, ..., adjust_fractions = FALSE)
.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. |
a [tibble][tibble::tibble-package] which combines the given runs.
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)
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)
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.
chrom_find_data_start_line(file, n_lines = 50)
chrom_find_data_start_line(file, n_lines = 50)
file |
File path to the file to read. |
n_lines |
Number of lines to search for the start of the data. |
Single integer of the start of the data.
Reads Metadata from QuadTech Chromatogram
chrom_get_meta_quadtech(file, start_line)
chrom_get_meta_quadtech(file, start_line)
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()' |
a [tibble][tibble::tibble-package]
Plot a Chromatogram
chrom_plot(data, xlim = NULL, ylim = NULL)
chrom_plot(data, xlim = NULL, ylim = NULL)
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. |
a 'ggplot2::ggplot()' plot.
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))
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
chrom_plot_fractions( data, wl_frac = 280, fractions = TRUE, frac_include = "all", frac_labelling = 5, frac_text_size = 3, frac_text_adjust = 1.3 )
chrom_plot_fractions( data, wl_frac = 280, fractions = TRUE, frac_include = "all", frac_labelling = 5, frac_text_size = 3, frac_text_adjust = 1.3 )
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. |
a ggplot object.
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))
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
chrom_read_ngc(file, skip = 1)
chrom_read_ngc(file, skip = 1)
file |
File path to the '.csv' file. |
skip |
Number of lines to skip before begin reading. Usually 1 line. |
a [tibble][tibble::tibble-package]
fl <- system.file( "extdata", "ngc_sec.csv", package = "chromr" ) dat <- chrom_read_ngc(fl) dat
fl <- system.file( "extdata", "ngc_sec.csv", package = "chromr" ) dat <- chrom_read_ngc(fl) dat
Read BioRad QuadTech Chromatogram Files
chrom_read_quadtech(file, interp_volume = TRUE)
chrom_read_quadtech(file, interp_volume = TRUE)
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. |
a [tibble][tibble::tibble-package]
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()
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
interpolate_column(data, col)
interpolate_column(data, col)
data |
Dataframe with column to interpolate. |
col |
Name of the column to interpolate. |
a [tibble][tibble::tibble-package]
Title
rename_columns(data)
rename_columns(data)
data |
Dataframe to rename the columns of. |
Dataframe with renamed column.