R package for MetFrag
R TeX
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
metfRag
.gitignore
.travis.yml Update .travis.yml Sep 25, 2017
README.md Update README.md Sep 25, 2017

README.md

Build Status

MetFragR

R package for MetFrag

Details on http://c-ruttkies.github.io/MetFrag/projects/metfragr/

Installation

Installing the package locally
  • checkout the MetFragR git repository
  • build the package (on command line):
R CMD check metfRag
R CMD build metfRag
  • install the package (in R):
install.packages("metfRag",repos=NULL,type="source")
library(metfRag)
Installing the package directly from github (in R)
library(devtools)
install_github("c-ruttkies/MetFragR/metfRag")
  • if you get an error like "ERROR: loading failed for 'i386'" on windows due to rJava issues, disable multiarch builds:
install_github("c-ruttkies/MetFragR/metfRag", args="--no-multiarch")
Example (Run MetFrag)
settingsObject<-list()
settingsObject[["DatabaseSearchRelativeMassDeviation"]]<-5.0
settingsObject[["FragmentPeakMatchAbsoluteMassDeviation"]]<-0.001
settingsObject[["FragmentPeakMatchRelativeMassDeviation"]]<-5.0
settingsObject[["MetFragDatabaseType"]]<-"PubChem"
settingsObject[["NeutralPrecursorMass"]]<-253.966126
settingsObject[["PeakList"]]<-matrix(c(
90.97445, 681,
106.94476, 274,
110.02750, 110,
115.98965, 95,
117.98540, 384,
124.93547, 613,
124.99015, 146,
125.99793, 207,
133.95592, 777,
143.98846, 478,
144.99625, 352,
146.00410, 999,
151.94641, 962,
160.96668, 387,
163.00682, 782,
172.99055, 17,
178.95724, 678,
178.97725, 391,
180.97293, 999,
196.96778, 720,
208.96780, 999,
236.96245, 999,
254.97312, 999), ncol=2, byrow=TRUE)
settingsObject[["NeutralPrecursorMolecularFormula"]]<-"C7H5Cl2FN2O3"
settingsObject[["PrecursorCompoundIDs"]]<-c("50465", "57010914", "56974741", "88419651", "23354334")
#
# pre and post-processing filter
#
# define filters to filter unconnected compounds (e.g. salts)
settingsObject[["MetFragPreProcessingCandidateFilter"]]<-c("UnconnectedCompoundFilter","IsotopeFilter")
settingsObject[["MetFragPostProcessingCandidateFilter"]]<-c("InChIKeyFilter")
#run MetFrag
scored.candidates<-run.metfrag(settingsObject)
#scored.candidates is a data.frame with scores and candidate properties