shubham1637 / DIAlignR

This is a R package for alignment of DIA mass-spec data
5 stars 1 forks source link

Error in (function (classes, fdef, mtable) : cannot find inherited method for function 'dbGetQuery’ for signature '"mzRpwiz", "character”' #22

Open bruadi opened 1 year ago

bruadi commented 1 year ago

Hi, a new problem has appeared. I always get the message:

Error in (function (classes, fdef, mtable) : cannot find inherited method for function 'dbGetQuery' for signature '"mzRpwiz", "character"'.

library(DIAlignR) dataPath <- "/Users/.../Documents/Paper/try" params <- paramsDIAlignR() params[["runType"]] <- "DIA_Metabolomics" params[["context"]] <- "experiment-wide" params[["chromFile"]] <- 'mzML' alignTargetedRuns(dataPath = dataPath, outFile = "test.csv", runs = NULL, oswMerged = TRUE, params = params) Looking for merged.osw file. 13 runs are in merged.osw file 13 .chrom.mzML files are found. Following runs will be aligned: [1] "180712_PS-B1-3-101" "180712_PS-B1-3-103" "180712_PS-B1-3-20" [4] "180712_PS-B1-3-46" "180712_PS-B1-3-48" "180712_PS-B1-3-90" [7] "18625_PS-B1-109" "18625_PS-B1-117" "18625_PS-B1-119"
[10] "18625_PS-B1-130" "18625_PS-B1-133" "18625_PS-B1-134"
[13] "18625_PS-B1-136"
405 precursors are found. The execution time for getting precursors: Time difference of 0.01578689 secs 5265 peptides scores are fetched. The execution time for fetching peptide scores: Time difference of 1.004398 secs Calculating reference run for each peptide. The execution time for calculating a reference run: Time difference of 0.07623196 secs 19 peakgroups are found below 0.05 FDR in run 180712_PS-B1-3-101, ID = 4048074721523380537 .... The execution time for fetching features: Time difference of 0.5495172 secs Collecting metadata from mzML files. Metadata is collected from mzML files. The execution time for getting pointers: Time difference of 5.518783 secs Collecting chromatogram indices for all precursors.

Fetched chromatogram indices from /Users/adrianbrun/Documents/Paper/try/xics/18625_PS-B1-136.chrom.mzML The execution time for getting chromatogram indices: Time difference of 1.560749 secs Building multipeptide. 405 peptides are in the multipeptide. The execution time for building multipeptide: Time difference of 3.863176 secs Calculating global alignments. Geting global alignment of run10 and run0,Increasing maxFdrGlobal 10 times n = 10 Geting global alignment of run10 and run1,Increasing maxFdrGlobal 10 times n = 7

Geting global alignment of run6 and run12,Increasing maxFdrGlobal 10 times n = 10 The execution time for calculating global alignment: Time difference of 0.3936419 secs Performing reference-based alignment. Processing Batch 1 Error in (function (classes, fdef, mtable) : cannot find inherited method for function 'dbGetQuery' for signature '"mzRpwiz", "character"'.

Sorry for all the questions, however I am not very familiar with R... . Is this error message due to me?

Many greetings

singjc commented 1 year ago

Hi,

This is most likely an issue with using mzML files instead of sqMass files. I can try backtrace where this error occurs, but I would suggest for now to convert your mzML files to sqMass files. This would also make the processing of the alignment much faster, because API and access for the sqMass sqlite files are much faster than the current API used to access mzML files.

You can convert the mzML files to sqMass using the OpenSwathMzMLFileCacher tool from OpenMS.

Example:

OpenSwathMzMLFileCacher -in filename.chrom.mzML -out filename.chrom.sqMass -lossy_compression false -threads 8

Justin

shubham1637 commented 1 year ago

The files must be in the same hierarchy as shown here https://github.com/shubham1637/DIAlignR/tree/master/inst/metabo

An example code is given here: https://github.com/shubham1637/DIAlignR/blob/bb2617b2a7deeac8a9c53017cbe103710e9a207c/tests/testthat/test_align_dia_runs.R#L132

It looks like the matching .chrom.sqMass files are missing. Either you forget to put them in the folder or names are incorrecrt.

bruadi commented 1 year ago

Hi, now everything works, thanks! Greetings