Skip to content
Open
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
5 changes: 4 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Imports:
QFeatures,
readr,
rlang,
rmzTabM,
S4Vectors,
scales,
shiny,
Expand All @@ -64,6 +65,8 @@ Imports:
tools,
utils,
xcms
Remotes:
NorStorz/rmzTabM
Suggests:
caret,
FactoMineR,
Expand All @@ -77,4 +80,4 @@ VignetteBuilder:
biocViews: Software, Visualization
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
RoxygenNote: 7.3.3
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export(process_msp_entry)
export(projectFromFiles)
export(readMSDial)
export(readMetaboscape)
export(readMzTabM)
export(readProjectData)
export(readProjectFile)
export(runMetFamily)
Expand Down
22 changes: 20 additions & 2 deletions R/FragmentMatrixFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -1019,13 +1019,15 @@ mzClustGeneric <- function(p,
#' @param fileSpectra path
#' @param parameterSet list of parameters
#' @param progress logical
#' @param fileType optional file type/extension (e.g., "mztab", "txt") to explicitly specify format
#'
#' @returns resultObj
#' @export
convertToProjectFile <- function(filePeakMatrixPath,
fileSpectra,
parameterSet,
progress = FALSE){
progress = FALSE,
fileType = NULL){
## parse MS/MS spectra ----

if(!is.na(progress)) if(progress) incProgress(amount = 0.01, detail = paste("Parsing MS/MS file...", sep = "")) else print(paste("Parsing MS/MS file...", sep = ""))
Expand Down Expand Up @@ -1063,7 +1065,23 @@ convertToProjectFile <- function(filePeakMatrixPath,
rm(returnObj)

filePeakMatrixQF <- if(!is.null(filePeakMatrixPath)){
readMSDial(filePeakMatrixPath)
# Determine file type: use parameter if provided, default to MS-DIAL format
if(!is.null(fileType)) {
fileExtension <- tolower(fileType)
print(paste("Using provided fileType:", fileExtension))
} else {
fileExtension <- "other"
print("Defaulting to MS-DIAL format")
}

# Call appropriate reader
if(fileExtension == "mztab") {
print("Using readMzTabM()")
readMzTabM(filePeakMatrixPath)
} else {
print("Using readMSDial()")
readMSDial(filePeakMatrixPath)
}
} else {
NULL
}
Expand Down
1 change: 0 additions & 1 deletion R/R_packages.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ load_metfamily_dependencies <- function() {
library("FactoMineR")
library("mixOmics")
library("pcaMethods")
library(searchable)
library(gdata)
##############################################################################################################
## tools
Expand Down
4 changes: 2 additions & 2 deletions R/readMSDial.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#'
#' @examples
#' \dontrun{
#' # Assuming you have an MS-DIAL output file named
#' "Metabolite_profile_showcase.txt" in a "data" directory:
#' # Assuming you have an MS-DIAL output file named
#' # "Metabolite_profile_showcase.txt" in a "data" directory:
#' qf <- readMSDial("data/Metabolite_profile_showcase.txt")
#'
#' # Examine the structure of the resulting QFeatures object
Expand Down
Loading