CUSUMChart: A function to create cumulative sum charts for mean (CUSUMm)...

Description Usage Arguments Value Examples

View source: R/CUSUMChart.R

Description

A function to create cumulative sum charts for mean (CUSUMm) and cumulative sum charts for variability (CUSUMv) control charts

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
CUSUMChart(
  data = NULL,
  peptide,
  L = 1,
  U = 5,
  metric,
  normalization = TRUE,
  ytitle = "CUSUMm",
  type = "mean",
  selectMean = NULL,
  selectSD = NULL,
  referenceValue = 0.5,
  decisionInterval = 5
)

Arguments

data

comma-separated (.csv), metric file. It should contain a "Precursor" column and the metrics columns. It should also include "Annotations" for each observation.

peptide

the name of precursor of interest.

L

Lower bound of the guide set.

U

Upper bound of the guide set.

metric

the name of metric of interest.

normalization

TRUE if metric is standardized and FALSE if not standardized.

ytitle

the y-axis title of the plot. Defaults to "CUSUMm". The x-axis title is by default "Time : name of peptide"

type

the type of the control chart. Two values can be assigned, "mean" or "variability". Default is "mean"

selectMean

the mean of a metric. It is used when mean is known. It is NULL when mean is not known. The default is NULL.

selectSD

the standard deviation of a metric. It is used when standard deviation is known. It is NULL when mean is not known. The default is NULL.

referenceValue

the value that is used to tune the control chart for a proper shift size

decisionInterval

the threshold to detect an out-of-control observation

Value

A plot of pozitive and negative CUSUM statistics versus time per peptide and metric generated from CUSUM.data.prepare data frame.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# First process the data to make sure it's ready to use
sampleData <- DataProcess(S9Site54)
head(sampleData)
# Find the name of the peptides
levels(sampleData$Precursor)
# Calculate CUSUM statistics
CUSUMChart(data = sampleData, peptide = "VLVLDTDYK", metric = "BestRetentionTime")
CUSUMChart(data = sampleData, peptide = "VLVLDTDYK", metric = "BestRetentionTime",
           ytitle = "CUSUMv", type = "variability")
CUSUMChart(data = sampleData, peptide = "VLVLDTDYK", metric = "BestRetentionTime",
           selectMean = 27.78, selectSD = 8.19)
CUSUMChart(data = sampleData, peptide = "DDGSWEVIEGYR", metric = "TotalArea")
CUSUMChart(data = sampleData, peptide = "DDGSWEVIEGYR", metric = "TotalArea",
           selectMean = 35097129, selectSD = 34132861)
CUSUMChart(data = sampleData, peptide = "TAAYVNAIEK", metric = "MaxFWHM")

Example output

[1] "Your data is ready to go!"
   AcquiredTime Precursor   Annotations MinStartTime MaxEndTime
1 9/19/11 13:14 VLVLDTDYK Not Available        24.30      25.08
2 9/19/11 14:45 VLVLDTDYK Not Available        24.36      25.17
3 9/19/11 16:15 VLVLDTDYK Not Available        24.19      24.96
4 9/19/11 17:46 VLVLDTDYK Not Available        24.22      25.02
5 9/19/11 19:16 VLVLDTDYK Not Available        24.27      25.05
6 9/19/11 20:47 VLVLDTDYK Not Available        24.42      25.22
  BestRetentionTime TotalArea MaxFWHM missing
1             24.62 116034248    0.29       0
2             24.70 127339240    0.31       0
3             24.53 110745576    0.31       0
4             24.59 130619640    0.31       0
5             24.62 113469472    0.30       0
6             24.76 120836432    0.30       0
 [1] "CAVVDVPFGGAK"   "DDGSWEVIEGYR"   "DGGIDPLVR"      "FFVAPFPEVFGK"  
 [5] "GFCGLSQPK"      "HLVDEPQNLIK"    "LVNELTEFAK"     "SLHTLFGDELCK"  
 [9] "TAAYVNAIEK"     "VGPLLACLLGR"    "VLDALDSIK"      "VLVLDTDYK"     
[13] "YNGVFQECCQAEDK" "YNLGLDLR"       "YSTDVSVDEVK"   
Warning message:
`arrange_()` is deprecated as of dplyr 0.7.0.
Please use `arrange()` instead.
See vignette('programming') for more help
This warning is displayed once every 8 hours.
Call `lifecycle::last_warnings()` to see where this warning was generated. 

MSstatsQC documentation built on Nov. 8, 2020, 5:30 p.m.