8.4 Example workflow
The example below shows a complete IMS workflow which uses post mobility assignment for features, and includes matching of suspect and compound annotation candidates by CCS.
NOTE The newProject tool tool supports the creation of IMS workflows, and makes it easy to to create and explore different types of IMS workflows.
# anaInfo should be a data.frame with the analysis information
# convert raw data to ims and to centroid data
convertMSFiles(anaInfo, typeFrom = "raw", formatFrom = "bruker_ims", typeTo = "ims", formatTo = "mzML",
algorithm = "pwiz")
convertMSFiles(anaInfo, typeFrom = "ims", formatFrom = "mzML", typeTo = "centroid", formatTo = "mzML",
algorithm = "imscollapse")
# perform feature detection and grouping
fList <- findFeatures(anaInfo, "openms")
fGroups <- groupFeatures(fList, "openms")
# perform basic filtering
fGroups <- filter(fGroups, absMinIntensity = 1E4, relMinReplicateAbundance = 1)
# assign mobilities and CCS values
CCSParams <- getCCSParams("mason-schamp_1/k")
fGroups <- assignMobilities(fGroups, mobPeaksParams = getDefPeakParams("bruker_ims", "piek"),
chromPeaksParams = getDefPeakParams("chrom", "piek"),
CCSParams = CCSParams)
# suspect screening
suspList <- read.csv("suspects.csv")
# add CCS data from PubChemLite and convert them to mobilities
suspList <- assignMobilities(suspList, from = "pubchemlite", adducts = "[M+H]+",
CCSParams = CCSParams)
# screen suspects and only keep fair matches (3% CCS tolerance)
IMSMatchParams <- getIMSMatchParams("CCS", window = 0.03, relative = TRUE)
fGroups <- screenSuspects(fGroups, suspects = suspList, adduct = "[M+H]+",
IMSMatchParams = IMSMatchParams, onlyHits = TRUE)
# perform feature annotation
mslists <- generateMSPeakLists(fGroups)
formulas <- generateFormulas(fGroups, mslists, "genform", adduct = "[M+H]+")
# skip compound annotation for IMS features with similar MS/MS data as their IMS precursor
compounds <- generateCompounds(fGroups, mslists, "metfrag", adduct = "[M+H]+", database = "pubchemlite",
minIMSSpecSim = 0.9)
# NOTE: assume that PubChemLite with CCS data is installed, so only mobility conversions needs to be applied
compounds <- assignMobilities(compounds, fGroups, adduct = "[M+H]+", CCSParams = CCSParams)
# filter out deviating candidates
compounds <- filter(compounds, IMSMatchParams = IMSMatchParams)
report(fGroups, mslists, formulas, compounds)The patRoonDataIMS package contains example data and can be used to run this workflow. The data is already converted to various formats, therefore, the convertMSFiles() steps can be skipped when using this data. To use its data, simply assign the anaInfo variable: