plot-IWTomicsData {IWTomics} | R Documentation

## Plot `"IWTomicsData"` object

### Description

Method to plot objects of class `"IWTomicsData"`. The function create graphical representations of the feature measurments in each region datasets, such as aligned curves, pointwise quantile curves, scatterplot and smoothed scatterplot.

### Usage

    ## S4 method for signature 'IWTomicsData'
    plot(x, type='boxplot',method='pearson',
      N_regions=pmin(lengthRegions(x),
                     ifelse(type=='curves',10,ifelse(type=='pairs',1000,+Inf))),
      probs=c(0.25,0.5,0.75), average=TRUE, size=TRUE,
      id_regions_subset=idRegions(x), id_features_subset=idFeatures(x),
      log_scale=FALSE, log_shift=0, col=1+seq_along(id_regions_subset),
      plot=TRUE, ask=TRUE, xlab='Windows', ylim=NULL,...)

### Arguments

`x` | `"IWTomicsData"` object.
`type` | type of plot to be drawn. Possible types are: `"boxplot"` for the pointwise quantiles curves (default), `"curves"` for the (aligned) curves, `"pairs"` for the scatterplot matrix of the different features (same resolution needed), `"pairsSmooth"` for the smoothed scatterplot matrix of the different features (same resolution needed).
`method` | correlation coefficient to be computed and plotted if type="pairs" or type="pairsSmooth". Possible types are "pearson" (default), "kendall" and "spearman". See `cor` for details about the different methods.
`N_regions` | number of regions to be randomly chosen (for each region dataset) in `"curves"` and `"pairs"` type plot. Default plots a maximum of 10 and 1000 curves for `"curves"` and `"pairs"`, respectively.
`probs` | probabilities corresponding to the quantiles to be drawn in `"boxplot"` type plot. Default plots quartile curves.
`average` | if `TRUE`, plot the mean curves.
`size` | if `TRUE`, plot the sample size in each position.
`id_regions_subset` | vector with the identifiers of the region datasets to be plotted.
`id_features_subset` | vector with the identifiers of the features to be plotted.
`log_scale` | plot the logarithm of the measurements.
`log_shift` | scalar with the shift to be applied before applying the logorithm, when `log_scale=TRUE`.
`col` | vector of plotting colors for the different region datasets. If type is `"pairsSmooth"`, only the first element of `col` is used.
`plot` | it `TRUE` (default) a plot is drawn, otherwise a list of plot data is returned.
`ask` | if `TRUE` (default) the user is prompted before a new plot is drawn.
`xlab` | a title for the x axis.
`ylim` | the y limits of the plot.
`...` | additional plot parameters.

### Value

`plot` returns a list with components depending on the plot type.

If type is `"pairs"` or `"pairsSmooth"` the list has components:

`features_plot` | matrix with the data plotted, one column for each feature considered.
`features_cor` | correlation matrix.
`type` | type of plot drawn.

If type is `"boxplot"` or `"curves"` the list has components:

`x_plot` | a list of vectors with the abscissa for each feature.
`features_plot` | if type is `"boxplot"`, a list of matrix lists with the data plotted for each feature and each region datasets. Each column represents one quantile drawn. If type is `"curves"`, a list of matrices with the data plotted for each feature. Each column represents one curve drawn.
`features_average` | if `average` is `TRUE`, a list of matrices with the average curves for each feature. Each column represents the average curve for a region dataset.
`features_position_size` | if `size` is `TRUE`, a list of matrices with the sample size for each feature. Each column represents the sample size in each position for a region dataset.
`type` | type of plot drawn.
`col` | vector of plotting colors for the different region datasets.
`col_plot` | if type is `"boxplot"`, list of plotting colors for each feature (quantile curves colors and shaded band colors). If type is `"curves"`, vector of plotting colors correspondent to the different curves in `features_plot`.

### Author(s)

Marzia A Cremona, Alessia Pini, Francesca Chiaromonte, Simone Vantini

### See Also

`IWTomicsData` for `"IWTomicsData"` class, constructors, accessors and methods; `smooth` method to smooth curves in `"IWTomicsData"` objects; `IWTomicsTest` for the Interval-Wise Testing.

### Examples

    data(regionsFeatures_center)

    ## Plot the pointwise boxplot of the curves in the different region datasets
    plot(regionsFeatures_center,type='boxplot')

    ## Plot all the curves in the different region datasets
    plot(regionsFeatures_center,type='curves',N_regions=lengthRegions(regionsFeatures_center))

    ## Scatterplot of the measurements in the different region datasets
    plot(regionsFeatures_center,type='pairs',N_regions=lengthRegions(regionsFeatures_center))

    ## Smooth scatterplot of the measurements in the 'control' region datasets
    plot(regionsFeatures_center,type='pairsSmooth',id_regions_subset='control',
         N_regions=lengthRegions(regionsFeatures_center)['control'],col=5)

[Package IWTomics version 1.8.0 Index]