Skip to content

Commit

Permalink
refactor(converters): Load MSstatsConvert converters when calling lib…
Browse files Browse the repository at this point in the history
…rary(MSstats) (#146)

* refactor(converters): Load MSstatsConvert converters when calling library(MSstats)

* refactor(converters): Reexport converters to MSstats namespace
  • Loading branch information
tonywu1999 authored Jan 9, 2025
1 parent a1760a1 commit 6df52e6
Show file tree
Hide file tree
Showing 17 changed files with 104 additions and 1,708 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
.DS_Store
*.log
*.txt
.codiumai
.idea

10 changes: 10 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,22 @@ import(ggplot2)
import(limma)
import(lme4)
importFrom(MASS,rlm)
importFrom(MSstatsConvert,DIANNtoMSstatsFormat)
importFrom(MSstatsConvert,DIAUmpiretoMSstatsFormat)
importFrom(MSstatsConvert,FragPipetoMSstatsFormat)
importFrom(MSstatsConvert,MSstatsBalancedDesign)
importFrom(MSstatsConvert,MSstatsClean)
importFrom(MSstatsConvert,MSstatsImport)
importFrom(MSstatsConvert,MSstatsLogsSettings)
importFrom(MSstatsConvert,MSstatsMakeAnnotation)
importFrom(MSstatsConvert,MSstatsPreprocess)
importFrom(MSstatsConvert,MaxQtoMSstatsFormat)
importFrom(MSstatsConvert,OpenMStoMSstatsFormat)
importFrom(MSstatsConvert,OpenSWATHtoMSstatsFormat)
importFrom(MSstatsConvert,PDtoMSstatsFormat)
importFrom(MSstatsConvert,ProgenesistoMSstatsFormat)
importFrom(MSstatsConvert,SkylinetoMSstatsFormat)
importFrom(MSstatsConvert,SpectronauttoMSstatsFormat)
importFrom(Rcpp,sourceCpp)
importFrom(data.table,as.data.table)
importFrom(data.table,melt)
Expand Down
954 changes: 22 additions & 932 deletions R/converters.R

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions R/utils_documentation.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#' A dummy function to store shared documentation items.
#'
#' @import data.table
#' @importFrom MSstatsConvert MSstatsImport MSstatsClean MSstatsPreprocess
#' MSstatsBalancedDesign MSstatsMakeAnnotation MSstatsLogsSettings
#'
#' @param removeFewMeasurements TRUE (default) will remove the features that have 1 or 2 measurements across runs.
#' @param useUniquePeptide TRUE (default) removes peptides that are assigned for more than one proteins.
#' We assume to use unique peptide for each protein.
#' @param summaryforMultipleRows max(default) or sum - when there are multiple measurements for certain feature and certain run, use highest or sum of multiple intensities.
#' @param removeProtein_with1Feature TRUE will remove the proteins which have only 1 feature, which is the combination of peptide, precursor charge, fragment and charge. FALSE is default.
#' @param removeProtein_with1Peptide TRUE will remove the proteins which have only 1 peptide and charge. FALSE is default.
#' @param removeOxidationMpeptides TRUE will remove the peptides including 'oxidation (M)' in modification. FALSE is default.
#' @param removeMpeptides TRUE will remove the peptides including 'M' sequence. FALSE is default.
#' @param use_log_file logical. If TRUE, information about data processing
#' will be saved to a file.
#' @param append logical. If TRUE, information about data processing will be added
#' to an existing log file.
#' @param verbose logical. If TRUE, information about data processing wil be printed
#' to the console.
#' @param log_file_path character. Path to a file to which information about
#' data processing will be saved.
#' If not provided, such a file will be created automatically.
#' If `append = TRUE`, has to be a valid path to a file.
#'
#' @keywords internal
#'
.documentFunction = function() {
NULL
}
14 changes: 14 additions & 0 deletions R/utils_onAttach.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#' Load core packages when loading MSstats
#' @noRd
#' @keywords internal
.onAttach = function(libname, pkgname) {
# Load core packages dynamically
to_load <- c("MSstatsConvert")

# Attach them quietly
if (length(to_load) > 0) {
lapply(to_load, function(pkg) {
suppressPackageStartupMessages(library(pkg, character.only = TRUE))
})
}
}
79 changes: 0 additions & 79 deletions man/DIANNtoMSstatsFormat.Rd

This file was deleted.

88 changes: 0 additions & 88 deletions man/DIAUmpiretoMSstatsFormat.Rd

This file was deleted.

64 changes: 0 additions & 64 deletions man/FragPipetoMSstatsFormat.Rd

This file was deleted.

85 changes: 0 additions & 85 deletions man/MaxQtoMSstatsFormat.Rd

This file was deleted.

Loading

0 comments on commit 6df52e6

Please sign in to comment.