diff --git a/R/align_dia_runs.R b/R/align_dia_runs.R index e9ca2758..06b50e97 100644 --- a/R/align_dia_runs.R +++ b/R/align_dia_runs.R @@ -1,6 +1,6 @@ #' Outputs intensities for each analyte from aligned Targeted-MS runs #' -#' This function expects osw and mzml directories at dataPath. It first reads osw files and fetches chromatogram indices for each analyte. +#' This function expects osw and xics directories at dataPath. It first reads osw files and fetches chromatogram indices for each analyte. #' It then align XICs of its reference XICs. Best peak, which has lowest m-score, about the aligned retention time is picked for quantification. #' @author Shubham Gupta, \email{shubh.gupta@mail.utoronto.ca} #' @@ -10,10 +10,10 @@ #' Date: 2019-12-14 #' @importFrom dplyr %>% #' @inheritParams checkParams -#' @param dataPath (string) path to mzml and osw directory. +#' @param dataPath (string) path to xics and osw directory. #' @param outFile (string) name of the output file. #' @param oswMerged (logical) TRUE for experiment-wide FDR and FALSE for run-specific FDR by pyprophet. -#' @param runs (a vector of string) names of mzml file without extension. +#' @param runs (a vector of string) names of xics file without extension. #' @param refRun (string) reference for alignment. If no run is provided, m-score is used to select reference run. #' @param applyFun (function) value must be either lapply or BiocParallel::bplapply. #' @return An output table with following columns: precursor, run, intensity, RT, leftWidth, rightWidth, @@ -173,7 +173,7 @@ alignTargetedRuns <- function(dataPath, outFile = "DIAlignR", params = paramsDIA #' AlignObj for analytes between a pair of runs #' -#' This function expects osw and mzml directories at dataPath. It first reads osw files and fetches chromatogram indices for each requested analyte. +#' This function expects osw and xics directories at dataPath. It first reads osw files and fetches chromatogram indices for each requested analyte. #' It then align XICs of each analyte to its reference XICs. AlignObj is returned which contains aligned indices and cumulative score along the alignment path. #' @author Shubham Gupta, \email{shubh.gupta@mail.utoronto.ca} #' diff --git a/R/get_filenames.R b/R/get_filenames.R index 52b132e5..1471b796 100644 --- a/R/get_filenames.R +++ b/R/get_filenames.R @@ -6,7 +6,7 @@ #' #' License: (c) Author (2019) + GPL-3 #' Date: 2019-12-14 -#' @param dataPath (char) path to mzml and osw directory. +#' @param dataPath (char) path to xics and osw directory. #' @param pattern (char) must be either *.osw or *merged.osw . #' @return A dataframe with three columns: #' \item{spectraFile}{(string) as mentioned in RUN table of osw files.} @@ -68,7 +68,7 @@ filenamesFromOSW <- function(dataPath, pattern){ #' #' License: (c) Author (2019) + GPL-3 #' Date: 2019-12-14 -#' @param dataPath (char) Path to mzml and osw directory. +#' @param dataPath (char) Path to xics and osw directory. #' @return A dataframe with two columns: #' \item{runName}{(string) contain respective mzML names without extension.} #' \item{chromatogramFile}{(string) Path to the chromatogram file.} @@ -81,10 +81,10 @@ filenamesFromOSW <- function(dataPath, pattern){ filenamesFromMZML <- function(dataPath, chromFile){ if(chromFile == "mzML") p <- ".chrom.mzML$" if(chromFile == "sqMass") p <- ".chrom.sqMass$" - temp <- list.files(path = file.path(dataPath, "mzml"), pattern=p) + temp <- list.files(path = file.path(dataPath, "xics"), pattern=p) message(length(temp), " ", sub("\\$","",p), " files are found.") mzMLfiles <- vapply(temp, function(x) sub(p,"", x), "", USE.NAMES = FALSE) - output <- data.frame("runName" = mzMLfiles, "chromatogramFile" = file.path(dataPath, "mzml", temp)) + output <- data.frame("runName" = mzMLfiles, "chromatogramFile" = file.path(dataPath, "xics", temp)) output[["chromatogramFile"]] <- as.character(output[["chromatogramFile"]]) # Convert from factor to character. output[["runName"]] <- as.character(output[["runName"]]) # Convert from factor to character. output @@ -102,7 +102,7 @@ filenamesFromMZML <- function(dataPath, chromFile){ #' License: (c) Author (2019) + GPL-3 #' Date: 2019-12-14 #' @inheritParams checkParams -#' @param dataPath (char) Path to mzml and osw directory. +#' @param dataPath (char) Path to xics and osw directory. #' @param oswMerged (logical) TRUE for experiment-wide FDR and FALSE for run-specific FDR by pyprophet. #' @return (dataframe) it has five columns: #' \item{spectraFile}{(string) as mentioned in RUN table of osw files.} @@ -121,7 +121,7 @@ getRunNames <- function(dataPath, oswMerged = TRUE, params = paramsDIAlignR()){ } else{ filenames <- filenamesFromOSW(dataPath, pattern = "*merged.osw$") } - # Get names of mzml files. + # Get names of xics files. nameCutPattern = "(.*)(/)(.*)" # regex expression to fetch mzML file name from RUN.FILENAME columns of osw files. runs <- vapply(filenames[["spectraFile"]], function(x) gsub(nameCutPattern, replacement = "\\3", x), "") fileExtn <- strsplit(runs[[1]], "\\.")[[1]][2] @@ -132,7 +132,7 @@ getRunNames <- function(dataPath, oswMerged = TRUE, params = paramsDIAlignR()){ # Check if osw files have corresponding mzML file. runs <- intersect(filenames[["runName"]], mzMLfiles[["runName"]]) if(length(runs) != length(filenames[["runName"]])){ - cat("Following files did not have their counterpart in mzml directory\n") + cat("Following files did not have their counterpart in xics directory\n") print(setdiff(filenames[["runName"]], mzMLfiles[["runName"]])) } if(length(runs) == 0){ diff --git a/R/get_peaks_chromatograms.R b/R/get_peaks_chromatograms.R index 483be420..5b74069d 100644 --- a/R/get_peaks_chromatograms.R +++ b/R/get_peaks_chromatograms.R @@ -13,7 +13,7 @@ #' @keywords internal #' @examples #' dataPath <- system.file("extdata", package = "DIAlignR") -#' mzmlName<-paste0(dataPath,"/mzml/hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML") +#' mzmlName<-paste0(dataPath,"/xics/hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML") #' mz <- mzR::openMSfile(mzmlName, backend = "pwiz") #' chromIndices <- c(37L, 38L, 39L, 40L, 41L, 42L) #' \dontrun{ @@ -45,7 +45,7 @@ extractXIC_group <- function(mz, chromIndices){ #' @keywords internal #' @examples #' dataPath <- system.file("extdata", package = "DIAlignR") -#' sqName <- paste0(dataPath,"/mzml/hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass") +#' sqName <- paste0(dataPath,"/xics/hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass") #' chromIndices <- c(36L, 37L, 38L, 39L, 40L, 41L) #' \dontrun{ #' con <- DBI::dbConnect(RSQLite::SQLite(), dbname = sqName) @@ -165,7 +165,7 @@ getXICs4AlignObj <- function(mzPntrs, fileInfo, runs, prec2chromIndex, analytes) #' @inheritParams checkParams #' @param analytes (integer) a vector of precursor IDs. #' @param runs (vector of string) names of mzML files without extension. -#' @param dataPath (string) Path to mzml and osw directory. +#' @param dataPath (string) Path to xics and osw directory. #' @param maxFdrQuery (numeric) A numeric value between 0 and 1. It is used to filter features from osw file which have SCORE_MS2.QVALUE less than itself. #' @param runType (char) This must be one of the strings "DIA_proteomics", "DIA_Metabolomics". #' @param oswMerged (logical) TRUE for experiment-wide FDR and FALSE for run-specific FDR by pyprophet. diff --git a/R/merge_order.R b/R/merge_order.R index b7e0dddc..479b4cf9 100644 --- a/R/merge_order.R +++ b/R/merge_order.R @@ -100,7 +100,7 @@ getNodeIDs <- function(tree){ #' @description { #' While traversing from leaf to root node, at each node a master run is created. #' Merged features and merged chromatograms from parent runs are estimated. Chromatograms are written on the disk -#' at dataPath/mzml. For each precursor aligned parent time-vectors and corresponding child time-vector +#' at dataPath/xics. For each precursor aligned parent time-vectors and corresponding child time-vector #' are also calculated and written as *_av.rds at dataPath. #' #' Accesors to the new files are added to fileInfo, mzPntrs and prec2chromIndex. Features, reference @@ -157,7 +157,7 @@ getNodeIDs <- function(tree){ #' rm(mzPntrs) #' # Cleanup #' file.remove(list.files(dataPath, pattern = "*_av.rds", full.names = TRUE)) -#' file.remove(list.files(file.path(dataPath, "mzml"), pattern = "^master[0-9]+\\.chrom\\.mzML$", full.names = TRUE)) +#' file.remove(list.files(file.path(dataPath, "xics"), pattern = "^master[0-9]+\\.chrom\\.mzML$", full.names = TRUE)) #' } traverseUp <- function(tree, dataPath, fileInfo, features, mzPntrs, prec2chromIndex, precursors, params, adaptiveRTs, refRuns, multipeptide, peptideScores, ropenms, applyFun = lapply){ @@ -228,7 +228,7 @@ traverseUp <- function(tree, dataPath, fileInfo, features, mzPntrs, prec2chromIn #' # Cleanup #' rm(mzPntrs) #' file.remove(list.files(dataPath, pattern = "*_av.rds", full.names = TRUE)) -#' file.remove(list.files(file.path(dataPath, "mzml"), pattern = "^master[0-9]+\\.chrom\\.mzML$", full.names = TRUE)) +#' file.remove(list.files(file.path(dataPath, "xics"), pattern = "^master[0-9]+\\.chrom\\.mzML$", full.names = TRUE)) #' } traverseDown <- function(tree, dataPath, fileInfo, multipeptide, prec2chromIndex, mzPntrs, precursors, adaptiveRTs, refRuns, params, applyFun = lapply){ @@ -364,7 +364,7 @@ traverseDown <- function(tree, dataPath, fileInfo, multipeptide, prec2chromIndex #' # Cleanup #' rm(mzPntrs) #' file.remove(file.path(dataPath, "master1_av.rds")) -#' file.remove(file.path(dataPath, "mzml", "master1.chrom.mzML")) +#' file.remove(file.path(dataPath, "xics", "master1.chrom.mzML")) #' } alignToMaster <- function(ref, eXp, alignedVecs, refRun, adaptiveRT, multipeptide, prec2chromIndex, mzPntrs, fileInfo, precursors, params, applyFun = lapply){ diff --git a/R/merge_osw_mzml.R b/R/merge_osw_mzml.R index 38c120a2..74835358 100644 --- a/R/merge_osw_mzml.R +++ b/R/merge_osw_mzml.R @@ -30,8 +30,8 @@ mergeOswAnalytes_ChromHeader <- function(oswAnalytes, chromHead, analyteFDR = 1 #' Get list of peptides and their chromatogram indices. #' -#' This function reads all osw and mzml files in the directories at dataPath. It selects analytes which has associated features with m-score < maxFdrQuery. -#' For these analytes it fetches chromatogram indices by matching transition_id(osw) with chromatogramID(mzml). +#' This function reads all osw and xics files in the directories at dataPath. It selects analytes which has associated features with m-score < maxFdrQuery. +#' For these analytes it fetches chromatogram indices by matching transition_id(osw) with chromatogramID(xics). #' @author Shubham Gupta, \email{shubh.gupta@mail.utoronto.ca} #' #' ORCID: 0000-0003-3500-8152 @@ -39,7 +39,7 @@ mergeOswAnalytes_ChromHeader <- function(oswAnalytes, chromHead, analyteFDR = 1 #' License: (c) Author (2019) + GPL-3 #' Date: 2019-12-13 #' @importFrom rlang .data -#' @param dataPath (char) path to mzml and osw directory. +#' @param dataPath (char) path to xics and osw directory. #' @param filenames (data-frame) column "filename" contains RUN table from osw files. column "runs" contain respective mzML names without extension. #' To get filenames use DIAlignR::getRunNames function. #' @param maxFdrQuery (numeric) A numeric value between 0 and 1. It is used to filter features from osw file which have SCORE_MS2.QVALUE less than itself. @@ -155,7 +155,7 @@ mapPrecursorToChromIndices <- function(prec2transition, chromHead){ #' Get chromatogram indices of precursors. #' -#' This function reads the header of chromatogram files. It then fetches chromatogram indices by matching transition_id(osw) with chromatogramID(mzml). +#' This function reads the header of chromatogram files. It then fetches chromatogram indices by matching transition_id(osw) with chromatogramID(xics). #' @author Shubham Gupta, \email{shubh.gupta@mail.utoronto.ca} #' #' ORCID: 0000-0003-3500-8152 diff --git a/R/merge_runs.R b/R/merge_runs.R index c825526a..fdf7808c 100644 --- a/R/merge_runs.R +++ b/R/merge_runs.R @@ -1,7 +1,7 @@ #' Create a child run from two parent runs #' #' Get merged features and merged chromatograms from parent runs. Chromatograms are written on the disk -#' at dataPath/mzml. For each precursor aligned parent time-vectors and corresponding child time-vector +#' at dataPath/xics. For each precursor aligned parent time-vectors and corresponding child time-vector #' are also calculated and written as *_av.rda at dataPath. #' #' @author Shubham Gupta, \email{shubh.gupta@mail.utoronto.ca} @@ -42,7 +42,7 @@ #' multipeptide <- getNodeRun(runA = "run2", runB = "run0", mergeName = mergeName, dataPath = ".", fileInfo, features, #' mzPntrs, prec2chromIndex, precursors, params, adaptiveRTs, refRuns, multipeptide, peptideScores, ropenms) #' rm(mzPntrs) -#' file.remove(file.path(".", "mzml", paste0(mergeName, ".chrom.mzML"))) +#' file.remove(file.path(".", "xics", paste0(mergeName, ".chrom.mzML"))) #' file.remove(list.files(".", pattern = "*_av.rds", full.names = TRUE)) #' } getNodeRun <- function(runA, runB, mergeName, dataPath, fileInfo, features, mzPntrs, prec2chromIndex, @@ -134,10 +134,10 @@ getNodeRun <- function(runA, runB, mergeName, dataPath, fileInfo, features, mzPn ##### Write node mzML file ##### mergedXICs <- unlist(mergedXICs, recursive = FALSE, use.names = FALSE) if(params[["chromFile"]] =="mzML"){ - fileName <- file.path(dataPath, "mzml", paste0(mergeName, ".chrom.mzML")) + fileName <- file.path(dataPath, "xics", paste0(mergeName, ".chrom.mzML")) createMZML(ropenms, fileName, mergedXICs, precursors$transition_ids) } else if(params[["chromFile"]] =="sqMass"){ - fileName <- file.path(dataPath, "mzml", paste0(mergeName, ".chrom.sqMass")) + fileName <- file.path(dataPath, "xics", paste0(mergeName, ".chrom.sqMass")) createSqMass(fileName, mergedXICs, precursors$transition_ids, params[["lossy"]]) } diff --git a/R/peak_area.R b/R/peak_area.R index a9a7f2c9..68066016 100644 --- a/R/peak_area.R +++ b/R/peak_area.R @@ -67,7 +67,7 @@ newRow <- function(xics, left, right, RT, analyte, run, params){ #' @importFrom magrittr %>% #' @inheritParams alignTargetedRuns #' @param peakTable (data-frame) usually an output of alignTargetedRuns. Must have these columns: run, precursor, leftWidth, rightWidth. -#' @param dataPath (string) path to mzml and osw directory. +#' @param dataPath (string) path to xics and osw directory. #' @param oswMerged (logical) TRUE for experiment-wide FDR and FALSE for run-specific FDR by pyprophet. #' @return (data-frame) #' @seealso \code{\link{alignTargetedRuns}, \link{calculateIntensity}} diff --git a/R/progressive_alignment.R b/R/progressive_alignment.R index 620d757e..1f2fda69 100644 --- a/R/progressive_alignment.R +++ b/R/progressive_alignment.R @@ -1,6 +1,6 @@ #' Peptide quantification through progressive alignment #' -#' This function expects osw and mzml directories at dataPath. It first reads osw files and fetches +#' This function expects osw and xics directories at dataPath. It first reads osw files and fetches #' chromatogram indices for each analyte. To perform alignment, first a crude guide-tree is built which #' can also be provided with newickTree parameter. As we traverse from the leaf-nodes to the root node, #' runs are aligned pairwise. The root node is named master1 that has average of all fragment ion chromatograms @@ -15,11 +15,11 @@ #' Date: 2020-07-10 #' @inheritParams checkParams #' @inheritParams alignTargetedRuns -#' @param dataPath (string) path to mzml and osw directory. +#' @param dataPath (string) path to xics and osw directory. #' @param outFile (string) name of the output file. #' @param ropenms (pyopenms module) get this python module through \code{\link{get_ropenms}}. Required only for chrom.mzML files. #' @param oswMerged (logical) TRUE for experiment-wide FDR and FALSE for run-specific FDR by pyprophet. -#' @param runs (string) names of mzml file without extension. +#' @param runs (string) names of xics file without extension. #' @param newickTree (string) guidance tree in newick format. Look up \code{\link{getTree}}. #' @return (None) #' @seealso \code{\link{alignTargetedRuns}} @@ -33,7 +33,7 @@ #' # Removing aligned vectors #' file.remove(list.files(dataPath, pattern = "*_av.rds", full.names = TRUE)) #' # Removing temporarily created master chromatograms -#' file.remove(list.files(file.path(dataPath, "mzml"), pattern = "^master[0-9]+\\.chrom\\.mzML$", full.names = TRUE)) +#' file.remove(list.files(file.path(dataPath, "xics"), pattern = "^master[0-9]+\\.chrom\\.mzML$", full.names = TRUE)) #' file.remove(file.path(dataPath, "test3.temp.RData")) #' file.remove(file.path(dataPath, "master.merged.osw")) #' } diff --git a/R/pyopenms.R b/R/pyopenms.R index 43477d73..a4ea8382 100644 --- a/R/pyopenms.R +++ b/R/pyopenms.R @@ -55,7 +55,7 @@ addXIC <- function(ropenms, expriment, xic, nativeId){ #' @seealso \code{\link{get_ropenms}, \link{addXIC}} #' @examples #' dataPath <- system.file("extdata", package = "DIAlignR") -#' filename <- paste0(dataPath, "/mzml/hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML") +#' filename <- paste0(dataPath, "/xics/hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML") #' data(XIC_QFNNTDIVLLEDFQK_3_DIAlignR) #' XICs <- XIC_QFNNTDIVLLEDFQK_3_DIAlignR[["hroest_K120808_Strep10%PlasmaBiolRepl1_R03_SW_filt"]] #' nativeIds <- list(27706:27711) @@ -117,7 +117,7 @@ get_ropenms <- function(pythonPath = NULL, condaEnv = NULL, useConda=TRUE){ notReady <- function(ropenms, dataPath, filename){ mz = ropenms$OnDiscMSExperiment() - #filename <- paste0(dataPath, "/mzml/hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML") + #filename <- paste0(dataPath, "/xics/hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML") mz$openFile(filename) meta_data <- mz$getMetaData() header <- meta_data$getChromatograms() diff --git a/R/read_mzml.R b/R/read_mzml.R index 7732bb8c..4e08a2dd 100644 --- a/R/read_mzml.R +++ b/R/read_mzml.R @@ -7,7 +7,7 @@ #' #' License: (c) Author (2019) + GPL-3 #' Date: 2019-12-13 -#' @param mzmlName (char) path to mzml file. +#' @param mzmlName (char) path to xics file. #' @return (A data-frame) It has 10 columns. The two important columns are: #' \item{chromatogramId}{(integer) Fragment-ion ID that matches with transition ID in osw file.} #' \item{chromatogramIndex}{(integer) Index of chromatogram in mzML file.} @@ -15,7 +15,7 @@ #' @keywords internal #' @examples #' dataPath <- system.file("extdata", package = "DIAlignR") -#' mzmlName <-paste0(dataPath,"/mzml/hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML") +#' mzmlName <-paste0(dataPath,"/xics/hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML") #' \dontrun{ #' chromHead <- readChromatogramHeader(mzmlName = mzmlName) #' } @@ -40,7 +40,7 @@ readMzMLHeader <- function(mzmlName){ #' #' License: (c) Author (2020) + GPL-3 #' Date: 2020-12-25 -#' @param mzmlName (char) path to mzml file. +#' @param mzmlName (char) path to xics file. #' @return (A data-frame) It has 10 columns. The two important columns are: #' \item{chromatogramId}{(integer) Fragment-ion ID that matches with transition ID in osw file.} #' \item{chromatogramIndex}{(integer) Index of chromatogram in mzML file.} @@ -48,7 +48,7 @@ readMzMLHeader <- function(mzmlName){ #' @keywords internal #' @examples #' dataPath <- system.file("extdata", package = "DIAlignR") -#' sqName <-paste0(dataPath,"/mzml/hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass") +#' sqName <-paste0(dataPath,"/xics/hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass") #' \dontrun{ #' chromHead <- readChromatogramHeader(sqName) #' } diff --git a/R/read_osw.R b/R/read_osw.R index b97edb15..adc6772b 100644 --- a/R/read_osw.R +++ b/R/read_osw.R @@ -68,7 +68,7 @@ fetchAnalytesInfo <- function(oswName, maxFdrQuery, oswMerged, #' #' License: (c) Author (2019) + GPL-3 #' Date: 2019-12-13 -#' @param dataPath (char) path to mzml and osw directory. +#' @param dataPath (char) path to xics and osw directory. #' @param filenames (data-frame) column "filename" contains RUN table from osw files. column "runs" contain respective mzML names without extension. #' To get filenames use \code{\link{getRunNames}} function. #' @param oswMerged (logical) TRUE for experiment-wide FDR and FALSE for run-specific FDR by pyprophet. diff --git a/R/sqMass.R b/R/sqMass.R index 49125cde..10029f7f 100644 --- a/R/sqMass.R +++ b/R/sqMass.R @@ -90,7 +90,7 @@ createSqMass <- function(filename, XICs, transitionIDs, lossy){ #' @return A numeric vector. Uncompressed form of the Blob. #' @examples #' dataPath <- system.file("extdata", package = "DIAlignR") -#' sqName <- paste0(dataPath,"/mzml/hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass") +#' sqName <- paste0(dataPath,"/xics/hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass") #' con <- DBI::dbConnect(RSQLite::SQLite(), dbname = sqName) #' df1 <- DBI::dbGetQuery(con, "SELECT CHROMATOGRAM_ID, COMPRESSION, DATA_TYPE, DATA FROM DATA WHERE CHROMATOGRAM_ID = 36;") #' DBI::dbDisconnect(con) diff --git a/R/visualise_chromatograms.R b/R/visualise_chromatograms.R index b156d5cb..75870c14 100644 --- a/R/visualise_chromatograms.R +++ b/R/visualise_chromatograms.R @@ -51,8 +51,8 @@ plotXICgroup <- function(XIC_group, peakAnnot = NULL, Title =NULL){ #' Date: 2019-12-13 #' #' @param analyte (integer) an analyte is a PRECURSOR.ID from the osw file. -#' @param run (string) Name of a mzml file without extension. -#' @param dataPath (string) path to mzml and osw directory. +#' @param run (string) Name of a xics file without extension. +#' @param dataPath (string) path to xics and osw directory. #' @param maxFdrQuery (numeric) A numeric value between 0 and 1. It is used to filter features from osw file which have SCORE_MS2.QVALUE less than itself. #' @param XICfilter (string) must be either sgolay, boxcar, gaussian, loess or none. #' @param polyOrd (integer) order of the polynomial to be fit in the kernel. diff --git a/inst/extdata/mzml/hroest_K120808_Strep10%PlasmaBiolRepl1_R03_SW_filt.chrom.mzML b/inst/extdata/xics/hroest_K120808_Strep10%PlasmaBiolRepl1_R03_SW_filt.chrom.mzML similarity index 100% rename from inst/extdata/mzml/hroest_K120808_Strep10%PlasmaBiolRepl1_R03_SW_filt.chrom.mzML rename to inst/extdata/xics/hroest_K120808_Strep10%PlasmaBiolRepl1_R03_SW_filt.chrom.mzML diff --git a/inst/extdata/mzml/hroest_K120808_Strep10%PlasmaBiolRepl1_R03_SW_filt.chrom.sqMass b/inst/extdata/xics/hroest_K120808_Strep10%PlasmaBiolRepl1_R03_SW_filt.chrom.sqMass similarity index 100% rename from inst/extdata/mzml/hroest_K120808_Strep10%PlasmaBiolRepl1_R03_SW_filt.chrom.sqMass rename to inst/extdata/xics/hroest_K120808_Strep10%PlasmaBiolRepl1_R03_SW_filt.chrom.sqMass diff --git a/inst/extdata/mzml/hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML b/inst/extdata/xics/hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML similarity index 100% rename from inst/extdata/mzml/hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML rename to inst/extdata/xics/hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML diff --git a/inst/extdata/mzml/hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass b/inst/extdata/xics/hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass similarity index 100% rename from inst/extdata/mzml/hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass rename to inst/extdata/xics/hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass diff --git a/inst/extdata/mzml/hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML b/inst/extdata/xics/hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML similarity index 100% rename from inst/extdata/mzml/hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML rename to inst/extdata/xics/hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML diff --git a/inst/extdata/mzml/hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass b/inst/extdata/xics/hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass similarity index 100% rename from inst/extdata/mzml/hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass rename to inst/extdata/xics/hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass diff --git a/man/alignTargetedRuns.Rd b/man/alignTargetedRuns.Rd index d473cf96..0878502b 100644 --- a/man/alignTargetedRuns.Rd +++ b/man/alignTargetedRuns.Rd @@ -15,7 +15,7 @@ alignTargetedRuns( ) } \arguments{ -\item{dataPath}{(string) path to mzml and osw directory.} +\item{dataPath}{(string) path to xics and osw directory.} \item{outFile}{(string) name of the output file.} @@ -23,7 +23,7 @@ alignTargetedRuns( \item{oswMerged}{(logical) TRUE for experiment-wide FDR and FALSE for run-specific FDR by pyprophet.} -\item{runs}{(a vector of string) names of mzml file without extension.} +\item{runs}{(a vector of string) names of xics file without extension.} \item{refRun}{(string) reference for alignment. If no run is provided, m-score is used to select reference run.} @@ -34,7 +34,7 @@ An output table with following columns: precursor, run, intensity, RT, leftWidth peak_group_rank, m_score, alignment_rank, peptide_id, sequence, charge, group_label. } \description{ -This function expects osw and mzml directories at dataPath. It first reads osw files and fetches chromatogram indices for each analyte. +This function expects osw and xics directories at dataPath. It first reads osw files and fetches chromatogram indices for each analyte. It then align XICs of its reference XICs. Best peak, which has lowest m-score, about the aligned retention time is picked for quantification. } \examples{ diff --git a/man/alignTargetedRuns2.Rd b/man/alignTargetedRuns2.Rd index 747b3c28..a6eab44c 100644 --- a/man/alignTargetedRuns2.Rd +++ b/man/alignTargetedRuns2.Rd @@ -15,7 +15,7 @@ alignTargetedRuns2( ) } \arguments{ -\item{dataPath}{(string) path to mzml and osw directory.} +\item{dataPath}{(string) path to xics and osw directory.} \item{outFile}{(string) name of the output file.} @@ -23,7 +23,7 @@ alignTargetedRuns2( \item{oswMerged}{(logical) TRUE for experiment-wide FDR and FALSE for run-specific FDR by pyprophet.} -\item{runs}{(string) names of mzml file without extension.} +\item{runs}{(string) names of xics file without extension.} \item{applyFun}{(function) value must be either lapply or BiocParallel::bplapply.} } diff --git a/man/alignToMaster.Rd b/man/alignToMaster.Rd index 5dc3646a..d1db173a 100644 --- a/man/alignToMaster.Rd +++ b/man/alignToMaster.Rd @@ -90,7 +90,7 @@ multipeptide <- alignToMaster(ref = "master1", eXp = "run1", alignedVecs, refRun # Cleanup rm(mzPntrs) file.remove(file.path(dataPath, "master1_av.rds")) -file.remove(file.path(dataPath, "mzml", "master1.chrom.mzML")) +file.remove(file.path(dataPath, "xics", "master1.chrom.mzML")) } } \seealso{ diff --git a/man/createMZML.Rd b/man/createMZML.Rd index 4aa61b68..ea32c39b 100644 --- a/man/createMZML.Rd +++ b/man/createMZML.Rd @@ -23,7 +23,7 @@ Writes an mzML file having chromatograms and their native IDs. } \examples{ dataPath <- system.file("extdata", package = "DIAlignR") -filename <- paste0(dataPath, "/mzml/hroest_K120809_Strep10\%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML") +filename <- paste0(dataPath, "/xics/hroest_K120809_Strep10\%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML") data(XIC_QFNNTDIVLLEDFQK_3_DIAlignR) XICs <- XIC_QFNNTDIVLLEDFQK_3_DIAlignR[["hroest_K120808_Strep10\%PlasmaBiolRepl1_R03_SW_filt"]] nativeIds <- list(27706:27711) diff --git a/man/extractXIC_group.Rd b/man/extractXIC_group.Rd index c947c3d8..adf6b897 100644 --- a/man/extractXIC_group.Rd +++ b/man/extractXIC_group.Rd @@ -19,7 +19,7 @@ Extracts XICs using mz object. Each chromatogram represents a transition of prec } \examples{ dataPath <- system.file("extdata", package = "DIAlignR") -mzmlName<-paste0(dataPath,"/mzml/hroest_K120809_Strep10\%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML") +mzmlName<-paste0(dataPath,"/xics/hroest_K120809_Strep10\%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML") mz <- mzR::openMSfile(mzmlName, backend = "pwiz") chromIndices <- c(37L, 38L, 39L, 40L, 41L, 42L) \dontrun{ diff --git a/man/extractXIC_group2.Rd b/man/extractXIC_group2.Rd index b7a6449e..04afa06f 100644 --- a/man/extractXIC_group2.Rd +++ b/man/extractXIC_group2.Rd @@ -20,7 +20,7 @@ Extracts XICs using connection to sqMass file Each chromatogram represents a tra } \examples{ dataPath <- system.file("extdata", package = "DIAlignR") -sqName <- paste0(dataPath,"/mzml/hroest_K120809_Strep10\%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass") +sqName <- paste0(dataPath,"/xics/hroest_K120809_Strep10\%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass") chromIndices <- c(36L, 37L, 38L, 39L, 40L, 41L) \dontrun{ con <- DBI::dbConnect(RSQLite::SQLite(), dbname = sqName) diff --git a/man/filenamesFromMZML.Rd b/man/filenamesFromMZML.Rd index 00290cf0..4d9fff0d 100644 --- a/man/filenamesFromMZML.Rd +++ b/man/filenamesFromMZML.Rd @@ -7,7 +7,7 @@ filenamesFromMZML(dataPath, chromFile) } \arguments{ -\item{dataPath}{(char) Path to mzml and osw directory.} +\item{dataPath}{(char) Path to xics and osw directory.} } \value{ A dataframe with two columns: diff --git a/man/filenamesFromOSW.Rd b/man/filenamesFromOSW.Rd index 61a25bf3..bdcec3f0 100644 --- a/man/filenamesFromOSW.Rd +++ b/man/filenamesFromOSW.Rd @@ -7,7 +7,7 @@ filenamesFromOSW(dataPath, pattern) } \arguments{ -\item{dataPath}{(char) path to mzml and osw directory.} +\item{dataPath}{(char) path to xics and osw directory.} \item{pattern}{(char) must be either *.osw or *merged.osw .} } diff --git a/man/getAlignObjs.Rd b/man/getAlignObjs.Rd index df7a823d..64c2ab85 100644 --- a/man/getAlignObjs.Rd +++ b/man/getAlignObjs.Rd @@ -17,9 +17,9 @@ getAlignObjs( \arguments{ \item{analytes}{(vector of integers) transition_group_ids for which features are to be extracted.} -\item{runs}{(a vector of string) names of mzml file without extension.} +\item{runs}{(a vector of string) names of xics file without extension.} -\item{dataPath}{(string) path to mzml and osw directory.} +\item{dataPath}{(string) path to xics and osw directory.} \item{refRun}{(string) reference for alignment. If no run is provided, m-score is used to select reference run.} @@ -36,7 +36,7 @@ A list of fileInfo and AlignObjs. Each AlignObj is an S4 object. Three most-impo \item{score}{(numeric) cumulative score of alignment.} } \description{ -This function expects osw and mzml directories at dataPath. It first reads osw files and fetches chromatogram indices for each requested analyte. +This function expects osw and xics directories at dataPath. It first reads osw files and fetches chromatogram indices for each requested analyte. It then align XICs of each analyte to its reference XICs. AlignObj is returned which contains aligned indices and cumulative score along the alignment path. } \examples{ diff --git a/man/getChromatogramIndices.Rd b/man/getChromatogramIndices.Rd index 12a13593..6bad9181 100644 --- a/man/getChromatogramIndices.Rd +++ b/man/getChromatogramIndices.Rd @@ -21,7 +21,7 @@ getChromatogramIndices(fileInfo, precursors, mzPntrs, applyFun = lapply) \item{chromatogramIndex}{(integer) index of chromatogram in mzML file.} } \description{ -This function reads the header of chromatogram files. It then fetches chromatogram indices by matching transition_id(osw) with chromatogramID(mzml). +This function reads the header of chromatogram files. It then fetches chromatogram indices by matching transition_id(osw) with chromatogramID(xics). } \examples{ dataPath <- system.file("extdata", package = "DIAlignR") diff --git a/man/getNodeRun.Rd b/man/getNodeRun.Rd index e4ec6ed2..932b9f0c 100644 --- a/man/getNodeRun.Rd +++ b/man/getNodeRun.Rd @@ -30,7 +30,7 @@ getNodeRun( \item{mergeName}{(string) name of the node that is generated with merging of runA and runB.} -\item{dataPath}{(string) path to mzml and osw directory.} +\item{dataPath}{(string) path to xics and osw directory.} \item{fileInfo}{(data-frame) output of \code{\link{getRunNames}}.} @@ -64,7 +64,7 @@ associated with analytes. This is an output of \code{\link{getMultipeptide}}.} } \description{ Get merged features and merged chromatograms from parent runs. Chromatograms are written on the disk -at dataPath/mzml. For each precursor aligned parent time-vectors and corresponding child time-vector +at dataPath/xics. For each precursor aligned parent time-vectors and corresponding child time-vector are also calculated and written as *_av.rda at dataPath. } \examples{ @@ -91,7 +91,7 @@ ropenms <- get_ropenms(condaEnv = "envName", useConda=TRUE) multipeptide <- getNodeRun(runA = "run2", runB = "run0", mergeName = mergeName, dataPath = ".", fileInfo, features, mzPntrs, prec2chromIndex, precursors, params, adaptiveRTs, refRuns, multipeptide, peptideScores, ropenms) rm(mzPntrs) -file.remove(file.path(".", "mzml", paste0(mergeName, ".chrom.mzML"))) +file.remove(file.path(".", "xics", paste0(mergeName, ".chrom.mzML"))) file.remove(list.files(".", pattern = "*_av.rds", full.names = TRUE)) } } diff --git a/man/getOswAnalytes.Rd b/man/getOswAnalytes.Rd index fb259fb6..10e257ce 100644 --- a/man/getOswAnalytes.Rd +++ b/man/getOswAnalytes.Rd @@ -22,7 +22,7 @@ FALSE for fetching analytes as PEPTIDE.MODIFIED_SEQUENCE and PRECURSOR.CHARGE fr \item{runType}{(char) This must be one of the strings "DIA_proteomics", "DIA_Metabolomics".} -\item{dataPath}{(char) path to mzml and osw directory.} +\item{dataPath}{(char) path to xics and osw directory.} \item{filenames}{(data-frame) column "filename" contains RUN table from osw files. column "runs" contain respective mzML names without extension. To get filenames use \code{\link{getRunNames}} function.} diff --git a/man/getOswFiles.Rd b/man/getOswFiles.Rd index 5f5480cd..a73c3e21 100644 --- a/man/getOswFiles.Rd +++ b/man/getOswFiles.Rd @@ -31,7 +31,7 @@ FALSE for fetching analytes as PEPTIDE.MODIFIED_SEQUENCE and PRECURSOR.CHARGE fr \item{analyteInGroupLabel}{(logical) TRUE for getting analytes as PRECURSOR.GROUP_LABEL from osw file.} -\item{dataPath}{(char) path to mzml and osw directory.} +\item{dataPath}{(char) path to xics and osw directory.} \item{filenames}{(data-frame) column "filename" contains RUN table from osw files. column "runs" contain respective mzML names without extension. To get filenames use DIAlignR::getRunNames function.} @@ -51,8 +51,8 @@ To get filenames use DIAlignR::getRunNames function.} \item{transition_ids}{(integer) fragment-ion ID associated with transition_group_id. This is matched with chromatogram ID in mzML file.} } \description{ -This function reads all osw and mzml files in the directories at dataPath. It selects analytes which has associated features with m-score < maxFdrQuery. -For these analytes it fetches chromatogram indices by matching transition_id(osw) with chromatogramID(mzml). +This function reads all osw and xics files in the directories at dataPath. It selects analytes which has associated features with m-score < maxFdrQuery. +For these analytes it fetches chromatogram indices by matching transition_id(osw) with chromatogramID(xics). } \examples{ dataPath <- system.file("extdata", package = "DIAlignR") diff --git a/man/getRunNames.Rd b/man/getRunNames.Rd index 14b8ec20..14c5e500 100644 --- a/man/getRunNames.Rd +++ b/man/getRunNames.Rd @@ -7,7 +7,7 @@ getRunNames(dataPath, oswMerged = TRUE, params = paramsDIAlignR()) } \arguments{ -\item{dataPath}{(char) Path to mzml and osw directory.} +\item{dataPath}{(char) Path to xics and osw directory.} \item{oswMerged}{(logical) TRUE for experiment-wide FDR and FALSE for run-specific FDR by pyprophet.} diff --git a/man/getXICs.Rd b/man/getXICs.Rd index 8c4b89b2..f1cbc4a5 100644 --- a/man/getXICs.Rd +++ b/man/getXICs.Rd @@ -19,7 +19,7 @@ getXICs( \item{runs}{(vector of string) names of mzML files without extension.} -\item{dataPath}{(string) Path to mzml and osw directory.} +\item{dataPath}{(string) Path to xics and osw directory.} \item{maxFdrQuery}{(numeric) A numeric value between 0 and 1. It is used to filter features from osw file which have SCORE_MS2.QVALUE less than itself.} diff --git a/man/plotAnalyteXICs.Rd b/man/plotAnalyteXICs.Rd index 2a1c863e..55ab90a9 100644 --- a/man/plotAnalyteXICs.Rd +++ b/man/plotAnalyteXICs.Rd @@ -21,9 +21,9 @@ plotAnalyteXICs( \arguments{ \item{analyte}{(integer) an analyte is a PRECURSOR.ID from the osw file.} -\item{run}{(string) Name of a mzml file without extension.} +\item{run}{(string) Name of a xics file without extension.} -\item{dataPath}{(string) path to mzml and osw directory.} +\item{dataPath}{(string) path to xics and osw directory.} \item{maxFdrQuery}{(numeric) A numeric value between 0 and 1. It is used to filter features from osw file which have SCORE_MS2.QVALUE less than itself.} diff --git a/man/progAlignRuns.Rd b/man/progAlignRuns.Rd index d0a49360..ff644357 100644 --- a/man/progAlignRuns.Rd +++ b/man/progAlignRuns.Rd @@ -16,7 +16,7 @@ progAlignRuns( ) } \arguments{ -\item{dataPath}{(string) path to mzml and osw directory.} +\item{dataPath}{(string) path to xics and osw directory.} \item{params}{(list) parameters are entered as list. Output of the \code{\link{paramsDIAlignR}} function.} @@ -26,7 +26,7 @@ progAlignRuns( \item{oswMerged}{(logical) TRUE for experiment-wide FDR and FALSE for run-specific FDR by pyprophet.} -\item{runs}{(string) names of mzml file without extension.} +\item{runs}{(string) names of xics file without extension.} \item{newickTree}{(string) guidance tree in newick format. Look up \code{\link{getTree}}.} @@ -36,7 +36,7 @@ progAlignRuns( (None) } \description{ -This function expects osw and mzml directories at dataPath. It first reads osw files and fetches +This function expects osw and xics directories at dataPath. It first reads osw files and fetches chromatogram indices for each analyte. To perform alignment, first a crude guide-tree is built which can also be provided with newickTree parameter. As we traverse from the leaf-nodes to the root node, runs are aligned pairwise. The root node is named master1 that has average of all fragment ion chromatograms @@ -53,7 +53,7 @@ progAlignRuns(dataPath, params = params, outFile = "test3", ropenms = ropenms) # Removing aligned vectors file.remove(list.files(dataPath, pattern = "*_av.rds", full.names = TRUE)) # Removing temporarily created master chromatograms -file.remove(list.files(file.path(dataPath, "mzml"), pattern = "^master[0-9]+\\\\.chrom\\\\.mzML$", full.names = TRUE)) +file.remove(list.files(file.path(dataPath, "xics"), pattern = "^master[0-9]+\\\\.chrom\\\\.mzML$", full.names = TRUE)) file.remove(file.path(dataPath, "test3.temp.RData")) file.remove(file.path(dataPath, "master.merged.osw")) } diff --git a/man/progAlignRuns2.Rd b/man/progAlignRuns2.Rd index bfdda821..10d9fbd5 100644 --- a/man/progAlignRuns2.Rd +++ b/man/progAlignRuns2.Rd @@ -17,7 +17,7 @@ progAlignRuns2( ) } \arguments{ -\item{dataPath}{(string) path to mzml and osw directory.} +\item{dataPath}{(string) path to xics and osw directory.} \item{params}{(list) parameters are entered as list. Output of the \code{\link{paramsDIAlignR}} function.} @@ -27,7 +27,7 @@ progAlignRuns2( \item{oswMerged}{(logical) TRUE for experiment-wide FDR and FALSE for run-specific FDR by pyprophet.} -\item{runs}{(string) names of mzml file without extension.} +\item{runs}{(string) names of xics file without extension.} \item{newickTree}{(string) guidance tree in newick format. Look up \code{\link{getTree}}.} diff --git a/man/readMzMLHeader.Rd b/man/readMzMLHeader.Rd index 7be025b0..a88fe38a 100644 --- a/man/readMzMLHeader.Rd +++ b/man/readMzMLHeader.Rd @@ -7,7 +7,7 @@ readMzMLHeader(mzmlName) } \arguments{ -\item{mzmlName}{(char) path to mzml file.} +\item{mzmlName}{(char) path to xics file.} } \value{ (A data-frame) It has 10 columns. The two important columns are: @@ -19,7 +19,7 @@ Get a table of chromatogram indices and respective transition IDs. } \examples{ dataPath <- system.file("extdata", package = "DIAlignR") -mzmlName <-paste0(dataPath,"/mzml/hroest_K120809_Strep0\%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML") +mzmlName <-paste0(dataPath,"/xics/hroest_K120809_Strep0\%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML") \dontrun{ chromHead <- readChromatogramHeader(mzmlName = mzmlName) } diff --git a/man/readSqMassHeader.Rd b/man/readSqMassHeader.Rd index 461fbd4e..22f1f945 100644 --- a/man/readSqMassHeader.Rd +++ b/man/readSqMassHeader.Rd @@ -7,7 +7,7 @@ readSqMassHeader(con) } \arguments{ -\item{mzmlName}{(char) path to mzml file.} +\item{mzmlName}{(char) path to xics file.} } \value{ (A data-frame) It has 10 columns. The two important columns are: @@ -19,7 +19,7 @@ Get a table of chromatogram indices and respective transition IDs. } \examples{ dataPath <- system.file("extdata", package = "DIAlignR") -sqName <-paste0(dataPath,"/mzml/hroest_K120809_Strep0\%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass") +sqName <-paste0(dataPath,"/xics/hroest_K120809_Strep0\%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass") \dontrun{ chromHead <- readChromatogramHeader(sqName) } diff --git a/man/recalculateIntensity.Rd b/man/recalculateIntensity.Rd index 1dd64b67..4687acef 100644 --- a/man/recalculateIntensity.Rd +++ b/man/recalculateIntensity.Rd @@ -14,7 +14,7 @@ recalculateIntensity( \arguments{ \item{peakTable}{(data-frame) usually an output of alignTargetedRuns. Must have these columns: run, precursor, leftWidth, rightWidth.} -\item{dataPath}{(string) path to mzml and osw directory.} +\item{dataPath}{(string) path to xics and osw directory.} \item{oswMerged}{(logical) TRUE for experiment-wide FDR and FALSE for run-specific FDR by pyprophet.} diff --git a/man/traverseDown.Rd b/man/traverseDown.Rd index 518b8f89..bbd4e3ec 100644 --- a/man/traverseDown.Rd +++ b/man/traverseDown.Rd @@ -21,7 +21,7 @@ traverseDown( \arguments{ \item{tree}{(phylo) a phylogenetic tree.} -\item{dataPath}{(string) path to mzml and osw directory.} +\item{dataPath}{(string) path to xics and osw directory.} \item{fileInfo}{(data-frame) output of \code{\link{getRunNames}}.} @@ -84,7 +84,7 @@ multipeptide <- traverseDown(tree, dataPath, fileInfo, multipeptide, prec2chromI # Cleanup rm(mzPntrs) file.remove(list.files(dataPath, pattern = "*_av.rds", full.names = TRUE)) -file.remove(list.files(file.path(dataPath, "mzml"), pattern = "^master[0-9]+\\\\.chrom\\\\.mzML$", full.names = TRUE)) +file.remove(list.files(file.path(dataPath, "xics"), pattern = "^master[0-9]+\\\\.chrom\\\\.mzML$", full.names = TRUE)) } } \seealso{ diff --git a/man/traverseUp.Rd b/man/traverseUp.Rd index dd9ee25a..c6ffa1c0 100644 --- a/man/traverseUp.Rd +++ b/man/traverseUp.Rd @@ -24,7 +24,7 @@ traverseUp( \arguments{ \item{tree}{(phylo) a phylogenetic tree.} -\item{dataPath}{(string) path to mzml and osw directory.} +\item{dataPath}{(string) path to xics and osw directory.} \item{fileInfo}{(data-frame) output of \code{\link{getRunNames}}.} @@ -61,7 +61,7 @@ associated with analytes. This is an output of \code{\link{getMultipeptide}}.} { While traversing from leaf to root node, at each node a master run is created. Merged features and merged chromatograms from parent runs are estimated. Chromatograms are written on the disk -at dataPath/mzml. For each precursor aligned parent time-vectors and corresponding child time-vector +at dataPath/xics. For each precursor aligned parent time-vectors and corresponding child time-vector are also calculated and written as *_av.rds at dataPath. Accesors to the new files are added to fileInfo, mzPntrs and prec2chromIndex. Features, reference @@ -95,7 +95,7 @@ multipeptide <- traverseUp(tree, dataPath, fileInfo, features, mzPntrs, prec2chr rm(mzPntrs) # Cleanup file.remove(list.files(dataPath, pattern = "*_av.rds", full.names = TRUE)) -file.remove(list.files(file.path(dataPath, "mzml"), pattern = "^master[0-9]+\\\\.chrom\\\\.mzML$", full.names = TRUE)) +file.remove(list.files(file.path(dataPath, "xics"), pattern = "^master[0-9]+\\\\.chrom\\\\.mzML$", full.names = TRUE)) } } \seealso{ diff --git a/man/uncompressVec.Rd b/man/uncompressVec.Rd index 909d6f1e..ec2a8312 100644 --- a/man/uncompressVec.Rd +++ b/man/uncompressVec.Rd @@ -21,7 +21,7 @@ compression is one of 0 = no, 1 = zlib, 2 = np-linear, } \examples{ dataPath <- system.file("extdata", package = "DIAlignR") -sqName <- paste0(dataPath,"/mzml/hroest_K120809_Strep10\%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass") +sqName <- paste0(dataPath,"/xics/hroest_K120809_Strep10\%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass") con <- DBI::dbConnect(RSQLite::SQLite(), dbname = sqName) df1 <- DBI::dbGetQuery(con, "SELECT CHROMATOGRAM_ID, COMPRESSION, DATA_TYPE, DATA FROM DATA WHERE CHROMATOGRAM_ID = 36;") DBI::dbDisconnect(con) diff --git a/python/scripts/DIAlignR4win.py b/python/scripts/DIAlignR4win.py index c2b9f94c..e3e3f0ff 100644 --- a/python/scripts/DIAlignR4win.py +++ b/python/scripts/DIAlignR4win.py @@ -22,7 +22,7 @@ def getRunNames(dataPath, oswFiles, mzmlFiles): runs = [] oswdataPath = os.path.join(dataPath, 'osw') - mzmldataPath = os.path.join(dataPath, 'mzml') + mzmldataPath = os.path.join(dataPath, 'xics') for root, dirs, files in os.walk(oswdataPath): for file in files: if file.endswith(".osw"): @@ -108,7 +108,7 @@ def extractXIC_group(mz, chromIndices): def main(): parser = ArgumentParser(description='Align XICs of precursors across multiple Targeted-MS runs and outputs quantitative data matrix.', formatter_class=RawTextHelpFormatter) - parser.add_argument('-in1', '--in_dataPath', metavar = '', help="location of parent directory of osw and mzml files.\n", type = Path, default = None, required = True) + parser.add_argument('-in1', '--in_dataPath', metavar = '', help="location of parent directory of osw and xics files.\n", type = Path, default = None, required = True) parser.add_argument('-in2', '--alignType' , metavar = 'hybrid', type = str, nargs = 1, default = 'hybrid', required = False, choices=['hybrid', 'local', 'global'], help = 'Type of retention time alignment.\n') parser.add_argument('--maxFdrQuery' , metavar = '0.05', type = float, nargs = 1, default = 0.05, required = False, help = 'Type of retention time alignment.\n') parser.add_argument('--maxFdrLoess' , metavar = '0.01', type = float, nargs = 1, default = 0.01, required = False, help = 'Type of retention time alignment.\n') @@ -177,7 +177,7 @@ def main(): df = pd.DataFrame(rows, columns=['transition_group_id', 'filename', 'RT', 'delta_rt', 'assay_RT', 'Intensity', 'leftWidth', 'rightWidth', 'peak_group_rank', 'm_score', 'transition_id']) # Get ChromatogramID (native) and ChromatogramIndex - mzml_db = os.path.join(curPath, 'mzml', run + '.chrom.mzML') + mzml_db = os.path.join(curPath, 'xics', run + '.chrom.mzML') mz = OnDiscMSExperiment() mz.openFile(mzml_db) meta_data = mz.getMetaData() @@ -209,7 +209,7 @@ def main(): p.update({b'frame_length': args.SgolayFiltLen, b'polynomial_order': args.SgolayFiltOrd}) filter.setParameters(p) for run in mzPntrs.keys(): - mzml_db = os.path.join(curPath, 'mzml', run + '.chrom.mzML') + mzml_db = os.path.join(curPath, 'xics', run + '.chrom.mzML') mz = OnDiscMSExperiment() mz.openFile(mzml_db) #filter.filterExperiment(mz) diff --git a/tests/testthat/test_align_dia_runs.R b/tests/testthat/test_align_dia_runs.R index f2345bfd..1d7c0349 100644 --- a/tests/testthat/test_align_dia_runs.R +++ b/tests/testthat/test_align_dia_runs.R @@ -153,7 +153,7 @@ test_that("test_alignToRef",{ # Case 3 chromIndices <- prec2chromIndex[["run1"]][c(3,4), "chromatogramIndex"] - mz <- mzR::openMSfile(file.path(dataPath, "mzml","hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML")) + mz <- mzR::openMSfile(file.path(dataPath, "xics","hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML")) XICs.ref <- lapply(chromIndices, function(i) extractXIC_group(mz, chromIndices = i)) names(XICs.ref) <- c("9719", "9720") df <- multipeptide_DIAlignR[["9861"]] diff --git a/tests/testthat/test_get_filenames.R b/tests/testthat/test_get_filenames.R index 00790b99..735f12d1 100644 --- a/tests/testthat/test_get_filenames.R +++ b/tests/testthat/test_get_filenames.R @@ -18,18 +18,18 @@ test_that("test_filenamesFromMZML", { expOutput <- data.frame("runName" = c("hroest_K120808_Strep10%PlasmaBiolRepl1_R03_SW_filt", "hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt", "hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt"), - "chromatogramFile" = c(file.path(dataPath, "mzml", "hroest_K120808_Strep10%PlasmaBiolRepl1_R03_SW_filt.chrom.mzML"), - file.path(dataPath, "mzml", "hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML"), - file.path(dataPath, "mzml", "hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML")), + "chromatogramFile" = c(file.path(dataPath, "xics", "hroest_K120808_Strep10%PlasmaBiolRepl1_R03_SW_filt.chrom.mzML"), + file.path(dataPath, "xics", "hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML"), + file.path(dataPath, "xics", "hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML")), stringsAsFactors=FALSE) expect_identical(filenamesFromMZML(dataPath = dataPath, "mzML"), expOutput) expect_message(filenamesFromMZML(dataPath = ".", "mzML"), "0 .chrom.mzML files are found.") expect_identical(names(filenamesFromMZML(dataPath = ".", "mzML")), c("runName", "chromatogramFile")) expect_identical(nrow(filenamesFromMZML(dataPath = ".", "mzML")), 0L) - expOutput <- c(file.path(dataPath, "mzml", "hroest_K120808_Strep10%PlasmaBiolRepl1_R03_SW_filt.chrom.sqMass"), - file.path(dataPath, "mzml", "hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass"), - file.path(dataPath, "mzml", "hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass")) + expOutput <- c(file.path(dataPath, "xics", "hroest_K120808_Strep10%PlasmaBiolRepl1_R03_SW_filt.chrom.sqMass"), + file.path(dataPath, "xics", "hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass"), + file.path(dataPath, "xics", "hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass")) expect_identical(filenamesFromMZML(dataPath = dataPath, "sqMass")[["chromatogramFile"]], expOutput) }) @@ -43,9 +43,9 @@ test_that("test_getRunNames", { "data/raw/hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.mzML.gz"), "spectraFileID" = c("125704171604355508", "6752973645981403097", "2234664662238281994"), "featureFile" = file.path(dataPath, "osw", "merged.osw"), - "chromatogramFile" = c(file.path(dataPath, "mzml", "hroest_K120808_Strep10%PlasmaBiolRepl1_R03_SW_filt.chrom.mzML"), - file.path(dataPath, "mzml", "hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML"), - file.path(dataPath, "mzml", "hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML")), + "chromatogramFile" = c(file.path(dataPath, "xics", "hroest_K120808_Strep10%PlasmaBiolRepl1_R03_SW_filt.chrom.mzML"), + file.path(dataPath, "xics", "hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML"), + file.path(dataPath, "xics", "hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML")), row.names = c("run0", "run1", "run2"), stringsAsFactors=FALSE) params <- paramsDIAlignR() @@ -66,9 +66,9 @@ test_that("test_getRunNames", { "data/raw/hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.mzML.gz"), "spectraFileID" = c("125704171604355508", "6752973645981403097", "2234664662238281994"), "featureFile" = file.path(dataPath, "osw", "merged.osw"), - "chromatogramFile" = c(file.path(dataPath, "mzml", "hroest_K120808_Strep10%PlasmaBiolRepl1_R03_SW_filt.chrom.sqMass"), - file.path(dataPath, "mzml", "hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass"), - file.path(dataPath, "mzml", "hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass")), + "chromatogramFile" = c(file.path(dataPath, "xics", "hroest_K120808_Strep10%PlasmaBiolRepl1_R03_SW_filt.chrom.sqMass"), + file.path(dataPath, "xics", "hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass"), + file.path(dataPath, "xics", "hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass")), row.names = c("run0", "run1", "run2"), stringsAsFactors=FALSE) expect_identical(outDATA, expOutput) diff --git a/tests/testthat/test_get_peaks_chromatograms.R b/tests/testthat/test_get_peaks_chromatograms.R index 42537a07..0113a6c5 100644 --- a/tests/testthat/test_get_peaks_chromatograms.R +++ b/tests/testthat/test_get_peaks_chromatograms.R @@ -1,7 +1,7 @@ context("get_peak_chromatograms") test_that("test_extractXIC_group", { - mzmlName <- file.path(system.file("extdata", package = "DIAlignR"), "mzml", "hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML") + mzmlName <- file.path(system.file("extdata", package = "DIAlignR"), "xics", "hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML") mz <- mzR::openMSfile(filename = mzmlName, backend = "pwiz") chromIndices <- c(37L, 38L, 39L, 40L, 41L, 42L) outData <- extractXIC_group(mz, chromIndices) @@ -13,7 +13,7 @@ test_that("test_extractXIC_group", { }) test_that("test_extractXIC_group2", { - sqName <- file.path(system.file("extdata", package = "DIAlignR"), "mzml", "hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass") + sqName <- file.path(system.file("extdata", package = "DIAlignR"), "xics", "hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass") con <- DBI::dbConnect(RSQLite::SQLite(), dbname = sqName) chromIndices <- c(36L, 37L, 38L, 39L, 40L, 41L) outData <- extractXIC_group2(con, chromIndices) diff --git a/tests/testthat/test_merge_order.R b/tests/testthat/test_merge_order.R index d559fc09..b72c8fa2 100644 --- a/tests/testthat/test_merge_order.R +++ b/tests/testthat/test_merge_order.R @@ -74,7 +74,7 @@ test_that("test_traverseUp", { feature_id = bit64::as.integer64(7675762503084486466), RT = 5237.8, intensity = 229.707813, leftWidth = 5217.35, rightWidth = 5261.7, peak_group_rank = 1L, m_score = 5.692e-05), tolerance = 1e-04) - expect_identical(fileInfo["master1", "chromatogramFile"], file.path(dataPath, "mzml", "master1.chrom.mzML")) + expect_identical(fileInfo["master1", "chromatogramFile"], file.path(dataPath, "xics", "master1.chrom.mzML")) expect_identical(fileInfo["master1", "runName"], "master1") expect_identical(prec2chromIndex$master1[,"transition_group_id"], 4618L) expect_identical(prec2chromIndex$master1[,"chromatogramIndex"][[1]], 1:6) @@ -84,7 +84,7 @@ test_that("test_traverseUp", { expect_identical(refRuns[["master1"]][[2]], "4618") data(masterXICs_DIAlignR, package="DIAlignR") - outData <- mzR::chromatograms(mzR::openMSfile(file.path(dataPath, "mzml", "master1.chrom.mzML"), backend = "pwiz")) + outData <- mzR::chromatograms(mzR::openMSfile(file.path(dataPath, "xics", "master1.chrom.mzML"), backend = "pwiz")) for(i in seq_along(outData)){ expect_equal(outData[[i]][[1]], masterXICs_DIAlignR[[1]][[i]][[1]], tolerance = 1e-04) expect_equal(outData[[i]][[2]], masterXICs_DIAlignR[[1]][[i]][[2]], tolerance = 1e-04) @@ -92,7 +92,7 @@ test_that("test_traverseUp", { outData <- readRDS(file.path(dataPath, "master1_av.rds"), refhook = NULL) for(i in 1:3) expect_equal(outData[[1]][,i], masterXICs_DIAlignR[[2]][,i+2], tolerance = 1e-04) file.remove(file.path(dataPath, "master1_av.rds")) - file.remove(file.path(dataPath, "mzml", "master1.chrom.mzML")) + file.remove(file.path(dataPath, "xics", "master1.chrom.mzML")) }) test_that("test_traverseDown", { @@ -149,7 +149,7 @@ test_that("test_traverseDown", { df3 <- df3[c(5,1,2,3,4), ]; row.names(df3) <- NULL expect_equal(multipeptide[["7040"]], df3, check.attributes = FALSE) file.remove(file.path(dataPath, "master1_av.rds")) - file.remove(file.path(dataPath, "mzml", "master1.chrom.mzML")) + file.remove(file.path(dataPath, "xics", "master1.chrom.mzML")) }) test_that("test_alignToMaster", { @@ -201,5 +201,5 @@ test_that("test_alignToMaster", { expect_equal(newMP[["14383"]], df2) file.remove(file.path(dataPath, "master1_av.rds")) - file.remove(file.path(dataPath, "mzml", "master1.chrom.mzML")) + file.remove(file.path(dataPath, "xics", "master1.chrom.mzML")) }) diff --git a/tests/testthat/test_merge_runs.R b/tests/testthat/test_merge_runs.R index 0e2fde69..243af0f7 100644 --- a/tests/testthat/test_merge_runs.R +++ b/tests/testthat/test_merge_runs.R @@ -15,7 +15,7 @@ childFeatures <- function(){ test_that("test_getNodeRun",{ skip_if_no_pyopenms() - dir.create("mzml") + dir.create("xics") ropenms <- get_ropenms(condaEnv = envName, useConda=TRUE) dataPath <- system.file("extdata", package = "DIAlignR") params <- paramsDIAlignR() @@ -55,7 +55,7 @@ test_that("test_getNodeRun",{ expect_equal(features$temp[c(2,3), c(1,3,4,8)], data.frame(transition_group_id = c(9719L, 9720L), RT = 2594.85, intensity = c(14.62899, 20.94305), m_score = c(1.041916e-03, 5.692077e-05), row.names = c(2L, 3L)), tolerance = 1e-04) - expect_identical(fileInfo["temp", "chromatogramFile"], file.path(".", "mzml", "temp.chrom.mzML")) + expect_identical(fileInfo["temp", "chromatogramFile"], file.path(".", "xics", "temp.chrom.mzML")) expect_identical(fileInfo["temp", "runName"], "temp") expect_identical(prec2chromIndex$temp[,"transition_group_id"], c(32L, 4618L, 9719L, 9720L)) expect_identical(prec2chromIndex$temp[,"chromatogramIndex"], list(rep(NA_integer_, 6), 1:6, 7:12, 13:18)) @@ -68,7 +68,7 @@ test_that("test_getNodeRun",{ data(masterXICs_DIAlignR, package="DIAlignR") - outData <- mzR::chromatograms(mzR::openMSfile(file.path(".", "mzml", "temp.chrom.mzML"), backend = "pwiz")) + outData <- mzR::chromatograms(mzR::openMSfile(file.path(".", "xics", "temp.chrom.mzML"), backend = "pwiz")) for(i in 1:6){ expect_equal(outData[[i]][[1]], masterXICs_DIAlignR[[1]][[i]][[1]], tolerance = 1e-04) expect_equal(outData[[i]][[2]], masterXICs_DIAlignR[[1]][[i]][[2]], tolerance = 1e-04) @@ -76,8 +76,8 @@ test_that("test_getNodeRun",{ outData <- readRDS("temp_av.rds", refhook = NULL) for(i in 1:3) expect_equal(outData[[2]][,i], masterXICs_DIAlignR[[2]][,i+2], tolerance = 1e-04) file.remove("temp_av.rds") - file.remove(file.path("mzml", "temp.chrom.mzML")) - unlink("mzml", recursive = TRUE) + file.remove(file.path("xics", "temp.chrom.mzML")) + unlink("xics", recursive = TRUE) }) test_that("test_getChildFeature",{ diff --git a/tests/testthat/test_post_alignment.R b/tests/testthat/test_post_alignment.R index 134a302d..872fd27f 100644 --- a/tests/testthat/test_post_alignment.R +++ b/tests/testthat/test_post_alignment.R @@ -124,7 +124,7 @@ test_that("test_setOtherPrecursors", { expect_equal(outData, df[3,]) dataPath <- system.file("extdata", package = "DIAlignR") - mz <- mzR::openMSfile(file.path(dataPath, "mzml","hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML")) + mz <- mzR::openMSfile(file.path(dataPath, "xics","hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML")) df <- multipeptide_DIAlignR[["9861"]] chromIndices <- list(c(43, 44, 45, 46, 47, 48), c(49, 50, 51, 52, 53, 54)) XICs.eXp <- lapply(chromIndices, function(i) extractXIC_group(mz, chromIndices = i)) @@ -162,7 +162,7 @@ test_that("test_reIntensity", { expect_equal(outData[1,"intensity"], 211.3709, tolerance = 1e-05) dataPath <- system.file("extdata", package = "DIAlignR") - mz <- mzR::openMSfile(file.path(dataPath, "mzml","hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML")) + mz <- mzR::openMSfile(file.path(dataPath, "xics","hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML")) df <- multipeptide_DIAlignR[["9861"]] chromIndices <- list(c(43, 44, 45, 46, 47, 48), c(49, 50, 51, 52, 53, 54)) XICs.eXp <- lapply(chromIndices, function(i) extractXIC_group(mz, chromIndices = i)) @@ -176,7 +176,7 @@ test_that("test_reIntensity", { outData <- reIntensity(df.eXp, XICs.eXp, params) expect_equal(outData[1,"intensity"], 24.50702, tolerance = 1e-05) - mz <- mzR::openMSfile(file.path(dataPath, "mzml","hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML")) + mz <- mzR::openMSfile(file.path(dataPath, "xics","hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML")) XICs.ref <- lapply(chromIndices, function(i) extractXIC_group(mz, chromIndices = i)) names(XICs.ref) <- c("9719", "9720") diff --git a/tests/testthat/test_progressive_alignment.R b/tests/testthat/test_progressive_alignment.R index d7b21bbb..6945f5f4 100644 --- a/tests/testthat/test_progressive_alignment.R +++ b/tests/testthat/test_progressive_alignment.R @@ -25,7 +25,7 @@ test_that("test_progAlignRuns", { file.remove(file.path(dataPath, "master.merged.osw")) file.remove(file.path(dataPath, "temp.temp.RData")) file.remove(list.files(dataPath, pattern = "*_av.rds", full.names = TRUE)) - file.remove(list.files(file.path(dataPath, "mzml"), pattern = "^master[0-9]+\\.chrom\\.sqMass$", full.names = TRUE)) + file.remove(list.files(file.path(dataPath, "xics"), pattern = "^master[0-9]+\\.chrom\\.sqMass$", full.names = TRUE)) skip_if_no_pyopenms() dataPath <- system.file("extdata", package = "DIAlignR") params <- paramsDIAlignR() @@ -53,6 +53,6 @@ test_that("test_progAlignRuns", { file.remove(file.path(dataPath, "master.merged.osw")) file.remove(file.path(dataPath, "temp.temp.RData")) file.remove(list.files(dataPath, pattern = "*_av.rds", full.names = TRUE)) - file.remove(list.files(file.path(dataPath, "mzml"), pattern = "^master[0-9]+\\.chrom\\.mzML$", full.names = TRUE)) + file.remove(list.files(file.path(dataPath, "xics"), pattern = "^master[0-9]+\\.chrom\\.mzML$", full.names = TRUE)) } }) diff --git a/tests/testthat/test_read_mzml.R b/tests/testthat/test_read_mzml.R index 2133e542..65f282a6 100644 --- a/tests/testthat/test_read_mzml.R +++ b/tests/testthat/test_read_mzml.R @@ -1,7 +1,7 @@ -context("Read mzml files.") +context("Read xic files.") test_that("test_readMzMLHeader",{ - mzmlName <- file.path(system.file("extdata", package = "DIAlignR"), "mzml", "hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML") + mzmlName <- file.path(system.file("extdata", package = "DIAlignR"), "xics", "hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML") expOutput <- data.frame("chromatogramId" = c("103114", "103115", "103116"), "chromatogramIndex" = c(1L,2L,3L), "polarity" = c(-1L,-1L,-1L), @@ -21,7 +21,7 @@ test_that("test_readMzMLHeader",{ }) test_that("test_readSqMassHeader",{ - sqName <- file.path(system.file("extdata", package = "DIAlignR"), "mzml", "hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass") + sqName <- file.path(system.file("extdata", package = "DIAlignR"), "xics", "hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass") expOutput <- data.frame("chromatogramId" = c("103114", "103115", "103116"), "chromatogramIndex" = c(0L,1L,2L), stringsAsFactors=FALSE) @@ -32,9 +32,9 @@ test_that("test_readSqMassHeader",{ test_that("test_getMZMLpointers",{ dataPath <- system.file("extdata", package = "DIAlignR") - fileInfo <- data.frame("chromatogramFile" = c(file.path(dataPath, "mzml", "hroest_K120808_Strep10%PlasmaBiolRepl1_R03_SW_filt.chrom.mzML"), - file.path(dataPath, "mzml", "hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML"), - file.path(dataPath, "mzml", "hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML")), + fileInfo <- data.frame("chromatogramFile" = c(file.path(dataPath, "xics", "hroest_K120808_Strep10%PlasmaBiolRepl1_R03_SW_filt.chrom.mzML"), + file.path(dataPath, "xics", "hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML"), + file.path(dataPath, "xics", "hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.mzML")), row.names = c("run0", "run1", "run2"), stringsAsFactors=FALSE) outData <- getMZMLpointers(fileInfo) @@ -42,9 +42,9 @@ test_that("test_getMZMLpointers",{ expect_is(outData[["run1"]], "mzRpwiz") expect_is(outData[["run2"]], "mzRpwiz") - fileInfo <- data.frame("chromatogramFile" = c(file.path(dataPath, "mzml", "hroest_K120808_Strep10%PlasmaBiolRepl1_R03_SW_filt.chrom.sqMass"), - file.path(dataPath, "mzml", "hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass"), - file.path(dataPath, "mzml", "hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass")), + fileInfo <- data.frame("chromatogramFile" = c(file.path(dataPath, "xics", "hroest_K120808_Strep10%PlasmaBiolRepl1_R03_SW_filt.chrom.sqMass"), + file.path(dataPath, "xics", "hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass"), + file.path(dataPath, "xics", "hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt.chrom.sqMass")), row.names = c("run0", "run1", "run2"), stringsAsFactors=FALSE) outData <- getMZMLpointers(fileInfo) diff --git a/vignettes/DIAlignR-vignette.Rmd b/vignettes/DIAlignR-vignette.Rmd index a9b1e391..9786915e 100644 --- a/vignettes/DIAlignR-vignette.Rmd +++ b/vignettes/DIAlignR-vignette.Rmd @@ -68,10 +68,10 @@ pyprophet score --in=merged.osw --classifier=XGBoost --level=ms2 --xeval_num_ite pyprophet peptide --in=merged.osw --context=experiment-wide ``` -| Congrats! Now we have raw chromatogram files and associated scored features in merged.osw files. Move all .chrom.mzML files in `mzml` directory and merged.osw file in `osw` directory. The parent folder is given as `dataPath` to DIAlignR functions. +| Congrats! Now we have raw chromatogram files and associated scored features in merged.osw files. Move all .chrom.mzML files in `xics` directory and merged.osw file in `osw` directory. The parent folder is given as `dataPath` to DIAlignR functions. ## Performing alignment on DIA runs -`alignTargetedRuns` function aligns Proteomics or Metabolomics DIA runs. It expects two directories "osw" and "mzml" at `dataPath`. It outputs an intensity table where rows specify each analyte and columns specify runs. Use parameter `saveFiles = TRUE` to have aligned retetion time and intensities saved in the current directory. +`alignTargetedRuns` function aligns Proteomics or Metabolomics DIA runs. It expects two directories "osw" and "xics" at `dataPath`. It outputs an intensity table where rows specify each analyte and columns specify runs. Use parameter `saveFiles = TRUE` to have aligned retetion time and intensities saved in the current directory. ```{r, results=FALSE, message=FALSE, warning=FALSE} runs <- c("hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt", @@ -86,7 +86,7 @@ alignTargetedRuns(dataPath = dataPath, outFile = "test.csv", runs = NULL, oswMer ## Investigating alignment of analytes -For getting alignment object which has aligned indices of XICs `getAlignObjs` function can be used. Like previous function, it expects two directories "osw" and "mzml" at `dataPath`. It performs alignment for exactly two runs. In case of `refRun` is not provided, m-score from osw files is used to select reference run. +For getting alignment object which has aligned indices of XICs `getAlignObjs` function can be used. Like previous function, it expects two directories "osw" and "xics" at `dataPath`. It performs alignment for exactly two runs. In case of `refRun` is not provided, m-score from osw files is used to select reference run. ```{r, message=FALSE} runs <- c("hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt", "hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt") diff --git a/vignettes/DIAlignR-vignette.html b/vignettes/DIAlignR-vignette.html index 2dba633d..14cd8fce 100644 --- a/vignettes/DIAlignR-vignette.html +++ b/vignettes/DIAlignR-vignette.html @@ -1569,18 +1569,18 @@ line-height: normal; } -code > span.kw { color: #E07020; } -code > span.dt { color: #404040; } -code > span.dv { color: #D02070; } -code > span.bn { color: #d14; } -code > span.fl { color: #D02070; } -code > span.ch { color: #40A040; } -code > span.st { color: #40A040; } -code > span.co { color: #808080; font-style: italic; } -code > span.ot { color: #2020F0; } -code > span.al { color: #ff0000; font-weight: bold; } -code > span.fu { color: #E07020; } -code > span.er { color: #FF0000; } +code > span.kw { color: #E07020; } +code > span.dt { color: #404040; } +code > span.dv { color: #D02070; } +code > span.bn { color: #d14; } +code > span.fl { color: #D02070; } +code > span.ch { color: #40A040; } +code > span.st { color: #40A040; } +code > span.co { color: #808080; font-style: italic; } +code > span.ot { color: #2020F0; } +code > span.al { color: #ff0000; font-weight: bold; } +code > span.fu { color: #E07020; } +code > span.er { color: #FF0000; } code > span.identifier { color: #404040; } code > span.number { color: #D02070; } code > span.string { color: #40A040; } @@ -1898,11 +1898,11 @@

