evalTargetDecoys {TargetDecoy} | R Documentation

## Evaluate assumptions of the Target Decoys approach

### Description

Create diagnostic plots to evaluate the TDA assumptions. A histogram and PP plot allow to check both necessary assumptions.

### Usage

    evalTargetDecoys(object, decoy, score, log10 = TRUE, nBins = 50)

    evalTargetDecoysPPPlot(object, decoy, score, log10 = TRUE, zoom = FALSE)

    evalTargetDecoysHist(
      object,
      decoy = NULL,
      score = NULL,
      log10 = NULL,
      nBins = 50,
      zoom = FALSE
    )

### Arguments

`object` | A `data.frame`, mzID or mzRident object.
`decoy` | `character`, name of the variable that indicates if the peptide matches to a target or to a decoy.
`score` | `numeric`, indicating the score of the peptide match, obtained by the search engine.
`log10` | `logical` to indicate if the score should be `-log10`-transformed.
`nBins` | `numeric` indicating the number of bins in the histogram.
`zoom` | Logical value indicating whether a zoomed version of the plot should be returned. Default: `FALSE`.

### Value

`evalTargetDecoys` returns an overview of the following four plots:

1. A PP plot showing the empirical cumulative distribution of the target distribution in function of that of the decoy distribution

2. A histogram showing the score distributions of the decoys and non-decoys

3. A zoomed PP plot

4. A zoomed histogram

`evalTargetDecoysPPPlot` generates the PP plot only (1.) or the zoomed version (3.) if `zoom = TRUE`.

`evalTargetDecoysHist` generates the histogram only (2.) or the zoomed version (4.) if `zoom = TRUE`.

### Author(s)

Elke Debrie, Lieven Clement, Milan Malfait

### Examples

    library(mzID)

    ## Use one of the example files in the mzID package
    exampleFile <- system.file("extdata", "55merge_tandem.mzid", package = "mzID")
    mzIDexample <- mzID(exampleFile)

    # Plot the overview of the four plots
    evalTargetDecoys(mzIDexample,
        decoy = "isdecoy", score = "x\\!tandem:expect", log10 = TRUE
    )

    # Plot the PP plot only
    evalTargetDecoysPPPlot(mzIDexample,
        decoy = "isdecoy", score = "x\\!tandem:expect", log10 = TRUE
    )

    # Plot the zoomed PP plot only
    evalTargetDecoysPPPlot(mzIDexample,
        decoy = "isdecoy", score = "x\\!tandem:expect", log10 = TRUE,
        zoom = TRUE
    )

    # Plot the histogram only
    evalTargetDecoysHist(mzIDexample,
        decoy = "isdecoy", score = "x\\!tandem:expect", log10 = TRUE
    )

    # Plot the zoomed histogram only
    evalTargetDecoysHist(mzIDexample,
        decoy = "isdecoy", score = "x\\!tandem:expect", log10 = TRUE,
        zoom = TRUE
    )

    ## mzRident objects can also be used
    library(mzR)

    if (requireNamespace("msdata", quietly = TRUE)) {
        ## Using example file from msdata
        file <- system.file("mzid", "Tandem.mzid.gz", package = "msdata")
        mzid <- openIDfile(file)
    }
    evalTargetDecoys(mzid,
        decoy = "isDecoy", score = "X.Tandem.expect", log10 = TRUE
    )

[Package TargetDecoy version 1.0.0 Index]