tpptrSplineFitAndTest {TPP} | R Documentation

## Perform spline fitting and analyze by moderated F-test

### Description

A wrapper function around the functions `tpptrFitSplines`, `tpptrFTest`, `tpptrPlotSplines`, which fits natural splines to all proteins in a dataset and detect differential behavior between conditions by a moderated F-test. The results are formatted as a wide table with one row per protein. This table contains all the original data, the test results, and (optionally) additional annotation columns for each protein.

### Usage

    tpptrSplineFitAndTest(data, factorsH1, factorsH0 = character(),
      resultPath = NULL, doPlot = TRUE, nCores = "max", splineDF = 3:7,
      additionalCols = NULL, verbose = NULL, ggplotTheme = NULL)

### Arguments

`data` | the data to be fitted.
`factorsH1` | which factors should be included in the alternative model?
`factorsH0` | which factors should be included in the null model?
`resultPath` | location where to store the spline plots per protein.
`doPlot` | boolean value indicating whether melting curves should be plotted, or whether just the curve parameters should be returned.
`nCores` | either a numerical value given the desired number of CPUs, or 'max' to automatically assign the maximum possible number (default).
`splineDF` | degrees of freedom for natural spline fitting.
`additionalCols` | additional annotation per protein to append to the result table.
`verbose` | DEPRECATED
`ggplotTheme` | DEPRECATED.

### Details

Plots of the natural spline fits will be stored in a subfolder with name `Spline_Fits` at the location specified by `resultPath`.

Argument `data` can either be long table, or a list of expressionSets as returned by `tpptrImport`. If a long table, it needs to contain the following columns: 'uniqueID' (identifier), 'x' (independent variable for fitting, usually the temperature) and 'y' (dependent variable for fitting, usually the relative concentration).

Argument `splineDF` specifies the degrees of freedom for natural spline fitting. As a single numeric value, it is directly passed on to the `splineDF` argument of `splines::ns`. Experience shows that `splineDF = 4` yields good results for TPP data sets with 10 temperature points. It is also possible to provide a numeric vector. In this case, splines are fitted for each entry and the optimal value is chosen per protein using Akaike's Information criterion.

### Value

A data frame in wide format with one row per protein. It contains the smoothing spline parameters and F-test results obtained by comparing the null and alternative models.

### See Also

`ns, AICc`

### Examples

    data(hdacTR_smallExample)
    tpptrData <- tpptrImport(configTable = hdacTR_config, data = hdacTR_data)
    fitData <- tpptrTidyUpESets(tpptrData)
    hdacSplineFits <- tpptrSplineFitAndTest(data = fitData,
                                            factorsH1 = "condition",
                                            nCores = 1,
                                            splineDF = 4:5,
                                            doPlot = FALSE)
    # Show estimated splines for HDAC1:
    filter(hdacSplineFits, Protein_ID == "HDAC1")
    # -> Which proteins showed significant condition effects?
    hdacSplineFits %>% filter(p_adj_NPARC <= 0.01) %>% select(Protein_ID, p_adj_NPARC)
    # Quality control: test for replicate-specific effects:
     testResults <- tpptrSplineFitAndTest(data = fitData,
                                         factorsH1 = "replicate",
                                         nCores = 1,
                                         splineDF = 4,
                                         doPlot = FALSE)
    # -> Which proteins showed significant replicate effects?
    testResults %>% filter(p_adj_NPARC <= 0.01) %>% select(Protein_ID, p_adj_NPARC)

[Package TPP version 3.12.0 Index]