0.2 Prepare input files for align pyprophet score --in=merged.osw --classifier=XGBoost --level=ms2 --xeval_num_iter=3 \ --ss_initial_fdr=0.05 --ss_iteration_fdr=0.01 pyprophet peptide --in=merged.osw --context=experiment-wide -
  Congrats! Now we have raw chromatogram files and associated scored features in merged.osw files. Move all .chrom.mzML files in mzml directory and merged.osw file in osw directory. The parent folder is given as dataPath to DIAlignR functions.
+
  Congrats! Now we have raw chromatogram files and associated scored features in merged.osw files. Move all .chrom.mzML files in xics directory and merged.osw file in osw directory. The parent folder is given as dataPath to DIAlignR functions.

0.3 Performing alignment on DIA runs

-

alignTargetedRuns function aligns Proteomics or Metabolomics DIA runs. It expects two directories “osw” and “mzml” at dataPath. It outputs an intensity table where rows specify each analyte and columns specify runs. Use parameter saveFiles = TRUE to have aligned retetion time and intensities saved in the current directory.

+

alignTargetedRuns function aligns Proteomics or Metabolomics DIA runs. It expects two directories “osw” and “xics” at dataPath. It outputs an intensity table where rows specify each analyte and columns specify runs. Use parameter saveFiles = TRUE to have aligned retetion time and intensities saved in the current directory.

