Last data update: 2014.03.03

R: Calculate pair-wise correlations between samples using the...
corFinderR Documentation

Calculate pair-wise correlations between samples using the expr() slots of a list of two ExpressionSets.

Description

This function acts as a wrapper around ComBat (sva package) and cor(), to calculate pairwise correlations within one or between two ExpressionSets.

Usage

corFinder(eset.pair, separator = ":", use.ComBat = TRUE, ...)

Arguments

eset.pair

a list of ExpressionSets, with two elements. If the two elements are identical, return the correlation matrix for pairs of samples in the first element. If not identical, return pairs between the two elements.

separator

Separator between dataset name and sample name. Dataset names are added to sample names to keep track of dataset of origin.

use.ComBat

Use the sva::ComBat function for batch correction of the expr() data between the two datasets.

...

Extra arguments passed to the cor() function.

Value

Returns a matrix of sample-wise Pearson Correlations.

Author(s)

Levi Waldron, Markus Riester, Marcel Ramos

Examples

example("phenoFinder")

corFinder(esets2)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(doppelgangR)
Loading required package: Biobase
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
    rbind, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: BiocParallel
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/doppelgangR/corFinder.Rd_%03d_medium.png", width=480, height=480)
> ### Name: corFinder
> ### Title: Calculate pair-wise correlations between samples using the
> ###   expr() slots of a list of two ExpressionSets.
> ### Aliases: corFinder
> 
> ### ** Examples
> 
> example("phenoFinder")

phnFnd> library(curatedOvarianData)
Loading required package: affy

phnFnd> data(GSE32063_eset)

phnFnd> data(GSE17260_eset)

phnFnd> esets2 <- list(JapaneseB=GSE32063_eset,
phnFnd+                 Yoshihara2010=GSE17260_eset)

phnFnd> ## standardize the sample ids to improve matching based on clinical annotation
phnFnd> esets2 <- lapply(esets2, function(X){
phnFnd+     X$alt_sample_name <- paste(X$sample_type, gsub("[^0-9]", "", X$alt_sample_name), sep="_")
phnFnd+ 
phnFnd+ ## Removal of columns that cannot possibly match also helps duplicated patients to stand out
phnFnd+     pData(X) <- pData(X)[, !grepl("uncurated_author_metadata", colnames(pData(X)))]
phnFnd+     X <- X[, 1:20]  ##speed computations
phnFnd+     return(X) })

phnFnd> ## See first six samples in both rows and columns
phnFnd> phenoFinder(esets2)[1:6, 1:6]
          GSM432220 GSM432221 GSM432222 GSM432223 GSM432224  GSM432225
GSM795125 0.2351904 0.1014047 0.3525417 0.7274151 0.2189890 0.27397077
GSM795126 0.5404524 0.2588727 0.4083015 0.4079720 0.2927870 0.74123368
GSM795127 0.3791279 0.5008562 0.4983502 0.4981226 0.6385506 0.04416984
GSM795128 0.2351904 0.1014047 0.3525417 0.3523760 0.2189890 0.27397077
GSM795129 0.1076309 0.2395470 0.2190910 0.2189890 0.3643260 0.16030839
GSM795130 0.2603947 0.1344290 0.1077761 0.1076793 0.2489234 0.29544860
> 
> corFinder(esets2)
Found 2 batches
Adjusting for 0 covariate(s) or covariate level(s)
Standardizing Data across genes
Fitting L/S model and finding priors
Finding parametric adjustments
Adjusting the Data
          GSM432220 GSM432221 GSM432222 GSM432223 GSM432224 GSM432225 GSM432226
GSM795125 0.7036383 0.8076965 0.7861202 0.9694795 0.8045911 0.7649717 0.7793360
GSM795126 0.7179379 0.7723147 0.7455840 0.7779347 0.7576207 0.9626765 0.7763060
GSM795127 0.7597161 0.8091662 0.7485431 0.7926815 0.7391370 0.7753552 0.9695461
GSM795128 0.7831360 0.7942215 0.7376993 0.7867722 0.7190443 0.7772283 0.7974600
GSM795129 0.7785400 0.8185891 0.7439683 0.7857085 0.7196601 0.7706538 0.8222017
GSM795130 0.7134996 0.7420610 0.6547772 0.7059997 0.6564982 0.6730458 0.6892836
GSM795131 0.7797818 0.8289165 0.7185256 0.7952971 0.7314630 0.7663868 0.7919936
GSM795132 0.7952559 0.8302757 0.7576711 0.7969228 0.8040730 0.7794664 0.7907678
GSM795133 0.7186756 0.7949272 0.8024418 0.8033600 0.7626050 0.7679198 0.7794541
GSM795134 0.7825912 0.8116178 0.7615561 0.7922744 0.7313048 0.7473650 0.7975605
GSM795135 0.7488563 0.8063966 0.7155879 0.7637829 0.7203206 0.7272796 0.8141144
GSM795136 0.7846748 0.8288424 0.7473626 0.7905084 0.7456827 0.7923890 0.8163982
GSM795137 0.8324305 0.8893188 0.7693861 0.8281942 0.7736172 0.7980584 0.8466171
GSM795138 0.7176253 0.7701914 0.7975560 0.8045460 0.8388217 0.7757431 0.7559317
GSM795139 0.7809251 0.8420668 0.7851108 0.8198034 0.8035660 0.8130093 0.8209771
GSM795140 0.7867166 0.7694014 0.6867525 0.7324631 0.7041552 0.7260312 0.7455840
GSM795141 0.7735490 0.7580311 0.6880061 0.7062260 0.6831737 0.7116233 0.6985395
GSM795142 0.8036546 0.8196717 0.7143447 0.7554330 0.7200963 0.7310726 0.7737431
GSM795143 0.8142711 0.8429483 0.7963035 0.8178958 0.7797394 0.7914247 0.8162633
GSM795144 0.7617599 0.7781933 0.7162055 0.7301727 0.7091113 0.7455589 0.7679618
          GSM432227 GSM432228 GSM432229 GSM432230 GSM432231 GSM432232 GSM432233
