Title: | Protein Micro Array Data Management and Interactive Visualization |
---|---|
Description: | A generic three-step pre-processing package for protein microarray data. This package contains different data pre-processing procedures to allow comparison of their performance.These steps are background correction, the coefficient of variation (CV) based filtering, batch correction and normalization. |
Authors: | Kennedy Mwai [cre, aut], James Mburu [aut], Jacqueline Waeni [ctb] |
Maintainer: | Kennedy Mwai <[email protected]> |
License: | GPL-3 |
Version: | 1.11.0 |
Built: | 2024-11-30 03:19:59 UTC |
Source: | https://github.com/bioc/protGear |
A generic function returning a list with the data structure.
array_vars( channel = "635", totsamples, FG = "", BG = "", FBG = "", blockspersample, chip_path = "data/array_data", sampleID_path = "data/array_sampleID/", mig_prefix = "_first", machine = "", date_process = "" )
array_vars( channel = "635", totsamples, FG = "", BG = "", FBG = "", blockspersample, chip_path = "data/array_data", sampleID_path = "data/array_sampleID/", mig_prefix = "_first", machine = "", date_process = "" )
channel |
A character indicating the channel that the data was scanned at. It is mostly included in the MFI variable names. |
totsamples |
A numeric value indicating teh number of samples on a slide. |
FG |
Optional:A character indicating the name of the foreground
variable name. if not specified its created as
|
BG |
Optional:A character indicating the name of the background
variable name. if not specified its created as
|
FBG |
Optional:A character indicating the name of the
foreground - background variable name. if not specified its
created as |
blockspersample |
A numeric value indicating the numer of blocks in a
mini-array. The |
chip_path |
A character indicating the path of the folder location with the array data. |
sampleID_path |
A character indicating the path of the folder location with the sample identifiers matching the array structure. |
mig_prefix |
Optional: A character indicating the identifier of an MIG dilution file |
machine |
Optional:A character indicating the machine used to process the data in the folder |
date_process |
Optional:A character indicating the date when the samples were processed. |
a list of parameters required to process the data
genepix_vars
## specify the the parameters to process the data genepix_vars <- array_vars( ## the channel the data was processed in channel = "635", ## folder where the array data is stored chip_path = "data/array_data", ## the number of samples per slide or in as single run totsamples = 21, ## How many blocks each sample occupies blockspersample = 2, ## folder where the array data samples id files are stored sampleID_path = "data/array_sampleID/", ## optional mig_prefix = "_first", machine = 1, date_process = "0520" ) genepix_vars
## specify the the parameters to process the data genepix_vars <- array_vars( ## the channel the data was processed in channel = "635", ## folder where the array data is stored chip_path = "data/array_data", ## the number of samples per slide or in as single run totsamples = 21, ## How many blocks each sample occupies blockspersample = 2, ## folder where the array data samples id files are stored sampleID_path = "data/array_sampleID/", ## optional mig_prefix = "_first", machine = 1, date_process = "0520" ) genepix_vars
A function to select the best CV by combining the replicates in duplicates. The function has been build for up to to 3 replicates so far
best_CV_estimation(dataCV, slide_id, lab_replicates, cv_cut_off)
best_CV_estimation(dataCV, slide_id, lab_replicates, cv_cut_off)
dataCV |
A data frame |
slide_id |
A character string containing the identifier of the data frame variable. |
lab_replicates |
A numeric value indicating the number of lab replicates. |
cv_cut_off |
a numeric value for the CV cut off. Should be between 0-100 |
Select set of replicates with the best CV
A data frame with the best CV's estimated
dataC <- readr::read_csv(system.file("extdata", "dataC.csv", package="protGear")) ## this file has 3 lab replicates and the default names dataCV <- cv_estimation(dataC ,lab_replicates=3) best_CV_estimation(dataCV,slide_id = "iden", lab_replicates = 3, cv_cut_off = 20)
dataC <- readr::read_csv(system.file("extdata", "dataC.csv", package="protGear")) ## this file has 3 lab replicates and the default names dataCV <- cv_estimation(dataC ,lab_replicates=3) best_CV_estimation(dataCV,slide_id = "iden", lab_replicates = 3, cv_cut_off = 20)
A generic function to perform background correction.
bg_correct(iden, Data1, genepix_vars, method = "subtract_local")
bg_correct(iden, Data1, genepix_vars, method = "subtract_local")
iden |
A character indicating the name of the object to be used under Data1 |
Data1 |
A data frame with sample identifiers merged with micro array data. |
genepix_vars |
A list of specific definitions of the experiment design.
See |
method |
a description of the background correction to be used.
Possible values are |
Background correction
The function implements background correction methods developed
by backgroundCorrect
. But the
minimum_half and movingmin_bg
uses the block of the protein array as
the grid. If method="movingmin_bg" the minimum
background value within a block is subtracted.
If method="minimum_half" then any intensity which is negative after
background subtraction is reset to be equal to half the
minimum positive value in
a block. If method="movingmin_value" then any intensity which is negative
after background subtraction is reset to the minimum positive value
in a block. For edwards
we implement a similar algorithm with
limma::backgroundCorrect(method="edwards")
and for 'normexp'
we use the saddle-point approximation to maximum likelihood,
backgroundCorrect
for more details.
A data frame with background corrected data
A function to extract the buffer spots data. A buffer spot only has the solution for proprietary ingredients for stabilizing protein and minimizing evaporation.
buffer_spots(Data1, buffer_spot = "buffer")
buffer_spots(Data1, buffer_spot = "buffer")
Data1 |
An object of the class data frame |
buffer_spot |
A character string containing the name of the buffer spots. |
A data frame of the buffer control spots
bg_correct_df <- readr::read_csv(system.file("extdata", "Data1_sample.csv", package="protGear")) buffer_spots(Data1 = bg_correct_df)
bg_correct_df <- readr::read_csv(system.file("extdata", "Data1_sample.csv", package="protGear")) buffer_spots(Data1 = bg_correct_df)
A generic function to check if the file(s) with the MFI values have a corresponding sample ID file. Sample ID file is a file with the identifiers for the samples in array file.
check_sampleID_files(genepix_vars)
check_sampleID_files(genepix_vars)
genepix_vars |
A list of specific definitions of the experiment design.
See |
A file with missing corresponding sample ID files
genepix_vars <- array_vars( channel = "635", chip_path = system.file("extdata", "array_data/machine1/", package="protGear"), totsamples = 21, blockspersample = 2, mig_prefix = "_first", machine = 1, date_process = "0520" ) check_sampleID_files(genepix_vars)
genepix_vars <- array_vars( channel = "635", chip_path = system.file("extdata", "array_data/machine1/", package="protGear"), totsamples = 21, blockspersample = 2, mig_prefix = "_first", machine = 1, date_process = "0520" ) check_sampleID_files(genepix_vars)
creating a directory
create_dir(path)
create_dir(path)
path |
folder location to create a directory |
created directory
create_dir("data/sample_folder")
create_dir("data/sample_folder")
A function to give the summary of the CV's by the sampleID
cv_by_sample_estimation( dataCV, cv_variable, lab_replicates, sampleID_var = "sampleID" )
cv_by_sample_estimation( dataCV, cv_variable, lab_replicates, sampleID_var = "sampleID" )
dataCV |
A dataframe |
cv_variable |
A character string containing the identifier of the variable with CV values. |
lab_replicates |
A numeric value indicating the number of lab replicates. |
sampleID_var |
A character string containing the name of the sample identifier variable. Default set to 'sampleID' |
Summarise CV by samples
A data frame of CV calculated by sample
dataC <- readr::read_csv(system.file("extdata", "dataC.csv", package="protGear")) ## this file has 3 lab replicates and the default names dataCV <- cv_estimation(dataC ,lab_replicates=3) cv_by_sample_estimation(dataCV, cv_variable = "cvCat_all", lab_replicates = 3)
dataC <- readr::read_csv(system.file("extdata", "dataC.csv", package="protGear")) ## this file has 3 lab replicates and the default names dataCV <- cv_estimation(dataC ,lab_replicates=3) cv_by_sample_estimation(dataCV, cv_variable = "cvCat_all", lab_replicates = 3)
A function to calculate the CV for the technical lab replicates. The default values are set as per the object names generated by machine
cv_estimation( dataC, lab_replicates, sampleID_var = "sampleID", antigen_var = "antigen", replicate_var = "replicate", mfi_var = "FMedianBG_correct", cv_cut_off = 20 )
cv_estimation( dataC, lab_replicates, sampleID_var = "sampleID", antigen_var = "antigen", replicate_var = "replicate", mfi_var = "FMedianBG_correct", cv_cut_off = 20 )
dataC |
A dataset a data frame with feature variables to be used |
lab_replicates |
A numeric value indicating the number of lab replicates |
sampleID_var |
A character string containing the name of the sample identifier variable. Default set to 'sampleID' |
antigen_var |
A character string containing the name of the features/protein variable. Default to 'antigen' |
replicate_var |
A character string containing the name of the replicate variable. Default to 'replicate' |
mfi_var |
A character string containing the name of the variable with MFI value.Assuming background correction is done already. Default to 'FMedianBG_correct' |
cv_cut_off |
Optional value indicating the cut off of flagging CV's. Default set at 20. |
Coefficient of Variation
A data frame where CV's of the replicates have been calculated
dataC <- readr::read_csv(system.file("extdata", "dataC.csv", package="protGear")) ## this file has 3 lab replicates and the default names cv_estimation(dataC ,lab_replicates=3)
dataC <- readr::read_csv(system.file("extdata", "dataC.csv", package="protGear")) ## this file has 3 lab replicates and the default names cv_estimation(dataC ,lab_replicates=3)
A generic function to extract the background data for micro array data.
extract_bg(iden, data_files, genepix_vars = genepix_vars)
extract_bg(iden, data_files, genepix_vars = genepix_vars)
iden |
A character indicating the name of the object to be used under data_files. |
data_files |
A list of data objects with names utilised by iden. |
genepix_vars |
A list of specific definitions of the experiment design.
See |
Extract the background values
A data frame of background values
## Not run: genepix_vars <- array_vars( channel = "635", chip_path = system.file("extdata", "array_data/machine1/", package="protGear"), totsamples = 21, blockspersample = 2, mig_prefix = "_first", machine = 1, ## optional date_process = "0520" ) #Define the data path data_path <- paste0(genepix_vars$chip_path) # List the file names to use filenames <- list.files(genepix_vars$chip_path, pattern = '*.txt$|*.gpr$', full.names = FALSE ) data_files <- purrr::map( .x = filenames, .f = read_array_files, data_path = data_path, genepix_vars = genepix_vars ) data_files <- purrr::set_names(data_files, purrr::map(filenames, name_of_files)) names(data_files) extract_bg(iden ="KK2-06" , data_files=data_files,genepix_vars=genepix_vars) ## End(Not run)
## Not run: genepix_vars <- array_vars( channel = "635", chip_path = system.file("extdata", "array_data/machine1/", package="protGear"), totsamples = 21, blockspersample = 2, mig_prefix = "_first", machine = 1, ## optional date_process = "0520" ) #Define the data path data_path <- paste0(genepix_vars$chip_path) # List the file names to use filenames <- list.files(genepix_vars$chip_path, pattern = '*.txt$|*.gpr$', full.names = FALSE ) data_files <- purrr::map( .x = filenames, .f = read_array_files, data_path = data_path, genepix_vars = genepix_vars ) data_files <- purrr::set_names(data_files, purrr::map(filenames, name_of_files)) names(data_files) extract_bg(iden ="KK2-06" , data_files=data_files,genepix_vars=genepix_vars) ## End(Not run)
This is Function is to launch the shiny application
launch_protGear_interactive()
launch_protGear_interactive()
launches the shiny interactive protGear app
app <- system.file("shiny-examples", "protGear_interactive", "protGear_interactive.Rmd", package = "protGear") if (app!=""){ ## run this #launch_protGear_interactive() }
app <- system.file("shiny-examples", "protGear_interactive", "protGear_interactive.Rmd", package = "protGear") if (app!=""){ ## run this #launch_protGear_interactive() }
This is Function is to launch mutiple shiny applications for protGear
launch_select(theApp)
launch_select(theApp)
theApp |
accepts one of the folders containing the shiny appplication |
launches the app defined under theApp
validExamples <- list.files(system.file("shiny-examples", package = "protGear")) #launch_select(validExamples[[1]])
validExamples <- list.files(system.file("shiny-examples", package = "protGear")) #launch_select(validExamples[[1]])
Normalize Arrays
matrix_normalise( matrix_antigen, method = "log2", batch_correct = FALSE, batch_var1, batch_var2 = day_batches, return_plot = FALSE, plot_by_antigen = TRUE, control_antigens = NULL, array_matrix = NULL )
matrix_normalise( matrix_antigen, method = "log2", batch_correct = FALSE, batch_var1, batch_var2 = day_batches, return_plot = FALSE, plot_by_antigen = TRUE, control_antigens = NULL, array_matrix = NULL )
matrix_antigen |
An object of class matrix with features/proteins as columns and samples as the rows |
method |
character string specifying the normalization method.
Choices are |
batch_correct |
A logical value indicating whether batch correction should be done or not |
batch_var1 |
A character or factor vector of size similar to rows
of |
batch_var2 |
A character or factor vector of size similar to rows
of |
return_plot |
A logical value indicating whether a plot is returned to show the results of normalisation. |
plot_by_antigen |
Logical to indicate whether to plot by antigen or not slide name for the matrix_antigen object. |
control_antigens |
logical vector specifying the subset of spots
which are non-differentially-expressed control spots,
for use with |
array_matrix |
An object of class dataframe or matrix used with
|
A data frame of normalised values
matrix_antigen <- readr::read_csv(system.file("extdata", "matrix_antigen.csv", package="protGear")) #VSN normlise_vsn <- matrix_normalise(as.matrix(matrix_antigen), method = "vsn", return_plot = TRUE ) ## log normlise_log <- matrix_normalise(as.matrix(matrix_antigen), method = "log2", return_plot = TRUE ) ## cyclic_loess_log normlise_cylic_log <- matrix_normalise(as.matrix(matrix_antigen), method = "cyclic_loess_log", return_plot = TRUE )
matrix_antigen <- readr::read_csv(system.file("extdata", "matrix_antigen.csv", package="protGear")) #VSN normlise_vsn <- matrix_normalise(as.matrix(matrix_antigen), method = "vsn", return_plot = TRUE ) ## log normlise_log <- matrix_normalise(as.matrix(matrix_antigen), method = "log2", return_plot = TRUE ) ## cyclic_loess_log normlise_cylic_log <- matrix_normalise(as.matrix(matrix_antigen), method = "cyclic_loess_log", return_plot = TRUE )
A generic function that merges the protein data with the sample identifiers or sample names. If the file does not have sample identifiers the function generates it automatically.
merge_sampleID(iden, data_files, genepix_vars, method)
merge_sampleID(iden, data_files, genepix_vars, method)
iden |
A character indicating the name of the object to be used under data_files. |
data_files |
A list of data objects with names utilised by iden. |
genepix_vars |
A list of specific definitions of the experiment design.
See |
method |
A description of the background correction to be used.
See |
a data frame merged with corresponding sample ID's. The sample ID are specified in the sample ID files
## Not run: ### Define the genepix_vars genepix_vars <- array_vars( channel = "635", chip_path = system.file("extdata", "array_data/machine1/", package="protGear"), totsamples = 21, blockspersample = 2, mig_prefix = "_first", machine = 1, ## optional date_process = "0520" ) ## the path where the micro-array data is located data_path <- paste0(genepix_vars$chip_path) filenames <- list.files(genepix_vars$chip_path, pattern = "*.txt$|*.gpr$", full.names = FALSE ) ## create a list of all the files data_files <- purrr::map( .x = filenames, .f = read_array_files, data_path = data_path, genepix_vars = genepix_vars ) data_files <- purrr::set_names(data_files, purrr::map(filenames, name_of_files)) ## merge the lab data with samples and perform bg correction merge_sampleID(iden = "KK2-06", data_files = data_files, genepix_vars =genepix_vars,method = "subtract_global" ) ## End(Not run)
## Not run: ### Define the genepix_vars genepix_vars <- array_vars( channel = "635", chip_path = system.file("extdata", "array_data/machine1/", package="protGear"), totsamples = 21, blockspersample = 2, mig_prefix = "_first", machine = 1, ## optional date_process = "0520" ) ## the path where the micro-array data is located data_path <- paste0(genepix_vars$chip_path) filenames <- list.files(genepix_vars$chip_path, pattern = "*.txt$|*.gpr$", full.names = FALSE ) ## create a list of all the files data_files <- purrr::map( .x = filenames, .f = read_array_files, data_path = data_path, genepix_vars = genepix_vars ) data_files <- purrr::set_names(data_files, purrr::map(filenames, name_of_files)) ## merge the lab data with samples and perform bg correction merge_sampleID(iden = "KK2-06", data_files = data_files, genepix_vars =genepix_vars,method = "subtract_global" ) ## End(Not run)
Get the minimum positive value
minpositive(x)
minpositive(x)
x |
A numeric vector or variable |
Returns the minimum positive value in an object
minpositive(c(-1,-2,3,5,6,7,8,9,10))
minpositive(c(-1,-2,3,5,6,7,8,9,10))
A generic function returning a vector with the names of files in the same directory. Removes the file extension
name_of_files(i)
name_of_files(i)
i |
- a list filenames with .txt or .gpr extension |
a list of file names
name
name_of_files("KK2-06.txt")
name_of_files("KK2-06.txt")
Trend test using Cox–Stuart (C–S) and Mann–Kendall (M–K) trend tests
output_trend_stats(name, p_val, z_val)
output_trend_stats(name, p_val, z_val)
name |
Name of the test |
p_val |
p value from the test |
z_val |
the Z value of the test |
A statistics of mean standard deviation trend
output_trend_stats(name="t.test",p_val=0.001, z_val=5)
output_trend_stats(name="t.test",p_val=0.001, z_val=5)
A generic function for plotting of R objects.
plot_bg(df, x_axis = "antigen", bg_MFI = "BG_Median", log_mfi = TRUE)
plot_bg(df, x_axis = "antigen", bg_MFI = "BG_Median", log_mfi = TRUE)
df |
A default dataset to use for plot. |
x_axis |
The variable on the x axis |
bg_MFI |
A numeric |
log_mfi |
a logical value indicating whether the MFI values should be log transformed or not. |
A ggplot of background values
## Not run: #After extracting the background using \code{\link{extract_bg}} #we plot the data using allData_bg <- readr::read_csv(system.file("extdata", "bg_example.csv", package="protGear")) plot_bg(allData_bg, x_axis = "antigen", bg_MFI = "BG_Median", log_mfi = TRUE ) ## End(Not run)
## Not run: #After extracting the background using \code{\link{extract_bg}} #we plot the data using allData_bg <- readr::read_csv(system.file("extdata", "bg_example.csv", package="protGear")) plot_bg(allData_bg, x_axis = "antigen", bg_MFI = "BG_Median", log_mfi = TRUE ) ## End(Not run)
Plot the buffer values
plot_buffer( df = buffers, buffer_names = "antigen", buffer_mfi = "FMedianBG_correct", slide_id = ".id" )
plot_buffer( df = buffers, buffer_names = "antigen", buffer_mfi = "FMedianBG_correct", slide_id = ".id" )
df |
A data frame to be used to plot |
buffer_names |
A character string containing the name of the variable with buffer spots. Default set to 'antigen'. |
buffer_mfi |
A character string containing the name of the variable with MFI value.Assuming background correction is done already. Default to 'FMedianBG_correct' |
slide_id |
A character string containing the name of the slide/array identifier variable. |
plot of buffer spots
buffers <- readr::read_csv(system.file("extdata", "buffers_sample2.csv", package="protGear")) plot_buffer(df=buffers,buffer_names = "sampleID")
buffers <- readr::read_csv(system.file("extdata", "buffers_sample2.csv", package="protGear")) plot_buffer(df=buffers,buffer_names = "sampleID")
A generic function for plotting the background and foreground values.
plot_FB( df, antigen_name = "antigen", bg_MFI = "BG_Median", FG_MFI = "FBG_Median", log_mfi = FALSE )
plot_FB( df, antigen_name = "antigen", bg_MFI = "BG_Median", FG_MFI = "FBG_Median", log_mfi = FALSE )
df |
An object containing the data to which the plot is done. |
antigen_name |
The |
bg_MFI |
A numeric |
FG_MFI |
A numeric |
log_mfi |
a logical value indicating whether the MFI values should be log transformed or not. |
Plot foreground and background values
a ggplot of foreground vs background MFI values
## Not run: #After extracting the background using \code{\link{extract_bg}} #we plot the data using allData_bg <- readr::read_csv(system.file("extdata", "bg_example.csv", package="protGear")) plot_FB(allData_bg, antigen_name = "antigen", bg_MFI = "BG_Median", FG_MFI = "FBG_Median", log = FALSE ) ## End(Not run)
## Not run: #After extracting the background using \code{\link{extract_bg}} #we plot the data using allData_bg <- readr::read_csv(system.file("extdata", "bg_example.csv", package="protGear")) plot_FB(allData_bg, antigen_name = "antigen", bg_MFI = "BG_Median", FG_MFI = "FBG_Median", log = FALSE ) ## End(Not run)
Comparison of normalised data by sample
plot_normalised(exprs_normalised_df, method, batch_correct)
plot_normalised(exprs_normalised_df, method, batch_correct)
exprs_normalised_df |
a normalised data frame |
method |
the method of normalisation used |
batch_correct |
the batch correction |
A ggplot of normalised data
matrix_antigen <- readr::read_csv(system.file("extdata", "matrix_antigen.csv", package="protGear")) normlise_vsn <- matrix_normalise(as.matrix(matrix_antigen), method = "vsn", return_plot = FALSE ) plot_normalised(normlise_vsn,method="vsn",batch_correct=FALSE)
matrix_antigen <- readr::read_csv(system.file("extdata", "matrix_antigen.csv", package="protGear")) normlise_vsn <- matrix_normalise(as.matrix(matrix_antigen), method = "vsn", return_plot = FALSE ) plot_normalised(normlise_vsn,method="vsn",batch_correct=FALSE)
Comparison of normalised data by feature
plot_normalised_antigen(exprs_normalised_df, method, batch_correct)
plot_normalised_antigen(exprs_normalised_df, method, batch_correct)
exprs_normalised_df |
a normalised data frame |
method |
the method of normalisation used |
batch_correct |
the batch correction |
A ggplot of various normalisation approaches
matrix_antigen <- readr::read_csv(system.file("extdata", "matrix_antigen.csv", package="protGear")) normlise_vsn <- matrix_normalise(as.matrix(matrix_antigen), method = "vsn", return_plot = FALSE ) plot_normalised_antigen(normlise_vsn,method="vsn",batch_correct=FALSE)
matrix_antigen <- readr::read_csv(system.file("extdata", "matrix_antigen.csv", package="protGear")) normlise_vsn <- matrix_normalise(as.matrix(matrix_antigen), method = "vsn", return_plot = FALSE ) plot_normalised_antigen(normlise_vsn,method="vsn",batch_correct=FALSE)
This helps to read the chip file(s).
read_array_files(i, data_path, genepix_vars)
read_array_files(i, data_path, genepix_vars)
i |
The name of the file which the data are to be read from. |
data_path |
The path where the file with the data is located |
genepix_vars |
A list of specific definitions of the experiment design.
See |
Read multiple array files
a number of data frames in the global environment
## Not run: genepix_vars <- array_vars( channel = "635", chip_path = system.file("extdata", "array_data/machine1/", package="protGear"), totsamples = 21, blockspersample = 2, mig_prefix = "_first", machine = 1, date_process = "0520" ) file_read <- "KK2-06.txt" read_array_files(i=file_read, data_path=system.file("extdata", "array_data/machine1/", package="protGear"), genepix_vars=genepix_vars) ## End(Not run)
## Not run: genepix_vars <- array_vars( channel = "635", chip_path = system.file("extdata", "array_data/machine1/", package="protGear"), totsamples = 21, blockspersample = 2, mig_prefix = "_first", machine = 1, date_process = "0520" ) file_read <- "KK2-06.txt" read_array_files(i=file_read, data_path=system.file("extdata", "array_data/machine1/", package="protGear"), genepix_vars=genepix_vars) ## End(Not run)
Read a gpr file to visualize
read_array_visualize(infile)
read_array_visualize(infile)
infile |
a .gpr file to be used to visualize the expression intensities of the slide spots |
a data frame to visualize the background or foreground values
## Not run: read_array_visualize(infile = system.file("extdata", "/array_data/machine1/KK2-06.txt", package="protGear")) ## End(Not run)
## Not run: read_array_visualize(infile = system.file("extdata", "/array_data/machine1/KK2-06.txt", package="protGear")) ## End(Not run)
A function for method='rlm'
from
matrix_normalise
.
rlm_normalise_matrix(matrix_antigen, array_matrix, control_antigens)
rlm_normalise_matrix(matrix_antigen, array_matrix, control_antigens)
matrix_antigen |
A matrix with antigen data |
array_matrix |
A matrix with control antigen data |
control_antigens |
the control antigens for RLM normalisation |
A RLM normalised data frame
matrix_antigen <- readr::read_csv(system.file("extdata", "matrix_antigen.csv", package="protGear")) # rlm_normalise_matrix(matrix_antigen=matrix_antigen, #array_matrix=array_matrix, # control_antigens=control_antigens)
matrix_antigen <- readr::read_csv(system.file("extdata", "matrix_antigen.csv", package="protGear")) # rlm_normalise_matrix(matrix_antigen=matrix_antigen, #array_matrix=array_matrix, # control_antigens=control_antigens)
\\_End_Function_\\ #
tag_subtract( dataC_mfi, tag_antigens, mean_best_CV_var, tag_file, batch_vars, sampleID_var = "sampleID", antigen_var = "antigen" )
tag_subtract( dataC_mfi, tag_antigens, mean_best_CV_var, tag_file, batch_vars, sampleID_var = "sampleID", antigen_var = "antigen" )
dataC_mfi |
A dataframe |
tag_antigens |
A character vector with the names of proteins or antigens used as TAG. |
mean_best_CV_var |
A character string containing the identifier of the variable with the MFI values. |
tag_file |
A data frame with variables |
batch_vars |
A list of characters identifying variables in dataC_mfi for indicating batch. |
sampleID_var |
A character string containing the name of the sample identifier variable. Default set to 'sampleID' |
antigen_var |
A character string containing the name of the features/protein variable. Default to 'antigen' |
Subtract the purification TAG data
A data frame of TAG values subtracted
tag_file <- readr::read_csv(system.file("extdata", "TAG_antigens.csv", package="protGear")) tag_antigens <- c("CD4TAG", "GST", "MBP") batch_vars <- list(machine = "m1", day = "0520") dataC <- readr::read_csv(system.file("extdata", "dataC.csv", package="protGear")) ## this file has 3 lab replicates and the default names dataCV <- cv_estimation(dataC ,lab_replicates=3) dataCV_best2 <- best_CV_estimation(dataCV,slide_id = "iden", lab_replicates = 3, cv_cut_off = 20) tag_subtract(dataCV_best2,tag_antigens=tag_antigens, mean_best_CV_var="mean_best_CV", tag_file = tag_file,antigen_var = "antigen", batch_vars = batch_vars)
tag_file <- readr::read_csv(system.file("extdata", "TAG_antigens.csv", package="protGear")) tag_antigens <- c("CD4TAG", "GST", "MBP") batch_vars <- list(machine = "m1", day = "0520") dataC <- readr::read_csv(system.file("extdata", "dataC.csv", package="protGear")) ## this file has 3 lab replicates and the default names dataCV <- cv_estimation(dataC ,lab_replicates=3) dataCV_best2 <- best_CV_estimation(dataCV,slide_id = "iden", lab_replicates = 3, cv_cut_off = 20) tag_subtract(dataCV_best2,tag_antigens=tag_antigens, mean_best_CV_var="mean_best_CV", tag_file = tag_file,antigen_var = "antigen", batch_vars = batch_vars)
Visualize the slide mimicking the original scan image.
visualize_slide(infile, MFI_var, interactive = FALSE, d_f = NA)
visualize_slide(infile, MFI_var, interactive = FALSE, d_f = NA)
infile |
a .gpr file to be used to visualize the expression intensities of the slide spots |
MFI_var |
the MFI variable to plot, can be either the background or foreground value |
interactive |
a logical to specify whether an interactive graph is returned or not |
d_f |
a data frame with array data |
A ggplot of slide foreground values
## Not run: visualize_slide( infile = system.file("extdata", "/array_data/machine1/KK2-06.txt", package="protGear"), MFI_var = "B635 Median" ) ## End(Not run)
## Not run: visualize_slide( infile = system.file("extdata", "/array_data/machine1/KK2-06.txt", package="protGear"), MFI_var = "B635 Median" ) ## End(Not run)
Visualize the slide mimicking the original scan image using a 2d plot.
visualize_slide_2d(infile, MFI_var, d_f = NA)
visualize_slide_2d(infile, MFI_var, d_f = NA)
infile |
- a .gpr file to be used to visualize the expression intensities of the slide spots |
MFI_var |
the MFI variable to plot, can be either the background or foreground value |
d_f |
a data frame with array data |
A 2d plot of either the background or foreground values
## Not run: visualize_slide_2d( infile = system.file("extdata", "/array_data/machine1/KK2-06.txt", package="protGear"), MFI_var = "B635 Median" ) ## End(Not run)
## Not run: visualize_slide_2d( infile = system.file("extdata", "/array_data/machine1/KK2-06.txt", package="protGear"), MFI_var = "B635 Median" ) ## End(Not run)