Comments (4)
What I meant with CompDb
is missing is the following:
idb <- IonDb(dbcon = icon, CompDb = cdb)
is supposed to create a new IonDb database from content taken from the CompDb cdb
. We should however also allow a call like:
idb <- IonDb(dbcin = icon)
in which case icon
is expected to be the database connection to an already existing IonDb (with all the required tables). This call should allow users to load a previously created database.
So, the IonDb
function should be something like:
IonDb <- function(dbcon, CompDb) {
if (!missing(CompDb)) {
## Call a function that copies the content from CompDb over to dbcon
## and create the other required tables for IonDb in dbcon
}
## assign dbcon to @dbcon, check validity of the database and return it
}
from compounddb.
I try to explain the expected workflow: the user is supposed to have created (or downloaded) first a CompDb
with compound annotations from e.g. HMDB. The goal would be to add also ion information to that database an hence convert the database to a IonDb
.
One possible workflow would be, given that cdb
is an existing CompDb
and ions
is a data.frame
with ion information the user wants to add:
## create a new SQLite database that will contain the IonDb
idbcon <- dbConnect(SQLite(), "my_ion_db.sqlite")
## add ions to the database:
idb <- insertIons(cdb, ions, dbcon = idbcon)
## What this call needs to do:
## - copy all content from the original `cdb` to the new database
## - create the ms_ion table and add the ions to that
## - return an IonDb object
If the user wants to add additional ions it would be much easier, because he/she has already an IonDb
:
## no need here to specify a different database or copy content, because `idb` does already have
## the required table and is expected to be read-write
idb <- insertIons(idb, ions)
I agree that this workflow is not that intuitive - because we're changing from a CompDb
to a IonDb
with the insertIons
call. Maybe we should think of an alternative @andreavicini ?
from compounddb.
What about: insertIons
is only defined for IonDb
objects? The user would need to create first a IonDb
database/object with the IonDb
constructor function:
icon <- dbConnect(SQLite(), "my_ion_db.sqlite")
idb <- IonDb(dbcon = icon, CompDb = cdb)
A call like the one above is supposed to copy all tables from the CompDb
over to dbcon
and create in addition the ms_ion
table and return the IonDb
object with the connection to the new database (dbcon
). If CompDb
is missing the specified database connection is supposed to be for a database containing already the tables needed for an IonDb
.
From here on insertIons
could be called to insert ions in the new database.
Would that be a better workflow? @andreavicini what do you think?
from compounddb.
I like this second approach and maybe it's a bit clearer. I'm not sure if I understood what you mean in the case CompDb
is missing. Should it have like empty tables for each of the required tables?
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
- 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.