library(MetFamily)
Some text about the scenario, data and MTBLS297.
Cool paper [@Treutler16DiscoveringRegulatedMetabolite].
Cool R package: r Githubpkg("ipb-halle/MetFamily")
First, we load the data and summarise it
# Load separate files filePeakMatrixPath <- system.file("extdata/showcase/Metabolite_profile_showcase.txt", package = "MetFamily") fileSpectra <- system.file("extdata/showcase/MSMS_library_showcase.msp", package = "MetFamily") fileAnnotation <- system.file("extdata/testdata/canopus/canopusShort.txt", package = "MetFamily") parameterSetPath <- system.file("extdata/testdata/parameterSet.RData", package = "MetFamily" ) load(parameterSetPath) resultObj <- convertToProjectFile(filePeakMatrixPath, fileSpectra, parameterSet = parameterSet, progress = FALSE) lines <- sparseMatrixToString(matrixRows = resultObj$matrixRows, matrixCols = resultObj$matrixCols, matrixVals = resultObj$matrixVals, parameterSet = parameterSet) dataList0 <- readProjectData(fileLines = lines, progress = FALSE)
# add qfeatures dataList <- add_qfeatures(dataList0, qfeatures = resultObj$qfeatures, fileAnnotation) # *** gp: PR works until here to reproduce previous behavior with a simpler workflow
# use showcase for testing # fileName <- system.file("extdata/showcase/Project_file_showcase_annotated.csv.gz", package = "MetFamily") # project <- readClusterDataFromProjectFile(file = fileName) project$dataFrameMS1Header$Annotation dataList$dataFrameMS1Header$Annotation
We can filter the data to remove low quality data points
# todo...
PCA on MS1 in Figure \@ref(fig:pca).
fileName <- system.file("extdata/testdata/filterObj.Rdata", package = "MetFamily") load(fileName) pca <- calculatePCA(dataList=dataList, filterObj=filterObj, ms1AnalysisMethod="PCA (Principal Component Analysis)", scaling="None", logTransform=FALSE) ## Need to be global variables because they are not ## passed to getPcaPerformanceIndicator() as parameters. pcaDimensionOne <<- 1 pcaDimensionTwo <<- 2 resultObj <- calcPlotPCAscores( pcaObj = pca, dataList = dataList, #project, filterObj = filterObj, pcaDimensionOne = pcaDimensionOne, pcaDimensionTwo = pcaDimensionTwo, showScoresLabels = FALSE, xInterval = NULL, yInterval = NULL ) # undebug(calcPlotPCAloadings) # undebug(getPrecursorColors) resultObj <- calcPlotPCAloadings( pcaObj = pca, dataList = dataList, #project, filter = filterObj, pcaDimensionOne = pcaDimensionOne, pcaDimensionTwo = pcaDimensionTwo, selectionFragmentPcaLoadingSet = NULL, selectionAnalysisPcaLoadingSet = NULL, selectionSearchPcaLoadingSet = NULL, xInterval = NULL, yInterval = NULL, loadingsLabels = "None", showLoadingsAbundance = FALSE, showLoadingsFeaturesAnnotated = TRUE, showLoadingsFeaturesUnannotated = TRUE, showLoadingsFeaturesSelected = TRUE, showLoadingsFeaturesUnselected = TRUE )
HCA on MS2 in Figure \@ref(fig:hca).
if (FALSE) { p <- calcPlotDendrogram_plotly(dataList=dataList, #project, filterObj=filterObj, clusterDataList=dataList, #project, distanceMeasure = "Jaccard", showClusterLabels=FALSE, hcaPrecursorLabels="m/z / RT", selectionFragmentTreeNodeSet = NULL, selectionAnalysisTreeNodeSet = NULL, selectionSearchTreeNodeSet = NULL, selectedSelection, heatmapContent, heatmapOrdering, heatmapProportion) } fileName <- system.file("extdata/testdata/clusterDataList.Rdata", package = "MetFamily") load(fileName) fileName <- system.file("extdata/testdata/hcaFilter.Rdata", package = "MetFamily") load(fileName) returnObj <- calcPlotDendrogram(dataList=dataList2, #project, filter=filter, clusterDataList=clusterDataList, annoPresentAnnotationsList = annoPresentAnnotationsList , annoPresentColorsList = annoPresentColorsList, distanceMeasure="Jaccard (intensity-weighted)", selectionFragmentTreeNodeSet = NULL, selectionAnalysisTreeNodeSet = NULL, selectionSearchTreeNodeSet = NULL, showClusterLabels = TRUE, hcaPrecursorLabels = "m/z / RT", xInterval = c(1,219))
sessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.