GSM795125 0.7746494 0.7731191 0.7753846 0.7947495 0.8087515 0.7655434 0.7096709
GSM795126 0.7448651 0.7773854 0.7748230 0.7769026 0.7945813 0.7257834 0.6887378
GSM795127 0.7811615 0.7975837 0.8250260 0.7938600 0.8255716 0.7811439 0.7466590
GSM795128 0.7469487 0.9640154 0.8013297 0.8263570 0.8185767 0.7604447 0.7255770
GSM795129 0.7718693 0.7969023 0.9695206 0.7594169 0.7932134 0.7554612 0.7743897
GSM795130 0.7173254 0.7342153 0.6852207 0.7024899 0.7029786 0.7228259 0.6861631
GSM795131 0.7797985 0.8146862 0.8204196 0.7815351 0.8004691 0.7520284 0.7742019
GSM795132 0.8332580 0.7802046 0.7928001 0.7978369 0.7934185 0.8000076 0.7819689
GSM795133 0.7917829 0.7468728 0.7962692 0.7774325 0.8178100 0.7933635 0.7709905
GSM795134 0.7727996 0.8102965 0.8064747 0.7908613 0.8069634 0.7937744 0.7738896
GSM795135 0.7823027 0.7609267 0.7920369 0.7795796 0.8154953 0.7869330 0.7980005
GSM795136 0.8098019 0.7818036 0.8331184 0.7586660 0.7912581 0.7844103 0.8072714
GSM795137 0.8429355 0.8327782 0.8451724 0.8105083 0.8301875 0.8314046 0.8081145
GSM795138 0.7629109 0.7545269 0.7494508 0.8031032 0.8216577 0.7801121 0.6878260
GSM795139 0.8095239 0.8201311 0.8087617 0.8243289 0.8265585 0.7874973 0.7617801
GSM795140 0.7654795 0.7598895 0.7251945 0.7412566 0.7484714 0.7920746 0.7542593
GSM795141 0.7365493 0.7192507 0.7462946 0.6835080 0.7034446 0.7229784 0.7546771
GSM795142 0.8109563 0.7559941 0.7897763 0.7607832 0.7731009 0.7801846 0.7985608
GSM795143 0.8051201 0.8146114 0.8197569 0.8085633 0.8118480 0.8037307 0.7913036
GSM795144 0.7686488 0.7449652 0.7418798 0.7496875 0.7682887 0.7971254 0.7490261
          GSM432234 GSM432235 GSM432236 GSM432237 GSM432238 GSM432239
GSM795125 0.7798673 0.6888101 0.7768255 0.7908561 0.7045634 0.7023582
GSM795126 0.7701759 0.6867187 0.7748989 0.7835926 0.6990678 0.7176949
GSM795127 0.8106644 0.7288669 0.7455993 0.8053609 0.7413881 0.6911001
GSM795128 0.7841015 0.7709194 0.7375537 0.7912146 0.7508685 0.6812935
GSM795129 0.8203668 0.7698166 0.7486665 0.8197575 0.7842630 0.6754667
GSM795130 0.6969698 0.7246886 0.6918105 0.7166296 0.6869300 0.7023532
GSM795131 0.8147329 0.7763624 0.7574096 0.7927500 0.8018153 0.7170205
GSM795132 0.8230309 0.7941844 0.8282671 0.8206277 0.7633376 0.7678647
GSM795133 0.8056109 0.7160274 0.7820513 0.7607189 0.7460040 0.7299487
GSM795134 0.8005839 0.7687947 0.7313321 0.7932588 0.7624902 0.6912938
GSM795135 0.8211848 0.7648910 0.7628294 0.7471971 0.8132785 0.7239211
GSM795136 0.8300504 0.7810857 0.7913019 0.7991178 0.8251311 0.7511098
GSM795137 0.8587760 0.7804507 0.8038023 0.8577165 0.8108898 0.7602621
GSM795138 0.8002194 0.7034035 0.8319705 0.7682553 0.6937195 0.7664818
GSM795139 0.8270084 0.7586145 0.8161679 0.8274053 0.7489568 0.7590448
GSM795140 0.7933985 0.7389336 0.7483187 0.7500885 0.7424051 0.7910037
GSM795141 0.7731484 0.7635797 0.7294718 0.7620522 0.7301885 0.7523329
GSM795142 0.8253336 0.7671623 0.7719307 0.7722658 0.7750929 0.7547615
GSM795143 0.8292492 0.7820081 0.8109419 0.8308835 0.7762770 0.7338403
GSM795144 0.7899882 0.7265691 0.7603143 0.7572879 0.7434314 0.7813522
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>