# #——风格,回声= FALSE,结果=“黑名单”,消息= FALSE --------------------- BiocStyle:减价 () ## ---- 回声= FALSE,消息= FALSE ------------------------------------------- 库(光谱)knitr: opts_chunk设置美元(呼应= TRUE,消息= FALSE)图书馆(BiocStyle) # #——load-libs ---------------------------------------------------------------- 库(光谱)库(MsBackendMassbank) fls的< - dir(系统。文件(“extdata”,包=“MsBackendMassbank”),full.names = TRUE,模式=“txt美元”)fls的# #,导入 ------------------------------------------------------------------- sps < -光谱(fls的[1],源= MsBackendMassbank(),后端= MsBackendDataFrame ()) ## ---- spectravars -------------------------------------------------------------- spectraVariables (sps) # #——import2 ------------------------------------------------------------------ sps < -光谱(fls的[1],源= MsBackendMassbank (),后端= MsBackendDataFrame ()) spectraVariables (sps) # #——元数据 ----------------------------------------------------------------- # 与元数据创建数据帧显示块应当阅读。metaDataBlocks <- data.frame(metadata = c("ac", "ch", "sp", "ms", "record", "pk", "comment"), read = rep(TRUE, 7)) sps <- Spectra(fls[-1], source = MsBackendMassbank(), backend = MsBackendDataFrame(),metaBlock = metaDataBlocks) #所有可能spectraVariables MassBank读取spectraVariables (sps) #所有NA列可以删除spectraVariables (dropNaSpectraVariables (sps )) ## ---- 仪器 --------------------------------------------------------------- sps rtime sps标题# #美元——mz ----------------------------------------------------------------------- mz (sps)强度(sps) # #——所有进口,eval = FALSE ------------------------------------------------- # sps < -光谱(fls的,源= MsBackendMassbank(),不间断= TRUE) # #——mysql, eval = FALSE ------------------------------------------------------ # 库(RMariaDB) # < - dbConnect监狱(MariaDB(),主机=“localhost”,用户=“massbank”,# dbname = " massbank ") ## ---- sqlite ------------------------------------------------------------------- 图书馆(RSQLite) < - dbConnect监狱(SQLite()系统。文件(“sql”、“minimassbank。sqlite”,包= " MsBackendMassbank ")) ## ----------------------------------------------------------------------------- mb < -光谱(反对,源= MsBackendMassbankSql ()) mb ## ----------------------------------------------------------------------------- spectraVariables (mb ) ## ----------------------------------------------------------------------------- 头(msLevel (mb )) ## ----------------------------------------------------------------------------- 头(mb msLevel美元 ) ## ----------------------------------------------------------------------------- mz (mb) # #----------------------------------------------------------------------------- 表(mb instrument_type美元 ) ## ----------------------------------------------------------------------------- mb < - mb (mb电离美元= =“应急服务国际公司”)长度(mb ) ## ----------------------------------------------------------------------------- 库西姆斯(MsCoreUtils) < - compareSpectra (mb [11], mb[-11],有趣= ndotproduct,ppm = 40)马克斯(西姆斯 ) ## ----------------------------------------------------------------------------- plotSpectraMirror (mb [11], mb [(which.max (sims) + 1)), ppm = 40 ) ## ----------------------------------------------------------------------------- which.max mb_match < - mb (c(11日(sims) + 1)]化合物(mb_match ) ## ----------------------------------------------------------------------------- sessionInfo ()