Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ importFrom(MSstats,dataProcess)
importFrom(MSstats,groupComparison)
importFrom(MSstatsConvert,MSstatsClean)
importFrom(MSstatsConvert,MSstatsImport)
importFrom(MSstatsConvert,MSstatsMakeAnnotation)
importFrom(utils,head)
importFrom(utils,sessionInfo)
22 changes: 19 additions & 3 deletions R/clean_DIANN.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#' @param global_qvalue_cutoff Global Q-value cutoff
#' @param qvalue_cutoff Q-value cutoff
#' @param pg_qvalue_cutoff Protein group Q-value cutoff
#' @param calculateAnomalyScores Boolean for MSstats+ Model
#' @param anomalyModelFeatures Character vector of features to use for MSstats+ Model
#' @param annotation Annotation file or data frame
#' @return NULL. Writes to file.
#' @keywords internal
Expand All @@ -15,6 +17,8 @@ reduceBigDIANN <- function(input_file, output_path, MBR = TRUE,
global_qvalue_cutoff = 0.01,
qvalue_cutoff = 0.01,
pg_qvalue_cutoff = 0.01,
calculateAnomalyScores=FALSE,
anomalyModelFeatures=c(),
annotation = NULL) {
if (grepl("csv", input_file)) {
delim = ","
Expand All @@ -24,8 +28,14 @@ reduceBigDIANN <- function(input_file, output_path, MBR = TRUE,
delim <- ";"
}

diann_chunk <- function(x, pos) cleanDIANNChunk(x, output_path, MBR, quantificationColumn, pos,
global_qvalue_cutoff, qvalue_cutoff, pg_qvalue_cutoff, annotation)
diann_chunk <- function(x, pos) cleanDIANNChunk(x, output_path, MBR,
quantificationColumn, pos,
global_qvalue_cutoff,
qvalue_cutoff,
pg_qvalue_cutoff,
calculateAnomalyScores,
anomalyModelFeatures,
annotation)

readr::read_delim_chunked(input_file,
readr::DataFrameCallback$new(diann_chunk),
Expand All @@ -43,6 +53,8 @@ reduceBigDIANN <- function(input_file, output_path, MBR = TRUE,
#' @param global_qvalue_cutoff Global Q-value cutoff
#' @param qvalue_cutoff Q-value cutoff
#' @param pg_qvalue_cutoff Protein group Q-value cutoff
#' @param calculateAnomalyScores Boolean for MSstats+ Model
#' @param anomalyModelFeatures Character vector of features to use for MSstats+ Model
#' @param annotation Annotation file or data frame
#' @importFrom MSstatsConvert MSstatsImport MSstatsClean MSstatsMakeAnnotation
#' @return NULL
Expand All @@ -51,6 +63,8 @@ cleanDIANNChunk = function(input, output_path, MBR, quantificationColumn, pos,
global_qvalue_cutoff = 0.01,
qvalue_cutoff = 0.01,
pg_qvalue_cutoff = 0.01,
calculateAnomalyScores=FALSE,
anomalyModelFeatures = c(),
annotation = NULL) {
input = MSstatsImport(list(input = input),
"MSstats", "DIANN")
Expand All @@ -60,7 +74,9 @@ cleanDIANNChunk = function(input, output_path, MBR, quantificationColumn, pos,
quantificationColumn = quantificationColumn,
global_qvalue_cutoff = global_qvalue_cutoff,
qvalue_cutoff = qvalue_cutoff,
pg_qvalue_cutoff = pg_qvalue_cutoff
pg_qvalue_cutoff = pg_qvalue_cutoff,
calculateAnomalyScores = calculateAnomalyScores,
anomalyModelFeatures = anomalyModelFeatures
)
input = MSstatsMakeAnnotation(input, annotation)
.writeChunkToFile(input, output_path, pos)
Expand Down
4 changes: 3 additions & 1 deletion R/converters.R
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ bigDIANNtoMSstatsFormat <- function(input_file,
paste0("reduce_output_", output_file_name),
MBR,
quantificationColumn,
global_qvalue_cutoff, qvalue_cutoff, pg_qvalue_cutoff, annotation)
global_qvalue_cutoff, qvalue_cutoff, pg_qvalue_cutoff,
calculateAnomalyScores, anomalyModelFeatures,
annotation)

# Preprocess the cleaned data (feature selection, etc.)
msstats_data <- MSstatsPreprocessBig(
Expand Down
3 changes: 3 additions & 0 deletions man/bigDIANNtoMSstatsFormat.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion man/cleanDIANNChunk.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion man/reduceBigDIANN.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.