plot3CPETRes-methods {R3CPET} | R Documentation

## Plotting clustering results

### Description

This method enables the user the generate different types of plots to visualize the results.

### Usage

    ## S4 method for signature 'ChromMaintainers'
    plot3CPETRes(object, path="", W=14, H=7 ,
              type=c("heatmap","clusters","curve","avgCurve","netSim", "networks"),
              byEdge=TRUE, layoutfct=layout.kamada.kawai, ...)

### Arguments

`object` | (Required) a `ChromMaintainers` object that contains the results
`path` | (optional) path where to save the plots should be `".pdf"`. if not provided the plot will be displayed on the screen.
`W` | (optional) The width of the plot in the pdf file.by default it is 14 inch
`H` | (optional) The Height of the plot in the pdf file.by default it is 7 inch
`type` | type of the plot to generate. It can support the following values ((default: "heatmap")): `"heatmap"` : Generates a heatmap of the partnership of each DNA interaction to a chromatin maintainer network. Each column is a DNA interaction and each row a chromatin maintainer network. `"clusters"` : generates a pair-wise scatter plots of all clusters. Note: only supported if the `sota` method was applied. `"curve"` : for each cluster plots the enrichment profile of all the elements. `"avgCurve"` : draws the average curve of the enrichment profile for each clusters. `"netSim"` : plots a heatmap showing the percentage of common proteins or edges between the chromatin maintainer networks. Note: generally the similarity between networks is so small so the user can set the value in the diagonal to zero and then re-plot or plot the dissimilarity plot. if `byEdge = TRUE` a similarity based on the common edges is calculated otherwise by common nodes. `"networks"` : plots all the networks. if this option is chosen a pdf file named `"AllGraphs.pdf"` is generated in the current working unless the `path` parameter is explicitly determined. To get a finer control, the user can specify the type of layout to use, by default the `layout.kamada.kawai` is used. For additional layout functions you can check the `igraph` package. The reason we generate a pdf file because there is a lot of networks and it will not be convenient to display them in one plot, or generating multiple plots.
`byEdge` | (optional) if `TRUE` and `type = "netSim"` then the a heatmap showing the similarity between the chromatin maintainer networks by common edges. if `FALSE` the similarity is calculated based on the number of common nodes.
`layoutfct` | (optional) The graph layout algorithm to use. by default the `layout.kamada.kawai` is used. Additional functions are available in the `igraph` package.
`...` | options for future use.

### Value

Different types of values are returned depending on the type of the plot selected.

`"heatmap"`

  returns a list generated by the `pheatmap` method, however it is always empty.

`"clusters","curve","avgCurve"`

  returns a list describing the number of plots per row and column.

`"netSim"`

  returns a list that contains a ggplot2 object and the similarity matrix

`"networks"`

  returns a list of ggplot2 objects, one per network.

### Author(s)

Mohamed Nadhir Djekidel (nde12@mails.tsinghua.edu.cn)

### See Also

`cluster`, `igraph`, `sota`

### Examples

        ## get the different datasets path
        petFile <- file.path(system.file("example",package="R3CPET"),"HepG2_interactions.txt")
        tfbsFile <- file.path(system.file("example",package="R3CPET"),"HepG2_TF.txt.gz")

    ## Not run:
        data(RPKMS)
        x <- ChiapetExperimentData(pet = petFile, tfbs=  tfbsFile, IsBed = FALSE, ppiType="HPRD", filter= TRUE)
        ## build the different indexes
        x <- createIndexes(x)

        ## build networks connecting each interacting regions
        nets<- buildNetworks(x)

        ## infer the networks
        hlda<- InferNetworks(nets)

        ## cluster results
        hlda<- clusterInteractions(hlda)

        ## plot a heatmap
        plot3CPETRes(hlda,type="heatmap")

        ## plot clusters pair-wise scatter plots
        plot3CPETRes(hlda,type="clusters")

        ## enrichment plot for the elements in each network
        plot3CPETRes(hlda,type="curve")

        ##  average enrichment plot for the elements in each network
        plot3CPETRes(hlda,type="avgCurve")

        ## heatmap showing the similarity between the different network
        plot3CPETRes(hlda,type="netSim")

        ## plot all the networks in the file "AllGraphs.pdf"
        nets_plot <- plot3CPETRes(hlda,type="networks")

        ## plot one of the networks
        plot(nets_plot[[3]])

    ## End(Not run)

[Package R3CPET version 1.20.0 Index]