AnalysisStatistics {MACPET} | R Documentation

## Count Statistics for ChIA-PET.

### Description

`AnalysisStatistics` prints and saves count statistics for the current inputs of the peak-calling analysis.

### Usage

    AnalysisStatistics(x.self, x.intra = NULL, x.inter = NULL,
      file.out = NULL, threshold = 1e-05, savedir = NULL)

### Arguments

`x.self` | An object of class `PSelf` or `PSFit`.
`x.intra` | An object of class `PIntra` (optional).
`x.inter` | An object of class `PInter` (optional).
`file.out` | A string with the name of the output to be saved to `savedir`. If `NULL` the function will only print the output.
`threshold` | A numeric indicating the FDR cut-off, used when `class(x.self)=PSFit`. If NULL, no threshold is applied.
`savedir` | A string with the directory to save the ouput file. If `NULL` then the function will only print the output.

### Value

Based on the inputs, `AnalysisStatistics` prints the total Self-ligated, Intra- and Inter-chromosomal PETs, as well as the total regions, total candidate peaks and total significant peaks (if `threshold!=NULL` and `class(x.self)=PSFit`). If `file.out` and `savedir` are not `NULL` then it also saves the output to a csv file in `savedir`.

### Author(s)

Ioannis Vardaxis, ioannis.vardaxis@ntnu.no

### References

Vardaxis I, Drabløs F, Rye M and Lindqvist BH (2018). MACPET: Model-based Analysis for ChIA-PET. To be published.

### See Also

`PSelf`, `PSFit`,`PIntra`, `PInter`

### Examples

    #Create a temporary test forder, or anywhere you want:
    savedir=file.path(tempdir(),'MACPETtest')
    dir.create(savedir)#where you will save the results

    #load Inter-chromosomal data:
    load(system.file('extdata', 'MACPET_pinterData.rda', package = 'MACPET'))
    class(MACPET_pinterData)

    #load Intra-chromosomal data:
    load(system.file('extdata', 'MACPET_pintraData.rda', package = 'MACPET'))
    class(MACPET_pintraData)

    #load Self-ligated data: (class=PSelf)
    load(system.file('extdata', 'MACPET_pselfData.rda', package = 'MACPET'))
    class(MACPET_pselfData)

    #Print analysis:
    AnalysisStatistics(x.self=MACPET_pselfData,
                       x.intra=MACPET_pintraData,
                       x.inter=MACPET_pinterData,
                       file.out='AnalysisStats',
                       savedir=savedir)

    #################################################################
    #load Self-ligated data: (class=PSFit)
    load(system.file('extdata', 'MACPET_psfitData.rda', package = 'MACPET'))
    class(MACPET_psfitData)

    #Print analysis:
    AnalysisStatistics(x.self=MACPET_psfitData,
                       x.intra=MACPET_pintraData,
                       x.inter=MACPET_pinterData,
                       file.out='AnalysisStats',
                       savedir=savedir,
                       threshold=1e-5)

    #-----delete test directory:
    unlink(savedir,recursive=TRUE)

[Package MACPET version 1.0.0 Index]