Introduction to MSEADbi and MSEA.XXX.pb.db packages"


MSEADbi makes it easy to generate your own annotation package for MSEA. The package design is the same as MeSHDbi or LRBaseDbi, and the usage is also the same.

This document provides the way to use MSEADbi and MSEA.XXX.pb.db packages. MSEA.XXX.pb.db packages provide the metabolite set by pathway for XXX species in the PathBank database. The packages are generated by the MSEADbi package. MSEADbi has a role; the construction of MSEA.XXX.pb.db packages. The makeMSEAPackage function of MSEADbi generates the user's original MSEA.XXX.pb.db packages.


Here we use makeMSEAPackage function to create a MSEA.XXX.pb.db package. Only user have to specify are 1. a csv file that is filtered to include only the lines of a species in PathBank Data File (Metabolite names linked to PathBank primary pathways CSV) and 2. a meta table describing the PathBank data. Here we use the demo data of Arabidopsis thaliana of PathBank primary pathways CSV.

tmp <- tempdir()

ath <- system.file("extdata","MSEA.Ath.pb.db_DATA.csv",package="MSEADbi")
meta <- system.file("extdata","MSEA.Ath.pb.db_METADATA.csv",package="MSEADbi")
athDf <- read.csv(ath, fileEncoding="utf8")
metaDf <- read.csv(meta)
# We need to avoid DOT from the column names (to query with the names)
names(athDf) <- gsub("\\.", "", names(athDf))
names(metaDf) <- gsub("\\.", "", names(metaDf))

makeMSEAPackage(pkgname = "MSEA.Ath.pb.db", data=athDf, metadata=metaDf,
organism = "Arabidopsis thaliana", version = "0.99.0",
maintainer = "Kozo Nishida <>", author = "Kozo Nishida",
destDir = tmp, license = "Artistic-2.0")

mseaPackageDir = paste(tmp, "MSEA.Ath.pb.db", sep="/")
install.packages(mseaPackageDir, repos=NULL, type="source")

columns, keytypes, and select

All MSEA.XXX.pb.db package has same name object and it is instantiated by MSEADbclass. Many data access function for this object are implmented. For example, columns returns the rows which we can retrieve in MSEA.XXX.pb.db packages. keytypes returns the rows which can be used as the optional parameter in keys and select functions against MSEA.XXX.pb.db packages. select function returns the rows in particular columns, which are having user-specified keys. This function returns the result as a dataframe.


ids <- c('SMP0012018', 'SMP0012019')
select(MSEA.Ath.pb.db, ids, c("MetaboliteID", "CAS", "HMDBID", "ChEBIID", 
    "KEGGID"), "PathBankID")

cls <- columns(MSEA.Ath.pb.db)
kts <- keytypes(MSEA.Ath.pb.db)
kt <- kts[2]
ks <- head(keys(MSEA.Ath.pb.db, keytype = kts[2]))
res <- select(MSEA.Ath.pb.db, keys = ks, columns = cls, keytype = kt)

Other functions

Other additional functions like species, dbInfo, and dbconn are available. In each MSEA.XXX.pb.db package, species function returns the common name. dbInfo returns the information of the package. dbfile returns the directory where sqlite file is stored. dbschema returns the schema of database. dbconn returns the connection to the sqlite database.



FILL bibtex for PathBank

Session information {.unnumbered}

Here is the output of sessionInfo() on the system on which this document was compiled:


Try the MSEADbi package in your browser

Any scripts or data that you put into this service are public.

MSEADbi documentation built on Nov. 8, 2020, 7:29 p.m.