Comments (3)
I dove a little bit deeper into the code and it's likely an indexing issue. I've extracted the values that go into getEIC
in order to extract the result from the function. Using the variables from the previous code gives us the following plot (black = original chromatogram, red = EIC chromatogram):
scanindex <- 1:length(rts) - 1
mzrange <- c(1, 1)
sr <- c(1, length(rts))
eic <- .Call("getEIC", mzs, intensities, as.integer(scanindex), as.double(mzrange),
as.integer(sr), as.integer(length(scanindex)),
PACKAGE = "xcms"
)
plot(intensities, type = "l", ylim = c(0, 2e5))
lines(eic$intensity, col = "red")
It seems that the getEIC
function adds the previous scan intensity to the current scan intensity. A one-liner using dplyr confirms this:
points(intensities + dplyr::lag(intensities, n = 1), col = "green")
I haven't found the solution yet, but it's either in the loop in getScanEIC
, or in the lowerBound
or upperBound
functions:
Lines 440 to 447 in db80f2c
from xcms.
Hi, thanks for the report, we should turn this into a unit test once we've figured exactly what's going on.
Yours, Steffeb
from xcms.
Thanks Steffen,
Interestingly, this issue does not occur in the S4 method findChromPeaks
. It specifically occurs in the do_*
version of the method.
# Load library
library(xcms)
# Select MRM mzML from msdata package
data <- readSRMData(system.file("proteomics", "MRM-standmix-5.mzML.gz", package = "msdata"))
# Use 0.1 - 1 due to RT being in minutes
data <- findChromPeaks(data[5, ], CentWaveParam(peakwidth = c(0.1, 1)))
chromPeaks(data)
Returns the top peak with the correct maxo of 61141.1367
from xcms.
Related Issues (20)
- Suggested starting parameters for GC-MS data HOT 3
- reconstructChromPeakSpectra HOT 1
- Filter MsExperiment object by spectraData filterString HOT 16
- Bad practices with peak merging HOT 2
- msLevel=2L chromatograms (MRM or SRM) not working with MsExperiment interface HOT 1
- precusor charge for each features HOT 3
- fillChromPeaks error HOT 2
- Trouble plotting XChromatograms HOT 5
- R CMD check problems HOT 5
- xset crashes on MAC OS 14.3 R 4.3.3 , BiocManager 1.30.22 and xcms 4.0.2 HOT 6
- Update retention times to alkane retention time indices for GC-MS HOT 5
- The error message encountered when using the "IPO" package HOT 10
- Error for XIC plot of timsTof data HOT 3
- Best way to document additional XCMS object processing steps in the ProcessHistory slot? HOT 3
- After I perform chromatographic peak detection, how do I confirm the quality of my peaks? HOT 1
- Ways to extract all MS2 peaks? HOT 3
- Best way to deconvolute metabolite data HOT 1
- Waters data problems with Obiwarp HOT 9
- Support excluding samples for PeakDensity correspondence
- Visualize, use plotSpectraMirror function to draw spectrum matching results HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xcms.