Skip to contents

Feature correlation analysis.

Usage

correlations(d, ...)

# S4 method for AnalysisData
correlations(
  d,
  method = "pearson",
  pAdjustMethod = "bonferroni",
  corPvalue = 0.05,
  minCoef = 0,
  maxCor = Inf
)

# S4 method for Analysis
correlations(d)

Arguments

d

S4 object of class AnalysisData

...

arguments to pass to specific method

method

correlation method. One of pearson or spearman.

pAdjustMethod

p-value adjustment method. See ?p.adjust for available methods.

corPvalue

p-value cut-off threshold for significance

minCoef

minimum absolute correlation coefficient threshold

maxCor

maximum number of returned correlations

Value

A tibble containing results of significantly correlated features.

Details

Correlation analyses can be used to identify associated features within data sets. This can be useful to identifying clusters of related features that can be used to annotate metabolites within data sets. All features are compared and the returned table of correlations are thresholded to the specified p-value cut-off.

Examples

library(metaboData)

d <- analysisData(abr1$neg[,200:300],abr1$fact)

correlations(d)
#> # A tibble: 130 × 7
#>    Feature1 Feature2 log2IntensityRatio coefficient `|coefficient|`           p
#>    <chr>    <chr>                 <dbl>       <dbl>           <dbl>       <dbl>
#>  1 N212     N227                 -0.884       0.980           0.980 0.0107     
#>  2 N224     N286                  1.85        0.971           0.971 0.00612    
#>  3 N215     N276                  0.227       0.965           0.965 0.0419     
#>  4 N224     N265                  0.576       0.943           0.943 0.00138    
#>  5 N201     N275                 -1.59        0.909           0.909 0.0264     
#>  6 N213     N231                 -1.63        0.883           0.883 0          
#>  7 N224     N225                 -0.792       0.863           0.863 0.000000176
#>  8 N258     N263                 -2.89        0.857           0.857 0.0181     
#>  9 N267     N297                 -0.671       0.853           0.853 0          
#> 10 N211     N291                 -1.55        0.831           0.831 0.00106    
#> # ℹ 120 more rows
#> # ℹ 1 more variable: n <int>