Title: | Brings Orbitrap Mass Spectrometry Data to Life; Fast and Colorful |
---|---|
Description: | Optimizing methods for liquid chromatography coupled to mass spectrometry (LC-MS) poses a nontrivial challenge. The rawDiag package facilitates rational method optimization by generating MS operator-tailored diagnostic plots of scan-level metadata. The package is designed for use on the R shell or as a Shiny application on the Orbitrap instrument PC. |
Authors: | Christian Panse [aut, cre] , Christian Trachsel [aut], Tobias Kockmann [aut] |
Maintainer: | Christian Panse <[email protected]> |
License: | GPL-3 |
Version: | 1.3.4 |
Built: | 2024-11-13 03:24:44 UTC |
Source: | https://github.com/bioc/rawDiag |
calculates the MS1 master scan number of an MS2 scan and populates the MasterScanNumber with it
.calculatioMasterScan(x)
.calculatioMasterScan(x)
x |
a |
a data.frame
containing a MasterScanNumber
column.
Christian Trachsel
calculates the lock mass deviations along RT.
.cycleTime(x)
.cycleTime(x)
x |
a |
calculates the time of all ms cycles and the 95 the cycle time is defined as the time between two consecutive MS1 scans
TODO: quantile part needed? If no MS1 scan is present? E.g., DIA take lowest window as cycle indicator?
Christian Trachsel (2017), Christian Panse (20231201) refactored
Fill NA values with last previous value
.fillNAgaps(x)
.fillNAgaps(x)
x |
a vector of values |
a vector with any NA values replaced with the last previous actuall value
Christian Trachsel
c(NA, 1, 2, 3, NA, 4, 5, NA, NA, NA, 6) |> rawDiag:::.fillNAgaps()
c(NA, 1, 2, 3, NA, 4, 5, NA, NA, NA, 6) |> rawDiag:::.fillNAgaps()
Build the rawDiag shiny application
buildRawDiagShinyApp(rawDir = (dirname(rawrr::sampleFilePath())))
buildRawDiagShinyApp(rawDir = (dirname(rawrr::sampleFilePath())))
rawDir |
A directory containing the input raw files,
default is set to the |
returns the rawDiag shiny apps
launch the shiny application by embracing your command line while
expecting the raw file in $HOME/Downloads
MacOSX and Linux: R -q -e "library(rawDiag); buildRawDiagShinyApp() |> shiny::runApp(launch.browser = TRUE)"
Microsoft Windows: R.exe -e "library(rawDiag); buildRawDiagShinyApp() |> shiny::runApp(launch.browser = TRUE)"
Christian Trachsel (2017), Christian Panse (2023)
rawDiag: doi:10.1021/acs.jproteome.8b00173,
rawrr::sampleFilePath() |> dirname() |> rawDiag::buildRawDiagShinyApp() |> shiny::runApp() # or use your 'Download' folder (Sys.getenv('HOME') |> file.path("Downloads")) |> rawDiag::buildRawDiagShinyApp() |> shiny::runApp()
rawrr::sampleFilePath() |> dirname() |> rawDiag::buildRawDiagShinyApp() |> shiny::runApp() # or use your 'Download' folder (Sys.getenv('HOME') |> file.path("Downloads")) |> rawDiag::buildRawDiagShinyApp() |> shiny::runApp()
Checks Bioconductor installation instructions
checkRawrr()
checkRawrr()
TRUE if everything is installed correctly
Is an Object an rawDiag Object?
is.rawDiag(object)
is.rawDiag(object)
object |
any R object. |
a boolean
Christian Panse 2018
rawrr::sampleFilePath() |> rawDiag::readRaw() |> rawDiag::is.rawDiag()
rawrr::sampleFilePath() |> rawDiag::readRaw() |> rawDiag::is.rawDiag()
graphs the number of occurrences of all selected precursor charge states.
plotChargeState(x, method = "trellis")
plotChargeState(x, method = "trellis")
x |
a |
method |
specifying the plot method 'trellis' | 'violin' | 'overlay'. The default is 'trellis'. |
a ggplot
object.
Christian Trachsel (2017), Christian Panse (2023)
rawDiag: doi:10.1021/acs.jproteome.8b00173,
rawrr::sampleFilePath() |> rawDiag::readRaw() -> S S |> rawDiag::plotLockMassCorrection()
rawrr::sampleFilePath() |> rawDiag::readRaw() -> S S |> rawDiag::plotLockMassCorrection()
plotting the number of MS2 per MS1 (the duty cycle) scan versus retention time. The deepskyblue colored loess curve shows the trend.
plotCycleLoad(x, method = "trellis")
plotCycleLoad(x, method = "trellis")
x |
a |
method |
specifying the plot method 'trellis' | 'violin' | 'overlay'. The default is 'trellis'. |
a ggplot
object.
Christian Trachsel (2017), Christian Panse (2023)
rawDiag: doi:10.1021/acs.jproteome.8b00173,
rawrr::sampleFilePath() |> rawDiag::readRaw() -> S S |> rawDiag::plotCycleLoad()
rawrr::sampleFilePath() |> rawDiag::readRaw() -> S S |> rawDiag::plotCycleLoad()
graphs the time difference between two consecutive MS1 scans (cycle time) with respect to RT (scatter plots) or its density (violin). A smooth curve graphs the trend. The 95th percentile is indicated by a red dashed line.
plotCycleTime(x, method = "trellis")
plotCycleTime(x, method = "trellis")
x |
a |
method |
specifying the plot method 'trellis' | 'violin' | 'overlay'. The default is 'trellis'. |
a ggplot
object.
rawrr::sampleFilePath() |> rawDiag::readRaw() |> rawDiag::plotCycleTime()
rawrr::sampleFilePath() |> rawDiag::readRaw() |> rawDiag::plotCycleTime()
shows the injection time density of each mass spectrometry file as a violin plot. The higher the maximum number of MS2 scans is in the method, the more the density is shifted towards the maximum injection time value.
plotInjectionTime(x, method = "trellis")
plotInjectionTime(x, method = "trellis")
x |
a |
method |
specifying the plot method 'trellis' | 'violin' | 'overlay'. The default is 'trellis'. |
a ggplot
object.
Christian Trachsel (2017), Christian Panse (2023)
rawDiag: doi:10.1021/acs.jproteome.8b00173,
rawrr::sampleFilePath() |> rawDiag::readRaw() |> rawDiag::plotInjectionTime()
rawrr::sampleFilePath() |> rawDiag::readRaw() |> rawDiag::plotInjectionTime()
Lock Mass Correction Plot
plotLockMassCorrection(x, method = "trellis")
plotLockMassCorrection(x, method = "trellis")
x |
a |
method |
specifying the plot method 'trellis' | 'violin' | 'overlay'. The default is 'trellis'. |
a ggplot
object.
Christian Trachsel (2017), Christian Panse (2023)
rawDiag: doi:10.1021/acs.jproteome.8b00173,
rawrr::sampleFilePath() |> rawDiag::readRaw() |> rawDiag::plotLockMassCorrection()
rawrr::sampleFilePath() |> rawDiag::readRaw() |> rawDiag::plotLockMassCorrection()
plots the mass frequency in dependency to the charge state
plotMassDistribution(x, method = "trellis")
plotMassDistribution(x, method = "trellis")
x |
a |
method |
specifying the plot method 'trellis' | 'violin' | 'overlay'. The default is 'trellis'. |
displays charge state resolved frequency of precursor masses.
a ggplot
object.
Christian Trachsel (2017), Christian Panse (2023)
rawDiag: doi:10.1021/acs.jproteome.8b00173,
rawrr::sampleFilePath() |> rawDiag::readRaw() |> rawDiag::plotMassDistribution('overlay')
rawrr::sampleFilePath() |> rawDiag::readRaw() |> rawDiag::plotMassDistribution('overlay')
draws precursor mass vs retention time for each MS2 scan in the raw file.
plotMzDistribution(x, method = "trellis")
plotMzDistribution(x, method = "trellis")
x |
a |
method |
specifying the plot method 'trellis' | 'violin' | 'overlay'. The default is 'trellis'. |
a ggplot
object.
Christian Trachsel (2017), Christian Panse (2023)
rawDiag: doi:10.1021/acs.jproteome.8b00173,
rawrr::sampleFilePath() |> rawDiag::readRaw() -> S rawDiag::plotMzDistribution(S)
rawrr::sampleFilePath() |> rawDiag::readRaw() -> S rawDiag::plotMzDistribution(S)
Precursor Mass versus StartTime MS2 based hexagons
plotPrecursorHeatmap(x, method = "overlay", bins = 80)
plotPrecursorHeatmap(x, method = "overlay", bins = 80)
x |
a |
method |
specifying the plot method 'trellis' | 'violin' | 'overlay'. The default is 'trellis'. |
bins |
number of bins in both vertical and horizontal directions. default is 80. |
a ggplot
object.
TODO: define bin with dynamically as h= 2x IQR x n e-1/3 or number of bins (max-min)/h
Christian Trachsel (2017)
rawDiag: doi:10.1021/acs.jproteome.8b00173,
rawrr::sampleFilePath() |> rawDiag::readRaw() |> rawDiag::plotPrecursorHeatmap()
rawrr::sampleFilePath() |> rawDiag::readRaw() |> rawDiag::plotPrecursorHeatmap()
Plotting the elapsed scan time for each individual scan event.
plotScanTime(x, method = "trellis")
plotScanTime(x, method = "trellis")
x |
a |
method |
specifying the plot method 'trellis' | 'violin' | 'overlay'. The default is 'trellis'. |
a ggplot
object.
Christian Trachsel (2017), Christian Panse (2023)
rawDiag: doi:10.1021/acs.jproteome.8b00173,
## for debugging bioconductor check if (Sys.info()['sysname'] %in% c("Darwin", "Linux")) {Sys.which('mono')} rawrr::sampleFilePath() |> rawDiag::readRaw() -> S rawDiag::checkRawrr() S |> rawDiag::plotScanTime()
## for debugging bioconductor check if (Sys.info()['sysname'] %in% c("Darwin", "Linux")) {Sys.which('mono')} rawrr::sampleFilePath() |> rawDiag::readRaw() -> S rawDiag::checkRawrr() S |> rawDiag::plotScanTime()
displays the Total Ion Count (TIC) and the Base Peak Chromatogram of a mass spectrometry measurement. Multiple files are handled by faceting based on rawfile name.
plotTicBasepeak(x, method = "trellis")
plotTicBasepeak(x, method = "trellis")
x |
a |
method |
specifying the plot method 'trellis' | 'violin' | 'overlay'. The default is 'trellis'. |
a ggplot2 object for graphing the TIC and the Base Peak chromatogram.
Christian Trachsel (2017), Christian Panse (20231130) refactored
rawrr::sampleFilePath() |> rawDiag::readRaw() |> rawDiag::plotTicBasepeak()
rawrr::sampleFilePath() |> rawDiag::readRaw() |> rawDiag::plotTicBasepeak()
rawDiag shiny module
rawDiagServer(id, vals)
rawDiagServer(id, vals)
id |
An ID string that corresponds with the ID used to call the module's UI function. |
vals |
containing rawfile |
rawDiag shiny module server
shiny::shiny(rawDir = (rawrr::sampleFilePath() |> dirname()))
shiny::shiny(rawDir = (rawrr::sampleFilePath() |> dirname()))
rawDiag shiny module UI
rawDiagUI(id)
rawDiagUI(id)
id |
An ID string that corresponds with the ID used to call the module's UI function. |
a shiny UI module
rawDiag shiny module UI
rawDiag::shiny(rawDir = (rawrr::sampleFilePath() |> dirname()))
rawDiag::shiny(rawDir = (rawrr::sampleFilePath() |> dirname()))
implements a wrapper function using the rawrr methods
readIndex
, readTrailer
,
and readChromatogram
to read
proprietary mass spectrometer generated data using third-party libraries.
readRaw( rawfile, msgFUN = function(x) { message(x) } )
readRaw( rawfile, msgFUN = function(x) { message(x) } )
rawfile |
the name of the raw file containing the mass spectrometry data from the Thermo Fisher Scientific instrument. |
msgFUN |
this function is used for logging information while composing
the resulting data.frame. It can also be used for shiny progress bar. The
default is using the |
a data.frame
containing the selected trailer information.
The set up procedure for the rawrr package needs to be run in order to use this package.
Christian Panse (2016-2023)
doi:10.1021/acs.jproteome.8b00173
rawDiag::checkRawrr() rawrr::sampleFilePath() |> rawDiag::readRaw()
rawDiag::checkRawrr() rawrr::sampleFilePath() |> rawDiag::readRaw()