Description Usage Arguments Details Value Note Author(s) See Also Examples
View source: R/accessory_functions.R
correlationmatrix
runs the R stats cor
function on the segmented data in a QDNAseqobject and returns the correlation matrix. The adjusted version equalizes the segments for each individual comparison, either through twosamplecompare
or templatefromequalsegments
1 2 3 4 | correlationmatrix(object, trncname = FALSE)
correlationmatrixadjusted(object, trncname = FALSE,
equalsegments = FALSE, funtype = 'mean')
|
object |
QDNAseq-object |
trncname |
Logical. The name of the sample is retrieved from the object and used as title. If set to TRUE, |
equalsegments |
Logical or integer. If FALSE, the function will simply take all combined breakpoints and "resegment" both samples accordingly. When an integer is given, the function will create artificial segments that are all comprised of as many bins as entered with this argument, or 20 when set to TRUE. Default = FALSE |
funtype |
Character string. Specifies the function used to calculate new segment values. Alternative is "median". Default = "mean" |
Calculating and plotting correlation of segments between samples can be helpful to examine similarity / dissimilarity among samples.
Returns a matrix with sample names defining both rows and columns and cells containing the pearson correlation of segment values of all bins of the intersecting samples.
It is possible to visualize a correlation matrix with the R stats heatmap
function. Although it is undoubtedly possible to adjust the function to give an interpretable plot, there are packages that facilitate this greatly. An example is the corrplot
function from the eponymous package.
Jos B. Poell
twosamplecompare
, templatefromequalsegments
1 2 3 4 | ## using segmented data from a QDNAseq-object
data("copyNumbersSegmented")
correlationmatrix(copyNumbersSegmented)
correlationmatrixadjusted(copyNumbersSegmented)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.