runs <- c("hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt",
           "hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt")
 params <- paramsDIAlignR()
@@ -1914,11 +1914,11 @@ 

0.3 Performing alignment on DIA r

0.4 Investigating alignment of analytes

-

For getting alignment object which has aligned indices of XICs getAlignObjs function can be used. Like previous function, it expects two directories “osw” and “mzml” at dataPath. It performs alignment for exactly two runs. In case of refRun is not provided, m-score from osw files is used to select reference run.

+

For getting alignment object which has aligned indices of XICs getAlignObjs function can be used. Like previous function, it expects two directories “osw” and “xics” at dataPath. It performs alignment for exactly two runs. In case of refRun is not provided, m-score from osw files is used to select reference run.

runs <- c("hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt",
           "hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt")
 AlignObjLight <- getAlignObjs(analytes = 4618L, runs = runs, dataPath = dataPath, objType   = "light", params = params)
-#> [1] "hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt" 
+#> [1] "hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt"
 #> [2] "hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt"
 #> [1] "Finding reference run using SCORE_PEPTIDE table"
 # First element contains names of runs, spectra files, chromatogram files and feature files.
@@ -1935,7 +1935,7 @@ 

0.4 Investigating alignment of an names(as.list(obj)) #> [1] "indexA_aligned" "indexB_aligned" "score" AlignObjMedium <- getAlignObjs(analytes = 4618L, runs = runs, dataPath = dataPath, objType = "medium", params = params) -#> [1] "hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt" +#> [1] "hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt" #> [2] "hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt" #> [1] "Finding reference run using SCORE_PEPTIDE table" obj <- AlignObjMedium[[2]][["4618"]][[1]][["AlignObj"]] @@ -1955,7 +1955,7 @@

