LFQData | R Documentation |
LFQData R6 class
LFQData R6 class
config
AnalysisConfiguration
data
data.frame or tibble matching AnalysisConfiguration.
is_pep
todo
prefix
e.g. "peptide_", "protein_", "compound_"
new()
initialize
LFQData$new(data, config, is_pep = TRUE, prefix = "ms_", setup = FALSE)
data
data.frame
config
configuration
is_pep
todo
prefix
will be use as output prefix
setup
is data setup needed, default = FALSE, if TRUE, calls setup_analysis
on data first.
get_copy()
get deep copy
LFQData$get_copy()
get_sample()
samples subset of data
LFQData$get_sample(size = 100, seed = NULL)
size
size of subset default 100
seed
set seed
get_subset()
get subset of data
LFQData$get_subset(x)
x
data frame with columns containing subject_Id
subject_Id()
get subject ID columns
LFQData$subject_Id()
is_transformed()
is data transformed
LFQData$is_transformed(is_transformed)
is_transformed
logical
logical
remove_small_intensities()
some software is reporting NA's as 0, you must remove it from your data
LFQData$remove_small_intensities(threshold = 4)
threshold
default 4.
self
filter_proteins_by_peptide_count()
remove proteins with less than X peptides
LFQData$filter_proteins_by_peptide_count()
self
omit_NA()
Omit NA from intensities per hierarchy (e.g. protein or peptide), idea is to use it for normalization For instance if a peptide has a missing value in more then nrNA of the samples within a condition it will be removed
LFQData$omit_NA(nrNA = 0, factorDepth = NULL)
nrNA
number of NA values
factorDepth
you control for nrNA per condition or experiment etc. e.g. factorDepth = 0 then per experiment
LFQData with NA omitted.
complete_cases()
some software is reporting NA's as 0, you must remove it from your data
LFQData$complete_cases()
threshold
default 4.
self
to_wide()
converts the data to wide
LFQData$to_wide(as.matrix = FALSE, value = c("response", "nr_children"))
as.matrix
return as data.frame or matrix
value
either response or nr chidren
list with data, annotation, and configuration
factors()
Annotation table
LFQData$factors()
data.frame
hierarchy()
Hierarchy table
LFQData$hierarchy()
response()
name of response variable
LFQData$response()
data.frame
rename_response()
new name of response variable
LFQData$rename_response(newname = "Intensity")
newname
default Intensity
hierarchy_counts()
number of elements at each level
LFQData$hierarchy_counts()
summarize_hierarchy()
e.g. number of peptides per protein etc
LFQData$summarize_hierarchy()
data.frame
get_Plotter()
get Plotter
LFQData$get_Plotter()
LFQDataPlotter
get_Writer()
get Writer
LFQData$get_Writer(format = "xlsx")
format
array of formats to write to supported are xlsx, csv and html
LFQDataPlotter
get_Summariser()
get Summariser
LFQData$get_Summariser()
LFQDataSummarizer
get_Stats()
Get LFQDataStats
. For more details see LFQDataStats
.
LFQData$get_Stats(stats = c("everything", "interaction", "all"))
stats
default interaction, computes statistics within interaction.
LFQDataStats
get_Transformer()
get Stats
LFQData$get_Transformer()
LFQDataTransformer
get_Aggregator()
get Aggregator
LFQData$get_Aggregator()
LFQDataAggregator
filter_difference()
get difference of self with other if other is subset of self
LFQData$filter_difference(other)
other
a filtered LFQData set
Use to compare filtering results obtained from self, e.g. which proteins and peptides were removed (other)
LFQData
clone()
The objects of this class are cloneable with this method.
LFQData$clone(deep = FALSE)
deep
Whether to make a deep clone.
Other LFQData:
LFQDataAggregator
,
LFQDataPlotter
,
LFQDataStats
,
LFQDataSummariser
,
LFQDataToSummarizedExperiment()
,
LFQDataWriter
istar <- sim_lfq_data_peptide_config()
#LFQData$debug("omit_NA")
lfqdata <- LFQData$new(istar$data, istar$config)
lfqdata$filter_proteins_by_peptide_count()
tmp <- lfqdata$to_wide()
testthat::expect_equal(nrow(tmp$data) , nrow(tmp$rowdata))
testthat::expect_equal(ncol(tmp$data) , nrow(tmp$annotation) + ncol(tmp$rowdata))
stopifnot("data.frame" %in% class(tmp$data))
tmp <- lfqdata$to_wide(as.matrix = TRUE)
stopifnot("matrix" %in% class(tmp$data))
stopifnot(lfqdata$is_transformed()==FALSE)
lfqdata$summarize_hierarchy()
# filter for missing values
f1 <- lfqdata$omit_NA(nrNA = 0)
stopifnot(f1$hierarchy_counts() <= lfqdata$hierarchy_counts())
f2 <- lfqdata$omit_NA(factorDepth = 0)
stopifnot(f2$hierarchy_counts() <= lfqdata$hierarchy_counts())
lfqdata$response()
lfqdata$rename_response("peptide.intensity")
lfqdata$response()
stopifnot("LFQData" %in% class(lfqdata$get_copy()))
stopifnot("LFQDataTransformer" %in% class(lfqdata$get_Transformer()))
stopifnot("LFQDataStats" %in% class(lfqdata$get_Stats()))
stopifnot("LFQDataSummariser" %in% class(lfqdata$get_Summariser()))
stopifnot("LFQDataPlotter" %in% class(lfqdata$get_Plotter()))
stopifnot("LFQDataWriter" %in% class(lfqdata$get_Writer()))
stopifnot("LFQDataAggregator" %in% class(lfqdata$get_Aggregator()))
lfqdata2 <- lfqdata$get_copy()
lfqdata2$data <- lfqdata2$data[1:100,]
res <- lfqdata$filter_difference(lfqdata2)
stopifnot(nrow(res$data) == nrow(lfqdata$data) - 100)
tmp <- lfqdata$get_sample(5, seed = 4)
stopifnot(nrow(tmp$hierarchy()) == 5)
lw <- lfqdata$get_Writer()
stopifnot(names(lw$get_wide()) %in% c("data", "annotation"))
stopifnot("data.frame" %in% class(lw$get_long()))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.