Comments (2)
Just some timings for fetching the data with and without filter.
The goal is to find MS2 spectra with a peak at an m/z of about 195.08
. Below we use a CompDb
with the full HMDB version 4.1.
library(CompoundDb)
cdb <- CompDb("CompDb.Hsapiens.HMDB.4.1.sqlite")
mz_in <- 195.08
## Get all spectra
system.time(all <- spectra(cdb))
user system elapsed
49.169 5.952 55.404
## Get all spectra with peaks potentially in the same region
system.time(subs <- spectra(cdb, filter = ~ msms_mz_range_min <= mz_in & msms_mz_range_max >= mz_in))
user system elapsed
15.723 2.852 18.716
length(all)
[1] 458901
length(subs)
[1] 187798
Still quite some spectra were retrieved, but the performance is better with the filter.
from compounddb.
Now proceeding with finding the spectra that have an actual m/z matching 195.08
(using the hasMz
method from #28).
system.time(all_has_pk <- hasMz(all, mz = mz_in, ppm = 20))
user system elapsed
10.930 0.203 11.212
system.time(subs_has_pk <- hasMz(subs, mz = mz_in, ppm = 20))
user system elapsed
4.058 0.044 4.128
sum(all_has_pk)
[1] 591
sum(sus_has_pk)
[1] 590
The same spectra were detected, with the exception of one, that was missed because the filter with msms_mz_range_min
and msms_mz_range_max
did not consider a ppm
.
from compounddb.
Related Issues (20)
- Create an IonDb with all theoretical adducts for a CompoundDb
- Function to combine/concatenate CompDb databases
- Add an insertCompound function HOT 1
- Availability of functions to create empty CompDB and insert and delete compounds HOT 2
- Seeking suggestions for database development (HMDB version 5) HOT 2
- Pass skipErrors to read.SDFset through compound_tbl_sdf? HOT 4
- Replace mass2mz and mz2mass with the ones from MetaboCoreUtils
- Rename table "compound" into "ms_compound"
- Implement a StandardsDb that extends CompoundDb HOT 11
- Update the MsBackendCompDb HOT 1
- insertIon method HOT 4
- non integer msLevel values HOT 3
- Add possibility to delete (inserted or existing) ions or MS/MS spectra
- Prepare for Bioconductor submission HOT 3
- Arbitrary columns in insertIon
- Transfer of CompoundDb
- Support import from MoNa MSP files HOT 1
- custom Db - spectra and ion Db questions HOT 2
- Issue with GitHub install of CompoundDb HOT 3
- mass2mz method for CompDb HOT 6
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 compounddb.