Disable ProgressBar when running xcms::chromatogram
Hello,
I use xcms::chromatogram a lot for obtaining EICs of peaks that I'm interested in. I am now trying to apply it thousands of times but would like some way of getting rid of the progress bar that appears every time. Is there a simple way to do this?
Your help is much appreciated.
-Hani
Which version of xcms are you using? Ideally, post the output from sessionInfo() here. What you could try is to use suppressMessages(chromatogram... ) . Another suggestion - it can be quite inefficient to run chromatogram() in a loop since each time part of the data is loaded. It might be more efficient and faster to define a matrix with two columns with the lower and upper RT of the regions of interest and the same for the lower and upper m/z. Each row in these two matrices would then define the RT-m/z region for one EIC. you can then pass these matrices, say rtr and mzr with parameters rt and mz to chromatogram: chromatogram(..., rt = rtr, mz = mzr)`. That will load the data once and extract the EICs in an internal loop.
Also, maybe more convenient, there are now the chromPeakChromatograms() and featureChromatograms() functions that allow to extract EICs for detected chromatographic peaks or features.
Hey Johannes, Good to hear from you. Your two column suggestion does seem much better. Guess I didn't realize this was an option, though it is spelled out in the documentation.
By the way, I am getting around to using the new functionality (chromPeakSummary) for the purposes of identifying and removing flat, non-gaussian peaks and features (per the tutorial). Is there a function that filters peaks based on low beta_cor values? The XCMS version I'm using is 4.6.4.
Actually, at present, we only have the filterChromPeaks() function that takes the indices of the chrom peaks to keep (parameter keep). So, you would need to use the chromPeakSummary() first, then based on the returned result, get the indices of the chrom peaks you want to keep and use that with the filterChromPeaks() function to filter/remove the poor quality peaks.
But it's true, we should actually implement a more convenient way to filter (/refine) chrom peaks based on the beta cor values.