checkArguments {FELLA} | R Documentation

## Internal function to check arguments and give personalised errors

### Description

This function checks if the arguments are of the desired type, length and range. If it fails, it gives an error explaining why the argument is invalid.

### Usage

    checkArguments(databaseDir = "myDatabase", internalDir = TRUE,
        method = "diffusion", methods = "diffusion", approx = "normality",
        loadMatrix = NULL, threshold = 0.05, plimit = 15, nlimit = 250,
        niter = 1000, t.df = 10, dampingFactor = 0.85, layout = FALSE,
        thresholdConnectedComponent = 0.05, GOterm = NULL,
        GONamesAsLabels = TRUE, LabelLengthAtPlot = 22,
        object = new("FELLA.USER"), data = new("FELLA.DATA"), ...)

### Arguments

`databaseDir` | Path for the KEGG RData files
`internalDir` | Logical, is the directory located in the package directory?
`method` | Character, exactly one of: `"hypergeom"`, `"diffusion"`, `"pagerank"`
`methods` | Character vector, containing some of: `"hypergeom"`, `"diffusion"`, `"pagerank"`
`approx` | Character: "simulation" for Monte Carlo, "normality", "gamma" or "t" for parametric approaches
`loadMatrix` | Character vector to choose if heavy matrices should be loaded. Can contain: `"diffusion"`, `"pagerank"`
`threshold` | Numeric value between 0 and 1. `p.score` threshold applied when filtering KEGG nodes. Lower thresholds are more stringent.
`plimit` | Pathway limit, must be a numeric value between 1 and 50. Limits the amount of pathways in `method = "hypergeom"`
`nlimit` | Node limit, must be a numeric value between 1 and 1000. Limits the order of the solution sub-graph when in `method = "diffusion"` and `method = "pagerank"`
`niter` | Number of iterations (permutations) for Monte Carlo ("simulation"), must be a numeric value between 1e2 and 1e5
`t.df` | Numeric value; number of degrees of freedom of the t distribution if the approximation `approx = "t"` is used
`dampingFactor` | Numeric value between 0 and 1 (none inclusive), damping factor `d` for PageRank (`page.rank`)
`layout` | Logical, should the plot be returned as a layout?
`thresholdConnectedComponent` | Numeric value between 0 and 1. Connected components that are below the threshold are kept, while the ones exceeding it (because they are too small) are discarded.
`GOterm` | Character, GO entry to draw semantic similarity in the solution graph. If `NULL`, the GO labels will be appended without similarities.
`GONamesAsLabels` | Logical, should GO names be displayed as labels instead of GO identifiers?
`LabelLengthAtPlot` | Numeric value between 10 and 50. Maximum length that a label can reach when plotting the graph. The remaining characters will be truncated using "..."
`object` | FELLA.USER object
`data` | FELLA.DATA object
`...` | ignored arguments

### Value

A list with values. Currently only a logical value named `valid` if the process runs smoothly. If the checking fails, it also returns an object called `ans`, which depends on the situation (can be the original object, `NULL`, et cetera).

### Examples

    ## This function is internal
    arg1 <- FELLA:::checkArguments(method = "hello")
    arg1$valid
    arg2 <- FELLA:::checkArguments(method = "diffusion")
    arg2$valid

[Package FELLA version 1.14.0 Index]