Comments (2)
Writing unit tests comparing the results from matchedFilter
with and without iterative buffering I stumbled across another problem from the iterative buffering concept:
- In each
profBin
call the bin size is calculated anew and, due to rounding errors (imprecision of floating point numbers), this will result in slightly different bin sizes in repetitive calls. Under certain conditions this can affect the binning and even result in presumably wrong results (such as in the example below forstep = 0.2
).
library(xcms)
f <- system.file('cdf/KO/ko15.CDF', package = "faahKO")
xr <- xcmsRaw(f)
mz <- xr@env$mz
int <- xr@env$intensity
scantime <- xr@scantime
scanindex <- xr@scanindex
valsPerSpect <- diff(c(scanindex, length(mz)))
step <- 0.2
## Run the feature detection using iterations.
A <- xcms:::do_detectFeatures_matchedFilter(mz, int, scantime, valsPerSpect, step = step)
## Run the feature detection without iterations.
B <- xcms:::do_detectFeatures_matchedFilter_no_iter(mz, int, scantime, valsPerSpect, step = step)
all.equal(A, B)
[1] "Mean relative difference: 0.7609699"
## If we run the implementation using binYonX with iteration.
C <- xcms:::do_detectFeatures_matchedFilter_binYonX_iter(mz, int, scantime, valsPerSpect, step = step)
all.equal(B, C)
[1] TRUE
## Or binYonX without iteration
D <- xcms:::do_detectFeatures_matchedFilter_binYonX_no_iter(mz, int, scantime, valsPerSpect, step = step)
all.equal(B, D)
[1] TRUE
The *_matchedFilter_binYonX_iter
implementation calculates the breaks defining the bins once and re-uses them in each iteration thus avoiding the above described problem.
The conclusion from this is that the iterative buffering adds to data insecurity and potentially leads to a wrong binning result. I thus strongly suggest that we change this in the new code for xcms3
.
from xcms.
Closing because we changed the default to use the new code in version > 1.51.1.
from xcms.
Related Issues (20)
- Dataset Error Report HOT 5
- About spectra simplify HOT 4
- Cannot read mzdata.xml file HOT 3
- findChromPeaks returns duplicate peaks HOT 6
- adjustRtime() Error HOT 8
- Centwave error with converted .wiff files. HOT 1
- Error Invalid cvParam accession "1003293" HOT 1
- Handling multtest dependency (BioC build error) HOT 3
- Two overlapping peaks with the same m/z detected as one HOT 2
- Does minSamples override minFraction when grouping? HOT 2
- ERROR: Dimensions of profile matrices do not match ! HOT 1
- Why does fill peaks with XCMSnExp object result in considerably less features than fill peaks with XCMSset? HOT 6
- How are features obtained if you donβt specify any class information for grouping? HOT 1
- Add XCMS object as data to EDAM Ontology HOT 4
- Introduce a changelog HOT 1
- combineSpectra of a feature HOT 3
- xcmsRaw - error HOT 6
- return EIC with peak detection output HOT 1
- Polarity cannot be extracted HOT 3
- Error in writeMSData HOT 1
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.