0.5 Visualizing the aligned chrom
runs <- c("hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt",
  "hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt")
 AlignObj <- getAlignObjs(analytes = 4618L, runs = runs, dataPath = dataPath, params = params)
-#> [1] "hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt" 
+#> [1] "hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt"
 #> [2] "hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt"
 #> [1] "Finding reference run using SCORE_PEPTIDE table"
 plotAlignedAnalytes(AlignObj, annotatePeak = TRUE)
@@ -1968,7 +1968,7 @@

0.6 Visualizing the alignment pat runs <- c("hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt", "hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt") AlignObjOutput <- getAlignObjs(analytes = 4618L, runs = runs, params = params, dataPath = dataPath, objType = "medium") -#> [1] "hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt" +#> [1] "hroest_K120809_Strep0%PlasmaBiolRepl2_R04_SW_filt" #> [2] "hroest_K120809_Strep10%PlasmaBiolRepl2_R04_SW_filt" #> [1] "Finding reference run using SCORE_PEPTIDE table" plotAlignmentPath(AlignObjOutput)

@@ -1984,56 +1984,56 @@

0.8 Session Info

#> R version 4.0.2 (2020-06-22) #> Platform: x86_64-pc-linux-gnu (64-bit) #> Running under: Ubuntu 16.04.6 LTS -#> +#> #> Matrix products: default #> BLAS: /usr/lib/libblas/libblas.so.3.6.0 #> LAPACK: /usr/lib/lapack/liblapack.so.3.6.0 -#> +#> #> locale: -#> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C -#> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=C -#> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 -#> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C -#> [9] LC_ADDRESS=C LC_TELEPHONE=C -#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C -#> +#> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C +#> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=C +#> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 +#> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C +#> [9] LC_ADDRESS=C LC_TELEPHONE=C +#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C +#> #> attached base packages: -#> [1] stats graphics grDevices utils datasets methods base -#> +#> [1] stats graphics grDevices utils datasets methods base +#> #> other attached packages: -#> [1] lattice_0.20-41 BiocStyle_2.16.0 DIAlignR_1.0.5 -#> +#> [1] lattice_0.20-41 BiocStyle_2.16.0 DIAlignR_1.0.5 +#> #> loaded via a namespace (and not attached): -#> [1] nlme_3.1-147 ProtGenerics_1.20.0 fs_1.4.2 -#> [4] usethis_1.6.1 devtools_2.3.0 bit64_0.9-7.1 -#> [7] RColorBrewer_1.1-2 rprojroot_1.3-2 tools_4.0.2 -#> [10] backports_1.1.8 R6_2.4.1 DBI_1.1.0 -#> [13] BiocGenerics_0.34.0 colorspace_1.4-1 withr_2.2.0 -#> [16] tidyselect_1.1.0 gridExtra_2.3 prettyunits_1.1.1 -#> [19] processx_3.4.3 phangorn_2.5.5 bit_1.1-15.2 -#> [22] compiler_4.0.2 cli_2.0.2 Biobase_2.48.0 -#> [25] xml2_1.3.2 desc_1.2.0 labeling_0.3 -#> [28] bookdown_0.20 scales_1.1.1 quadprog_1.5-8 -#> [31] callr_3.4.3 stringr_1.4.0 digest_0.6.25 -#> [34] rmarkdown_2.3 jpeg_0.1-8.1 pkgconfig_2.0.3 -#> [37] htmltools_0.5.0 sessioninfo_1.1.1 rlang_0.4.7 -#> [40] rstudioapi_0.11 RSQLite_2.2.0 generics_0.0.2 -#> [43] farver_2.0.3 zoo_1.8-8 jsonlite_1.7.0 -#> [46] dplyr_1.0.0 magrittr_1.5 Matrix_1.2-18 -#> [49] Rcpp_1.0.5 munsell_0.5.0 fansi_0.4.1 -#> [52] ape_5.4 reticulate_1.16 lifecycle_0.2.0 -#> [55] stringi_1.4.6 yaml_2.2.1 MASS_7.3-51.6 -#> [58] pkgbuild_1.1.0 grid_4.0.2 blob_1.2.1 -#> [61] parallel_4.0.2 crayon_1.3.4 mzR_2.22.0 -#> [64] knitr_1.29 ps_1.3.3 pillar_1.4.6 -#> [67] igraph_1.2.5 codetools_0.2-16 pkgload_1.1.0 -#> [70] fastmatch_1.1-0 glue_1.4.1 evaluate_0.14 +#> [1] nlme_3.1-147 ProtGenerics_1.20.0 fs_1.4.2 +#> [4] usethis_1.6.1 devtools_2.3.0 bit64_0.9-7.1 +#> [7] RColorBrewer_1.1-2 rprojroot_1.3-2 tools_4.0.2 +#> [10] backports_1.1.8 R6_2.4.1 DBI_1.1.0 +#> [13] BiocGenerics_0.34.0 colorspace_1.4-1 withr_2.2.0 +#> [16] tidyselect_1.1.0 gridExtra_2.3 prettyunits_1.1.1 +#> [19] processx_3.4.3 phangorn_2.5.5 bit_1.1-15.2 +#> [22] compiler_4.0.2 cli_2.0.2 Biobase_2.48.0 +#> [25] xml2_1.3.2 desc_1.2.0 labeling_0.3 +#> [28] bookdown_0.20 scales_1.1.1 quadprog_1.5-8 +#> [31] callr_3.4.3 stringr_1.4.0 digest_0.6.25 +#> [34] rmarkdown_2.3 jpeg_0.1-8.1 pkgconfig_2.0.3 +#> [37] htmltools_0.5.0 sessioninfo_1.1.1 rlang_0.4.7 +#> [40] rstudioapi_0.11 RSQLite_2.2.0 generics_0.0.2 +#> [43] farver_2.0.3 zoo_1.8-8 jsonlite_1.7.0 +#> [46] dplyr_1.0.0 magrittr_1.5 Matrix_1.2-18 +#> [49] Rcpp_1.0.5 munsell_0.5.0 fansi_0.4.1 +#> [52] ape_5.4 reticulate_1.16 lifecycle_0.2.0 +#> [55] stringi_1.4.6 yaml_2.2.1 MASS_7.3-51.6 +#> [58] pkgbuild_1.1.0 grid_4.0.2 blob_1.2.1 +#> [61] parallel_4.0.2 crayon_1.3.4 mzR_2.22.0 +#> [64] knitr_1.29 ps_1.3.3 pillar_1.4.6 +#> [67] igraph_1.2.5 codetools_0.2-16 pkgload_1.1.0 +#> [70] fastmatch_1.1-0 glue_1.4.1 evaluate_0.14 #> [73] latticeExtra_0.6-29 remotes_2.1.1 BiocManager_1.30.10 -#> [76] png_0.1-7 vctrs_0.3.2 testthat_2.3.2 -#> [79] gtable_0.3.0 purrr_0.3.4 tidyr_1.1.0 -#> [82] assertthat_0.2.1 ggplot2_3.3.2 xfun_0.15 -#> [85] pracma_2.2.9 roxygen2_7.1.1 ncdf4_1.17 -#> [88] signal_0.7-6 tibble_3.0.3 memoise_1.1.0 +#> [76] png_0.1-7 vctrs_0.3.2 testthat_2.3.2 +#> [79] gtable_0.3.0 purrr_0.3.4 tidyr_1.1.0 +#> [82] assertthat_0.2.1 ggplot2_3.3.2 xfun_0.15 +#> [85] pracma_2.2.9 roxygen2_7.1.1 ncdf4_1.17 +#> [88] signal_0.7-6 tibble_3.0.3 memoise_1.1.0 #> [91] ellipsis_0.3.1