correlationAnalyzeR is the R interface to the Correlation AnalyzeR database and web application. The web version can be accessed here.

This package is designed to allow greater customization and control over the functions in the web interface. This vignette will demonstrate each function using an example. Additional info can be found in the reference manual.

Analyze Single Genes

To speed up the analysis, it is useful to generate a TERM2GENE object ahead of time. The GSEA_Type argument specifies which gene set databases to pull annotations from. See the details of ?getTERM2GENE to see the different options.

library(correlationAnalyzeR)
TERM2GENE <- getTERM2GENE(GSEA_Type = c("GO:BP"))  # GO Biological Process

Basic Analysis

correlationAnalyzeR can be used to predict gene function using analyzeSingleGenes() (the equivalent of Single Gene Mode in the web application). In this example, Tissue and Sample_Type arguments were set in order to limit the analysis to co-expression correlations in normal brain samples.

res <- analyzeSingleGenes(genesOfInterest = c("BRCA1"), 
                          Tissue = "brain", Sample_Type = "normal",
                          TERM2GENE = TERM2GENE)
## 
## Retrieving any missing correlation data...
## 
## Analyzing: BRCA1
## GSEA
## 
## Returning ...  EGMT GSEA_up GSEA_down eres

This runs most of the core tasks for predicting gene functionality using this analysis mode. This includes running “corGSEA”, an implementation of GSEA developed in this package for use on genome-wide co-expression correlations.

The results are a list containing several items:

Tables

  1. The genome-wide correlations (Pearson’s R) for BRCA1:
head(res$correlations)
##           BRCA1
## A1BG    -0.1510
## A1CF     0.0763
## A2M     -0.2170
## A2ML1   -0.2330
## A2MP1   -0.1740
## A3GALT2  0.1160
  1. The associated correlation P values:
head(res$`P values`)
##                BRCA1
## A1BG    5.738861e-05
## A1CF    4.504482e-04
## A2M     1.866402e-05
## A2ML1   1.491089e-05
## A2MP1   3.711901e-05
## A3GALT2 1.279990e-04
  1. The table of corGSEA results:
head(res$`BRCA1, Brain - Normal`$GSEA$eres)
##                                                                                ID
## GO_SKELETAL_SYSTEM_DEVELOPMENT                     GO_SKELETAL_SYSTEM_DEVELOPMENT
## GO_MRNA_PROCESSING                                             GO_MRNA_PROCESSING
## GO_COVALENT_CHROMATIN_MODIFICATION             GO_COVALENT_CHROMATIN_MODIFICATION
## GO_PROTEASOMAL_PROTEIN_CATABOLIC_PROCESS GO_PROTEASOMAL_PROTEIN_CATABOLIC_PROCESS
## GO_GLAND_DEVELOPMENT                                         GO_GLAND_DEVELOPMENT
## GO_ORGANELLE_FISSION                                         GO_ORGANELLE_FISSION
##                                                                       Description
## GO_SKELETAL_SYSTEM_DEVELOPMENT                     GO_SKELETAL_SYSTEM_DEVELOPMENT
## GO_MRNA_PROCESSING                                             GO_MRNA_PROCESSING
## GO_COVALENT_CHROMATIN_MODIFICATION             GO_COVALENT_CHROMATIN_MODIFICATION
## GO_PROTEASOMAL_PROTEIN_CATABOLIC_PROCESS GO_PROTEASOMAL_PROTEIN_CATABOLIC_PROCESS
## GO_GLAND_DEVELOPMENT                                         GO_GLAND_DEVELOPMENT
## GO_ORGANELLE_FISSION                                         GO_ORGANELLE_FISSION
##                                          setSize enrichmentScore      NES
## GO_SKELETAL_SYSTEM_DEVELOPMENT               497       0.4124234 1.858152
## GO_MRNA_PROCESSING                           491       0.5529121 2.488549
## GO_COVALENT_CHROMATIN_MODIFICATION           459       0.5048403 2.266618
## GO_PROTEASOMAL_PROTEIN_CATABOLIC_PROCESS     466       0.3708896 1.665522
## GO_GLAND_DEVELOPMENT                         440       0.3842980 1.720649
## GO_ORGANELLE_FISSION                         440       0.5901463 2.642311
##                                                pvalue    p.adjust
## GO_SKELETAL_SYSTEM_DEVELOPMENT           0.0005291005 0.005065758
## GO_MRNA_PROCESSING                       0.0005291005 0.005065758
## GO_COVALENT_CHROMATIN_MODIFICATION       0.0005324814 0.005065758
## GO_PROTEASOMAL_PROTEIN_CATABOLIC_PROCESS 0.0005336179 0.005065758
## GO_GLAND_DEVELOPMENT                     0.0005336179 0.005065758
## GO_ORGANELLE_FISSION                     0.0005336179 0.005065758
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       core_enrichment
## GO_SKELETAL_SYSTEM_DEVELOPMENT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                TYMS/ANO6/MED1/ATP7A/TP53/FBN2/CREB3L2/USP1/BBX/RYK/SMAD5/EVC/HMGA2/LOXL2/SP3/BMPR1A/CHSY1/AKAP13/SHOX2/ADAMTS12/TMEM38B/P3H1/POC1A/TGFBR1/NKX3-2/SLC35D1/NIPBL/GLI2/NOTCH2/HIF1A/SGPL1/MTHFD1/IRX5/OSR2/SLC10A7/FBN1/GLI3/MMP2/MBTD1/FAT4/CHD7/LRP6/PITX2/ASXL1/ANXA2/PITX1/HOXD9/MKS1/EPHA2/SETD2/EIF4A3/HOXD13/MED12/HOXD8/RDH10/EXT1/FST/TULP3/HAS2/SERPINH1/EIF2AK3/TEAD4/ADAMTS7/COL1A1/MEX3C/SH3PXD2B/HOXA11/SLC39A1/MCPH1/LRP5/LRRC17/VCAN/BMP1/HOXD10/AMER1/COL2A1/PSEN1/SIX4/TIPARP/SIX1/GSC/TRIP11/RUNX1/HOXC6/PDGFC/TGFBI/SIX2/TFAP2A/EP300/MMP14/COL3A1/ZMPSTE24/NEUROG1/ALX1/TCOF1/MTHFD1L/INPPL1/NPR3/SMAD1/SNAI2/HOXC11/HOXA1/HOXD4/HOXA2/VDR/CD44/STC1/HOXC4/HOXC8/HOXB3/LOX/HOXC10/SOX4/GLG1/PPIB/SH2B3/HOXD3/HOXA3/COL1A2/HOXC9/WNT5A/HOXB2/LUM/THBS3/TRIM45/WASF2/HOXA13/HSD17B7/NAB1/ROR2/LRP5L/SMAD2/EN1/MDFI/HOXB4/HYAL2/CTNNB1/TRPS1/WNT5B/TGFB1/SNAI1/PTGER4/MDK/TWIST1/DYM/HOXA10/NDST1/RAB23/GDF5/HOXD12/SLC39A14/GUSBP3/HOXB7/HOXC5/FLVCR1/MAPK14/FOXC2/SOX11/ALX3/RPS6KA3/HAND2/HOXA4/ZEB1/MEIS1/SLC38A10/FGF2/TGFBR2/RHOA/HSPB11/IFT80/FGFR1/PAX5/HEXB/MBTPS2/SNX19/VKORC1/ALX4/ACVR2B/HAND1/MMP13/FGFRL1/PRPSAP2/CLDN18/SLC2A10/GDF11/RELA/HOXA9/INSIG1/PLS3/GDF6/HOXB9/TIMP1/DLG1/HOXB6/RAB33B/SPARC/COL5A2/TRPV4/HOXA6/HOXB5/SFRP1/TBX15/SERP1/PAPSS2/SUFU/HOXA5/SMAD3
## GO_MRNA_PROCESSING                       TTF2/BARD1/REST/NUP98/CPSF2/SCAF11/CMTR2/MBNL3/DHX8/CCNB1/METTL16/PRPF40A/GEMIN5/DBR1/LSM8/XRN2/TGS1/PDCD11/SF3B3/NCBP1/ZCCHC8/THOC2/CPSF3/DHX15/HNRNPF/CCNT1/SRSF1/SNRNP40/CDK12/SYNCRIP/TRA2B/IWS1/RPRD1B/GTF2H3/DHX35/RBM7/CDC73/NCBP3/AQR/MAGOHB/RBM15/SNRNP200/ZC3H10/HNRNPU/RRP1B/CSTF1/PTBP1/DHX9/DDX46/PRPF4B/SF3A3/PRPF38A/SRSF10/THOC5/YBX1/DDX20/RBMX/GEMIN4/PABPC1/PNPT1/SNRNP48/HNRNPR/ECD/PRPF3/PTBP3/SON/CSTF2/GTF2H2/ZNF473/PAPOLA/POLR2D/RBM28/CCAR1/ALYREF/PRPF4/EIF4A3/FXR1/U2SURP/CTR9/DDX23/SF3B1/SART3/CRNKL1/ISY1/CLP1/BUD13/PHF5A/USP39/ERN1/RBM27/METTL14/ZC3H11A/CWC22/HNRNPH1/NCL/SLTM/PCF11/SNW1/EFTUD2/WDR33/DDX39A/NONO/CDK13/CSTF2T/KDM1A/DHX16/HNRNPUL1/LARP7/METTL3/SCAF8/SNRPD1/RBM8A/GCFC2/SFPQ/HNRNPA1/RBM39/CDC5L/THRAP3/RBM41/RNGTT/SREK1/DDX47/RNF20/DCPS/PRPF8/SRSF6/PABPC1L/SPEN/HMX2/SNIP1/SETX/DHX36/CWF19L1/WDR77/COIL/HNRNPC/ZC3H14/LSM5/GEMIN2/RBM3/AAR2/U2AF1L5/DHX38/SMU1/FIP1L1/SRPK1/POLR2B/PPP4R2/HNRNPM/PDE12/CTNNBL1/RAVER1/ACIN1/MTPAP/PNN/RBM15B/SMNDC1/TSEN15/PPWD1/SRSF3/HNRNPK/KHDRBS1/SNRPG/SNRPD3/SREK1IP1/GEMIN6/GTF2F2/HNRNPL/SUPT6H/RBMX2/MFAP1/CPSF6/PRMT5/SRSF2/TIA1/TSEN34/PRPF18/SNRPA/SNRPB/SCAF4/MAGOH/PLRG1/ZNF326/RALY/THOC6/WTAP/RBM19/YTHDC1/CWF19L2/RBMXL1/HNRNPLL/RBBP6/CWC27/SNRPE/SRSF9/LEO1/TFIP11/SRSF7/ELAVL1/PPP1R8/PAN2/THOC1/U2AF2/DDX5/GPATCH1/ESRP2/DDX17/CLNS1A/DAZAP1/LSM6/C1QBP/RNF40/PAN3/POLDIP3/SNRPB2/SRRM1/PAPOLG/RBM38/APOBEC2/HNRNPA2B1/PRMT9/PPIH/TBRG4/ZFP36L1/CWC25/PPIL3/SRRT/HNRNPA3/NUDT21/NCBP2/TSEN2/FASTKD5/MBNL1/SRSF4/TCERG1/DDX39B/PHRF1/PRPF6/QKI/SF3B6/KHSRP/KIN/SF3A1/HNRNPD/DDX42/FRG1/RBM22/NSRP1/SYF2/ADAR/RBM17/NELFE/IK/PRPF38B/SF3B2/SARNP/CDK7/SNRPF/PTCD2/RBM5/TUT1/MNAT1/U2AF1/SART1/ZNF830/CHTOP/TSEN54/USP49/AKAP17A/GTF2H1/RBM10/SAFB/ZC3H13/SMN1/LUC7L2/SRSF11/LSM3/CELF1/JMJD6/RSRC1/SF3A2/THOC3/ERCC2/POLR2C/PPIL1/RBM4/CSTF3/RBM26/CASC3/PRPF31/SFSWAP/SNRPC/TARDBP/LSM2/PRDX6
## GO_COVALENT_CHROMATIN_MODIFICATION                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  BRCA2/CHEK1/UHRF1/AURKB/AURKA/REST/BAZ1A/CDK1/HELLS/CCNA2/ACTL6A/HAT1/CDK2/EZH2/TP53/DNMT1/CCNB1/CHD1/HMGA2/HDAC1/JADE3/SUV39H2/BAZ1B/SIN3A/KDM5A/WDR5B/DCAF1/EHMT1/RUVBL1/ZZZ3/RCOR1/PCGF6/BCOR/SUZ12/IWS1/NCOA3/NIPBL/CDC73/VRK1/BRD7/PADI3/EYA4/PHF8/PRKAA1/SETDB1/KDM3B/EYA3/KAT6A/INCENP/DNMT3B/TRIM16/KDM6A/ASXL1/ELK4/TRIP12/TRRAP/ATM/TAF5L/SIRT1/ATF7IP/DDB2/KDM3A/MYB/SETD2/TET2/MTA2/PHF19/CTR9/WDR70/SMAD4/TAF1/USP3/BEND3/SART3/LMNA/PAXBP1/RIF1/DOT1L/ZNF274/GATA3/HLCS/UIMC1/CTCF/PAXIP1/KDM4A/TAF5/NAA50/UFL1/CPA4/SNW1/MSL2/SMARCAD1/TBL1X/BAZ2A/UBR5/KDM1A/TET3/BRPF1/DR1/SFPQ/GTF3C4/YEATS2/MCM3AP/LIF/RNF168/TET1/MAP3K7/RNF20/SET/DTX3L/PRKD2/EP300/HDAC2/BRMS1/MIER1/SETD5/ZMPSTE24/KANSL2/RLF/EED/PHF20/CBX8/USP16/GFI1/MTF2/NSD1/SNAI2/PRDM13/MRGBP/ZNF451/NAA40/KDM5B/PRMT6/AKAP8/POLE3/ARID4B/CUL4B/KMT5B/VEGFA/KANSL3/KDM1B/ATXN7/SUPT6H/SUDS3/FBL/PRMT5/PARG/EPC1/JADE1/CTNNB1/PADI1/DDB1/SUV39H1/RBBP5/KDM2B/KMT5A/TAF12/ING3/LEO1/TWIST1/ISL1/KANSL1/KDM5C/PHF20L1/PHF14/YEATS4/HDAC3/PRDM5/HUWE1/JMJD1C/SRCAP/RSF1/SMARCB1/RNF40/MORC2/SETD7/MSL3P1/KAT6B/MUC1/PHF2/PRMT1/RNF2/TRIM28/HDAC7/HCFC1/MECOM/BRCC3/KMT2C/UBE2E1/PHB/LDB1/LEF1/PWP1/N6AMT1/PAX5/EPC2/BRD1/KDM2A/RBM14/KMT2E/NELFE/SETMAR/UBR2/KDM4D/PPHLN1/KMT5C/JAK2/PHF10/GATA2/ZNF304/JARID2/MBD2/RAG1/CHTOP/USP49/BRD8/MTA1/KDM4B/NOC2L/USP15/USP36/ING2/JMJD6/KDM7A
## GO_PROTEASOMAL_PROTEIN_CATABOLIC_PROCESS                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    KIF14/AURKB/AURKA/BUB1B/CDC20/FBXO5/UBE2C/PBK/CDK1/SKP2/UGGT1/SENP1/PLK1/UBXN2A/SMARCC1/CDK2/USP13/CCNB1/FBXW8/MAD2L1/PTTG1/RHBDD1/STYX/MDM2/ERLIN1/PMAIP1/CCNF/PSME4/ANAPC1/DET1/CUL4A/XPO1/SMURF2/ERCC8/CD2AP/ERLIN2/SCO1/TOPORS/SIRT1/EDEM1/FBXO38/SOCS4/BFAR/TAF1/FBXL4/SOCS6/STT3B/UBXN4/TLK2/HFE/ITCH/HSP90B1/WWTR1/KLHL20/RNF216/TMF1/UFL1/FBXO22/CDC23/TBL1X/DDI2/PSEN1/BUB3/NFE2L2/RNFT1/EDEM2/ANKIB1/DNAJC10/PLK3/PSMD9/SPOPL/DERL2/LAMP3/TMEM67/BIRC2/KLHL15/LTN1/UBE2S/KCTD5/CDC27/ARIH2/FAF2/RACK1/NPLOC4/YOD1/CUL4B/UGGT2/ARAF/PELI1/TRIM25/UBE4B/UBE2J1/NUB1/SMURF1/CTNNB1/PLAA/RNF122/UBR1/DDB1/UBE2G1/HSPA5/RNF121/FBXL13/FBXL12/SPSB4/PSMA3/VCP/RNF139/HUWE1/PSMA2/PSMD6/RFFL/RNF40/TRIM39/HM13/RAD23B/SPSB2/RNF4/UBE2G2/ANAPC7/SPSB1/RPL11/AREL1/BAG2/UBE2E1/CAV1/NUDT15/PSMA4/GID8/N4BP1/CDC26/PSMA7/SIAH1/EDEM3/RNF217/TMTC3/NHLRC3/PSMD5/FBXO4/PSME1/USP19/UBR2/PSME3/NEDD4/PSMD2/POMT2/PSMD14/CCDC47/DERL1/TRIB3/AKT1/DAB2/KCTD10/TOR1A/PSMB1/PSMD11/CDC20B/PSMD1/MTA1/TRIM38/HERC2/SDF2L1/CSNK1A1/GCLC/JKAMP/PSME2/RNF34/OS9/ANAPC16/MTM1/PSMC2/ANAPC4/PSMD7/CUL1/CUL5/UBE2D1/FBXL7/SEL1L/SEC61B/UBE2D3/USP7/CUL3
## GO_GLAND_DEVELOPMENT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 BRCA2/CCNB2/AURKA/E2F8/TYMS/IQGAP3/E2F7/UMPS/IGF2R/MED1/ATP7A/SMARCC1/EZH2/PRKDC/HK2/BCL2L11/CPS1/SP3/BMPR1A/WDR35/TWSG1/BTBD7/TGFBR1/RREB1/CAD/ZBTB1/GLI2/TNC/NOTCH2/DHODH/HIF1A/PPAT/GLI3/PCNA/MSN/LAMA1/LRP6/PITX2/ASXL1/CCND1/NPHP3/PNPT1/ATM/PITX1/HOXD9/EPHA2/HOXD13/SMAD4/HFE/GATA3/RAF1/FOXA1/LRP5/NOTCH1/STRA6/MPST/ITGA2/PKD2/GATA6/GNPNAT1/ORAI1/PSEN1/SIX4/CREB1/RBPJ/SIX1/FOXE1/FADD/WNT3A/MAN2A1/PCK2/XBP1/ZMPSTE24/ABL1/LATS1/WDR77/UPF2/WLS/AR/SNAI2/TNFAIP3/VDR/PLAG1/HOXB3/ETS1/NKX2-5/KDM5B/NRP1/ANXA1/HOXD3/HOXA3/VEGFA/ADA/FRS2/SRP54/WNT5A/FOXB1/LRP5L/PRMT5/SMAD2/ROBO1/ARF6/BAX/CTNNB1/DAG1/TGFB1/MAD1L1/PCSK9/AKT2/MDK/FOXN1/ISL1/SEMA3A/PHB2/SOX3/CEBPG/HLX/PRKCSH/HAND2/ESRP2/OTP/XDH/FPGS/HESX1/CSNK2A2/PHF2/RPS6KA1/TGFBR2/SMO/CYP19A1/CAV1/EGFR/HMOX1/SEMA3C/DDX39B/RPL30/FGFR1/LEF1/NKX2-1/HNRNPD/PIK3CA/NKX2-3/RPGRIP1L/JAK2/RELA/HES1/HOXA9/PTCD2/STAT5B/SEC63/GATA2/TSPO/AKT1/HOXB9/JARID2/SERPINB5/RAG1/TBX19/SLC6A3/HMGCL/RPL10/SFRP1/CRKL/HOXA5/SCRIB/SMAD3
## GO_ORGANELLE_FISSION                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               SMC4/NDC80/KIF18A/ESPL1/SGO1/BRCA2/KIF14/KIF11/BUB1/KNTC1/BIRC5/CHEK1/KIF18B/SGO2/AURKB/KIF23/NUSAP1/BRIP1/CENPE/DLGAP5/CHEK2/FANCD2/NUF2/KIF2C/KIF4A/AURKA/CENPF/KIFC1/CENPK/NCAPH/NCAPD2/BUB1B/MKI67/MYBL2/ASPM/MND1/KIF20B/RAD51/CDC20/FBXO5/CDCA8/TTK/UBE2C/AP3B1/EME1/CDC25C/CCNE2/TOP2A/NCAPG2/MTFR2/NDE1/NEK2/NCAPG/MYBL1/SPDL1/FBXO43/NCAPD3/TPX2/PLK1/RAD51B/CDT1/TACC3/BORA/RACGAP1/RAD54L/MASTL/ZWINT/MTFR1/CDC6/GEN1/TRIP13/TPR/MSH5/CDK5RAP2/NME6/NDC1/CCNB1/SMC1A/SMC2/MAD2L1/STAG1/SMC3/RCC1/PRC1/DSCC1/WAPL/FANCA/DSN1/PDS5A/PTTG1/BCL2L11/MLH1/SMC5/MYO19/PSMC3IP/MTBP/CEP85/ZW10/MIS12/SPICE1/SLF2/SPAG5/ANAPC1/NIPBL/CKS2/KPNB1/KNSTRN/RMI1/FIGNL1/ERCC4/CEP192/DHODH/FLNA/CDCA5/RB1/HNRNPU/FANCM/INO80/RAD54B/ZNF207/KIF22/INCENP/PKMYT1/TEX19/ATM/SPHK1/CDC14A/ANLN/RMDN1/P3H4/STAG2/PIBF1/NSMCE2/CHAMP1/LRP5/NAA50/RIOK2/PHIP/CDC23/MSH3/CDK13/XRCC3/EPS8/CEP97/BUB3/NSL1/DNM2/ACTR3/LIF/CALR/TEX15/NUP62/RAD1/NEUROG1/RAD21/USP16/KIF2A/DMC1/MAD2L2/UBE2S/ARHGEF10/CDC27/AKAP8/CCNE1/WNT5A/EPGN/CENPC/PRMT5/CTDP1/DIS3L2/MTFP1/MAD1L1/TOP2B/CHTF8/BOD1/MIEF1/RRS1/BCCIP/CCNB1IP1/NUMA1/VPS4B/NEK6/SPAST/PHB2/PINX1/XIAP/CCDC8/RANBP1/PDE3A/AGO4/SYCE2/PCID2

Figures

  1. A histogram showing the genome-wide correlation value (R) distribution:
res$`BRCA1, Brain - Normal`$corrHist

  1. The top increasing corGSEA hits:
res$`BRCA1, Brain - Normal`$GSEA$GSEA_up

  1. The top decreasing corGSEA hits:
res$`BRCA1, Brain - Normal`$GSEA$GSEA_down

Supplying a custom dataset

correlationAnalyzeR relies on pre-calculated datasets which are stored in a cloud database. However, it is also possible for users to generate predictions from their own datasets. To generate a correlation matrix you can supply a read count matrix to generateCorrelations()

Here is an example using the airway dataset. We first wrangle the dataset into a raw read count matrix:

library(airway)
library(EnsDb.Hsapiens.v86)
library(dplyr)

data(airway)
cts <- assay(airway)
ens2gene <- ensembldb::select(EnsDb.Hsapiens.v86, keys = rownames(cts),
                              columns = c("SYMBOL"), keytype = "GENEID") %>%
  dplyr::distinct(SYMBOL, .keep_all = TRUE) %>%
  dplyr::inner_join(y = data.frame("GENEID" = rownames(cts)))
cts <- cts[ens2gene$GENEID,]
rownames(cts) <- ens2gene$SYMBOL

We then generate the correlation matrix with the generateCorrelations() function:

corrMat <- generateCorrelations(cts)
## ..will not use multithreading.
##  Fraction of slow calculations: 0.000000

Once the correlation matrix is generated, it can be used as the input to analyzeSingleGenes() via the corrMat argument with a corrMat_label set (this is the custom label used during plotting functions).

res <- analyzeSingleGenes(genesOfInterest = c("BRCA1"), corrMat = corrMat,
                          corrMat_label = "User-supplied DataSet",
                          TERM2GENE = TERM2GENE)
## 
## Retrieving any missing correlation data...
## 
## Analyzing: BRCA1
## GSEA
## 
## Returning ...  EGMT GSEA_up GSEA_down eres

Here is the correlation histogram produced with the custom dataset:

res$`BRCA1, User-supplied DataSet`$corrHist

It is important to note that user-supplied datasets should provide enough samples to ensure robust co-expression calculations. In the above example, it is clear that there are not enough samples within the airway dataset to support this calculation. In our experience, it is necessary to have at least 30 samples in most cases.

Cross-compare mode

crossCompareMode allows a user to examine the correlations across multiple tissue and disease conditions. For example, to analyze the correlations of BRCA1 across all tissues, we could do the following:

res <- analyzeSingleGenes(genesOfInterest = c("BRCA1"), crossCompareMode = TRUE)
## 
## Retrieving GSEA annotations...
## Retrieving any missing correlation data...
## 
## Running cross comparison mode ...

The output is a list containing several tables:

  1. The co-expression correlations for BRCA1 across all tissues:
head(res$BRCA1$correlations, n = 3)
##      BRCA1_adipose_cancer BRCA1_adipose_normal BRCA1_bladder_cancer
## A1BG               -0.464              -0.2310               -0.496
## A1CF               -0.267              -0.0873               -0.317
## A2M                -0.686              -0.1550               -0.614
##      BRCA1_bone_cancer BRCA1_bone_normal BRCA1_brain_cancer BRCA1_brain_normal
## A1BG          -0.33400             0.045            -0.1380            -0.1510
## A1CF          -0.00562            -0.254            -0.0249             0.0763
## A2M           -0.36900            -0.167            -0.5310            -0.2170
##      BRCA1_cardiac_normal BRCA1_cartilage_normal BRCA1_endothelial_normal
## A1BG             -0.35800                 -0.285                  -0.1700
## A1CF              0.22000                 -0.334                  -0.0536
## A2M               0.00311                 -0.529                  -0.3920
##      BRCA1_esophagus_cancer BRCA1_esophagus_normal
## A1BG                 -0.446                 -0.632
## A1CF                 -0.344                 -0.493
## A2M                  -0.344                 -0.806
##      BRCA1_female_reproductive_cancer BRCA1_female_reproductive_normal
## A1BG                          -0.3590                          -0.3380
## A1CF                           0.0502                          -0.0333
## A2M                           -0.1370                          -0.4930
##      BRCA1_immune_cancer BRCA1_immune_normal BRCA1_intestines_cancer
## A1BG              -0.288             -0.2760                  -0.191
## A1CF              -0.214              0.0289                  -0.131
## A2M               -0.142             -0.1530                  -0.409
##      BRCA1_intestines_normal BRCA1_kidney_cancer BRCA1_kidney_normal
## A1BG                 -0.0793              -0.455               0.032
## A1CF                 -0.1290              -0.437              -0.697
## A2M                  -0.2510              -0.791              -0.815
##      BRCA1_liver_cancer BRCA1_liver_normal BRCA1_male_reproductive_normal
## A1BG             -0.647             -0.233                        -0.2430
## A1CF             -0.370             -0.143                        -0.0389
## A2M              -0.389             -0.220                        -0.0328
##      BRCA1_mammary_cancer BRCA1_mammary_normal BRCA1_muscle_cancer
## A1BG               0.0448              -0.2740              -0.689
## A1CF              -0.0545               0.0283              -0.489
## A2M               -0.4580              -0.4650              -0.804
##      BRCA1_muscle_normal BRCA1_pancreas_cancer BRCA1_pancreas_normal
## A1BG               0.212                -0.480                -0.378
## A1CF               0.054                -0.395                -0.302
## A2M               -0.538                -0.676                -0.387
##      BRCA1_prenatal_cancer BRCA1_prenatal_normal BRCA1_prostate_cancer
## A1BG                -0.338                -0.146               -0.0486
## A1CF                -0.201                 0.202                0.1650
## A2M                 -0.453                -0.191               -0.4640
##      BRCA1_prostate_normal BRCA1_respiratory_cancer BRCA1_respiratory_normal
## A1BG                -0.286                 -0.27500                    0.083
## A1CF                -0.280                  0.00401                   -0.132
## A2M                 -0.730                 -0.48800                   -0.521
##      BRCA1_retina_normal BRCA1_skin_cancer BRCA1_skin_normal
## A1BG               0.334            -0.272            -0.313
## A1CF              -0.181            -0.182            -0.335
## A2M               -0.496            -0.210            -0.489
##      BRCA1_stem_like_cancer BRCA1_stem_like_normal BRCA1_stomach_cancer
## A1BG                -0.3290                -0.3100               -0.460
## A1CF                -0.0998                 0.0505               -0.240
## A2M                 -0.4000                -0.1750               -0.572
##      BRCA1_stomach_normal BRCA1_thyroid_cancer BRCA1_thyroid_normal
## A1BG                -0.15               -0.304               -0.322
## A1CF                -0.12               -0.107                0.126
## A2M                 -0.38               -0.777               -0.360
  1. All the VST-transformed counts for BRCA1 across all samples:
head(res$BRCA1$VST_DF)
##                        group    samples BRCA1_VST              tissue sample
## 1: Female Reproductive - All  GSM741172     10.69 Female Reproductive    All
## 2: Female Reproductive - All  GSM741170     11.26 Female Reproductive    All
## 3: Female Reproductive - All  GSM741171     10.48 Female Reproductive    All
## 4: Female Reproductive - All GSM1098188     11.08 Female Reproductive    All
## 5: Female Reproductive - All  GSM800466     10.60 Female Reproductive    All
## 6: Female Reproductive - All  GSM988637     10.93 Female Reproductive    All

The output list also contains several plots:

  1. A box plot comparing cancer and normal samples by VST
res$BRCA1$VST_boxPlot

  1. A heatmap of the top 30 co-correlated genes with BRCA1 (genes which show similar co-expression correlations to BRCA1). The accompanying values for this plot are in res$BRCA1$heatmapSmallDataCo.
res$BRCA1$heatmapSmallCo

  1. A heatmap of the top 200 co-correlated genes with BRCA1. The accompanying values for this plot are in res$BRCA1$heatmapBigDataCo.
res$BRCA1$heatmapBigCo

  1. A heatmap of the top 30 variably-correlated genes with BRCA1 (genes which show divergent co-expression correlations compared to BRCA1). The accompanying values for this plot are in res$BRCA1$heatmapSmallDataCo.
res$BRCA1$heatmapSmallVar

  1. A heatmap of the top 200 variably-correlated genes with BRCA1. The accompanying values for this plot are in res$BRCA1$heatmapBigDataVar.
res$BRCA1$heatmapBigVar

Analyze Gene Pairs

Basic Analysis

correlationAnalyzeR can be used to analyze differences between two genes using analyzeGenePairs() (the equivalent of Gene vs Gene Mode in the web application).

res <- analyzeGenePairs(genesOfInterest = c("BRCA1", "BRCA2"),
                        Tissue = "all", Sample_Type = "all",
                        TERM2GENE = TERM2GENE)
## 
## Retrieving any missing correlation data...
## 
## Analyzing: BRCA1
## GSEA
## 
## Returning ...  EGMT eres 
## 
## Analyzing: BRCA2
## GSEA
## 
## Returning ...  EGMT eres

The analyzeGenePairs() function performs analyzeSingleGenes() on both of the supplied genes and then compares the results, generating several tables and figures:

  1. The correlation between the two genes is visualized using a scatter plot of their VST-transformed expression values.
  • By Disease:
res$compared$VST_corrPlot$corrPlot_disease

  • By Tissue:
res$compared$VST_corrPlot$corrPlot_tissue

  1. The gene co-expression correlations with the average Pearson R and variance included. Note that, with only two data points, variance is just 2x the squared deviation from the mean.
res$compared$correlations %>%
       arrange(desc(average)) %>%
  head()
##       BRCA1 BRCA2 average  variance
## BRCA1 1.000 0.767  0.8835 0.0271445
## BRCA2 0.767 1.000  0.8835 0.0271445
## POLQ  0.856 0.841  0.8485 0.0001125
## KIF14 0.853 0.831  0.8420 0.0002420
## CASC5 0.822 0.858  0.8400 0.0006480
## MCM10 0.861 0.800  0.8305 0.0018605
  1. The p values of the correlation calculation.
head(res$compared$`P values`)
##                BRCA1        BRCA2
## A1BG    1.238588e-05 3.916497e-05
## A1CF    1.949842e-05 4.291381e-05
## A2M     7.305334e-07 9.776700e-07
## A2ML1   2.229658e-04 3.202417e-02
## A2MP1   3.044798e-06 3.472622e-06
## A3GALT2 3.380024e-04 1.680602e-04
  1. The combined results of corGSEA for BRCA1 and BRCA2
head(res$compared$correlatedPathwaysDataFrame)
##                                                     ID NES_BRCA1 pvalue_BRCA1
## 409  GO_GENERATION_OF_PRECURSOR_METABOLITES_AND_ENERGY  1.502239 0.0005405405
## 1535       GO_REGULATION_OF_NEUROTRANSMITTER_TRANSPORT -1.345640 0.0219780220
## 275                   GO_DETECTION_OF_ABIOTIC_STIMULUS -1.545303 0.0022123894
## 212                            GO_CHEMOKINE_PRODUCTION -2.521010 0.0019305019
## 383                    GO_FATTY_ACID_CATABOLIC_PROCESS -1.607786 0.0021008403
## 135  GO_CD4_POSITIVE_ALPHA_BETA_T_CELL_DIFFERENTIATION -2.223843 0.0018484288
##      p.adjust_BRCA1
## 409     0.005632642
## 1535    0.040663790
## 275     0.007440358
## 212     0.007321919
## 383     0.007380703
## 135     0.007321919
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 core_enrichment_BRCA1
## 409  CDK1/MTFR2/CCNB1/NUP155/NDC1/NUP107/NUP205/MSH2/NUP43/NUP37/NUP160/NUP188/NUP93/NUP153/NUP85/NUP35/PNPT1/NUP88/NUP50/NUP133/SEH1L/TPR/RAE1/NUP58/NUP54/NUP62/NUP98/ADSL/RPE/PPP1CC/SHMT2/MYBBP1A/MTFR1/MTOR/TRAP1/GLRX3/FOXK2/SLC25A13/IREB2/ENO1/TEFM/PASK/DLAT/STOML2/POLG2/PGM2/CYB5B/IDE/TXNRD1/CIAPIN1/TKT/COX15/PHB2/PHGDH/PKM/GSR/MYC/CYCS/RANBP2/AAAS/GLRX2/PGD/G6PD/PRELID1/FH/PGAM1/PANK2/RPIA/NOA1/TACO1/PPIF/FXN/VCP/CS/COX10/NDUFAF2/NUP214/FDXR/POM121/LDHA/COA6/PDE12/XYLB/SHPK/TPI1/TIGAR/GPD2/ETFA/GAPDH/COX11/DLD/GNPDA1/FOXK1/PPP1CA/UQCRH/GPI/TP53/CYC1/EIF6/NUP210/MDH2/PGK1/NDUFS6/GAPDHS/ALDH1B1/POM121C/PFKP/DHTKD1/PDHA1/PRKAA1/UQCC3/SLC25A22/ADPGK/IDH3B/NRF1/SEC13/GSK3B/SLC25A14/NCOR1/DERA/PTGES2/FECH/LYRM7/NDUFS1/NDUFAB1/PYGL/HK2/UQCC2/FDX2/IDH3A/PFKM/SDHB/GLRX5/RB1CC1/PHLDA2/SRD5A1/ME2/NDUFA12/COX5A/OXCT1/SDHA/VGF/TSTA3/ADH5/NDUFS3/PARK7/BID/CISD1/PFKFB4/PHKA1/NDUFA8/IDH1/TALDO1/GFPT1/NDUFB9/NDUFB6/COX6A1/NDUFS5/SLC25A33/UQCRFS1/DLST/GYS1/GALK1/ATP7A/DEGS1/PHKG2
## 1535                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 APBA1/LRRK2/ATP1A2/CACNA1D/MEF2C/ADRA1A/TACR2/HTR2A/P2RX1/CACNB2/PRKCB/SYT11/SNCAIP/SYN1/CAMK2A/BAIAP3/KMO/PER2/GPER1/PRRT2/ADORA2A/KCNC4/CNR1/ARL6IP5/GRIK5/DGKI/CHRNA4/NOS1/CHRM2/SYT9/CPLX1/CPLX3/SYT7/ITGB3/SNCG/FBXL20/SYT4/GRIN3A/PPFIA2/GPM6B/DRD1/MCTP2/RIMS1/SYP/NAPA/VAMP1/P2RY4/STX1B/SNCA/RAP1A/BACE1/KCNMB4/ADCY1/RAB3A/CHRNB3/PNKD/NAPB/CPLX2/DRD4
## 275                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    CXCL12/HPN/BEST1/PDE6B/TRPM3/PHF24/GPR88/ANO1/HTR2A/CXCR4/TAC1/KIT/TACR1/PLEKHB1/KCNA1/CNGA1/CABP4/ANO3/GNGT2/OPN4/EPHB1/SEMA5B/CALCA/CACNA1F/TMEM120A/GRM6/PKD2L1/CACNA2D4/PKD1L1/PKD1L2/LXN/TTN/STRC/CALM1/TCAP/RCVRN/RGR/PDE6C/CRB1/TMC2/PKD1L3/TRPV1/ARRB1/ASIC2/SAG/ATP8A2/ABCA4/FYN/GRIK2/EYS/TMC1/SCN1A
## 212                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      CD74/CSF1R/HAVCR2/APOD/IL33/TLR2/AIF1/ACKR1/LGALS9/TREM2/CLEC7A/TLR4/TLR7/C1QTNF3/IL1RL1/ADCYAP1/FFAR2/LPL/FFAR3/S100A9/MBP/S100A8/IL10/FOXP1/IL6R/SIRPA/EGR1/DEFB124/MEFV/TLR3/ALOX15B/IL7/ADIPOQ/IFNG/PYCARD/KLF4/LBP/TLR9/TNF/SIGIRR/AIRE/CXCL6/TRPV4/SYK/NR1H4/CHIA/TSLP
## 383                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                PLIN5/ECHDC2/ETFBKMT/ACOX2/ACADL/MLYCD/MMAA/ACACB/PCK1/FAAH/CYP4F12/CYP4A11/PPARA/BDH2/ABCD2/ACAA1/NUDT7/HAO2/ADIPOQ/ACADS/LEP/PHYH/CYP4F3/CNR1/CRAT/FABP1/PCCA/LIPE/ACOX1/ETFDH/HPGD/HAO1/DECR1/IRS2/CYP4F2/AIG1/ADTRP/ABCD4/ABCB11/MCEE/SCP2/LPIN3/PPARD/AUH/ACADVL/ABHD1/ACAD11
## 135                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              RORA/RORC/BCL6/GPR183/CD86/LGALS9/SATB1/SASH3/CCL19/JAK3/RSAD2/NCKAP1L/SEMA4A/TBX21/SLAMF6/IL18R1/IL12RB1/IL27/FOXP1/LY9/NLRP3/HLX/BATF/NFKBIZ/PTGER4/IRF4/IFNG/SMAD7/BCL3/CD80/STAT3/FUT7/PLA2G2D/TMEM98/STAT6/TNFSF4/TOX/SOCS1/SPN
##      NES_BRCA2 pvalue_BRCA2 p.adjust_BRCA2
## 409  -1.399468  0.001795332    0.005231600
## 1535 -2.155775  0.001322751    0.004752628
## 275  -2.337813  0.001333333    0.004752628
## 212  -1.757913  0.001295337    0.004752628
## 383  -2.359113  0.001324503    0.004752628
## 135  -1.481065  0.016393443    0.032169003
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     core_enrichment_BRCA2
## 409  MAOB/COX7A1/PINK1/PPP1R1A/COX4I2/ALDH2/ADGRF5/GPD1/SORBS1/ADH1B/PCDH12/KL/AVPR1A/DMGDH/NR1D1/PGAM2/NUPR1/IGF1/DHRS3/HMGCLL1/PYGM/PPARGC1A/MTFR1L/MT3/MT-ND3/STEAP4/POMC/NDUFA4L2/SIRT3/ALDH1A1/ETFBKMT/SLC4A4/MT-ND6/ACSS3/PPP1R3E/MT-CYB/MLXIPL/MT-ND1/SLC25A4/HMGCL/ACSS1/PPP1R3F/ME3/SLC25A18/ADH1C/CYBB/INSR/MT-ND2/FBP1/MT-ND4/INPP5K/PPP1R3C/MT-ATP6/HAAO/COX6A2/MT-CO1/ACSM1/QDPR/ZBTB20/THTPA/PPARA/MT-ND5/ALDOB/PID1/HK3/ALDOC/MT-CO3/RBKS/ISCU/ADH1A/NHLRC1/CHCHD10/ACADVL/SLC25A23/GCK/MT-ND4L/CBFA2T3/PFKFB1/GCGR/AK9/BDH2/ESRRB/STBD1/H6PD/NOX4/NFATC4/NR4A3/MT-ATP8/HMGCS2/PPP1R3G/IGF2/ACSS2/PHKG1/PRDM16/MT-CO2/SDHAF4/GIPR/ETFDH/COQ10A/CYB5A/GNMT/PPP1R3B/WDR93/NDUFA3/ADIPOQ/P2RX7/IDO1/IRS2/LEP/ETFB/G6PC/GLRX/OGDHL/AKR7A3/BDH1/HTR2A/DNAJC15/GYS2/BLOC1S1/CEBPA/GAA/NCF1/MCHR1/GCKR/ALDH4A1/ZBTB7A/AOX1/STAT3/CAT/ACO2/PPP1R3A
## 1535                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ATP1A2/APBA1/SYN1/LRRK2/ADRA1A/RAB3A/CPLX3/BAIAP3/CAMK2A/CHRNA4/CPLX1/GRIK5/CACNB2/SNCG/PRRT2/SYP/MEF2C/SYT7/NAPA/SYT9/CACNA1D/GPER1/DRD1/CNR1/PRKCB/KCNC4/SYT11/NAPB/ADCY1/P2RX1/STXBP1/PNKD/ARL6IP5/STX1B/VAMP1/SYT4/HTR2A/CHRM2/TACR2/BACE1/CPLX2/ADORA2A/DGKI/FLOT1/PPFIA2/SNCAIP/GPM6B/DRD4/UNC13B/CPLX4/DTNBP1/CHRNB3/SNCA/PPP1R9A/PER2
## 275                                                                                                                                                                                                                                                                                                                                                                                                     CXCL12/PLEKHB1/HPN/PHF24/OPN4/TMEM120A/PDE6B/CNGA1/TRPM3/TCAP/TRPV1/CACNA1F/SEMA5B/GPR88/ANO1/GUCA1B/GUCA1C/RS1/GNGT2/PKD2L1/RCVRN/ANO3/TAC1/CABP4/BEST1/KCNA1/GRM6/RHO/GUCY2D/ABCA4/CRB1/PDE6G/EPHB1/ASIC3/ASIC2/CACNA2D4/GNAT1/WHRN/HTR2A/TACR1/PKD1L1/CXCR4/KIT/GUCA1A/CALCA/BACE1/REEP6/GRK1/CSRP3/ADORA1/NGFR/NR2E3/GRK4/RGR/GUCY2F/PDC/ATP8A2/RRH/PDE6C/CALM1/GRK7/STRC/CNGB1/OPN1MW/RP1/KCNK4/SAG/PKD1L2/PKD1/GRIK2/NTRK1/FYN/AIPL1/UNC119
## 212                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ACKR1/CD74/APOD/CSF1R/IL33/LPL/AIF1/HAVCR2/TREM2/LGALS9/C1QTNF3/SIRPA/MBP/ADCYAP1/TLR2/EGR1/DEFB124/SIGIRR/FFAR3/LBP/TLR4/ADIPOQ/S100A8/IL1RL1/S100A9/CLEC7A/ALOX15B/IL6R/TLR7/TSLP/TLR9/NR1H4/TLR3/TUSC2/FFAR2/AGER/KLF4/SYK/CHIA/MAP2K5/MEFV/PYCARD/AIRE/CXCL6
## 383                                                                                                                                                                                                                                                                                                                                                                                                                                         ECHDC2/ACOX2/PLIN5/MLYCD/ACACB/FAAH/ACADL/ETFBKMT/ACAA1/NUDT7/PHYH/PCK1/CYP4F12/ACADS/CRAT/ABCD2/PPARA/ACADVL/BDH2/LIPE/CYP4A11/AIG1/CPT1B/CNR1/AUH/ETFDH/MMAA/DECR1/ECH1/ACAD11/HAO2/ADIPOQ/IRS2/ABCD4/LEP/ETFB/PCCA/IVD/ABHD16A/MCEE/ACAD10/ACOT8/HADHB/FABP1/PPARD/SCP2/CYP4F3/HAO1/ABCB11/LPIN3/HPGD/ACAA2/HADH/PLA2G15/CYP4F2/ABHD1/ACOX1/CROT/AMACR/ALDH3A2/LONP2/EHHADH/ILVBL/CPT1C/CYP4F11/ECI2/DECR2
## 135                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           RORC/BCL6/RORA/SATB1/LGALS9/CCL19/CD86/SASH3/SEMA4A/JAK3/RSAD2/GPR183/TBX21/IL18R1/BCL3/SMAD7/TMEM98/NCKAP1L/STAT3/HLX/IL27/TOX/STAT6/SLAMF6/PRKCZ/ZBTB7B/IL12RB1/FUT7/CTSL/RARA/NLRP3/BATF
##      NES_average NES_variance
## 409   0.05138567    4.2099503
## 1535 -1.75070718    0.3281596
## 275  -1.94155818    0.3140364
## 212  -2.13946184    0.2911586
## 383  -1.98344954    0.2822456
## 135  -1.85245403    0.2758598
  1. The VST-transformed counts for BRCA1 and BRCA2 across all tissues
head(res$compared$VST_Data)
##                        Group    samples   VST  Gene
## 1: Female Reproductive - All  GSM741172 10.69 BRCA1
## 2: Female Reproductive - All  GSM741170 11.26 BRCA1
## 3: Female Reproductive - All  GSM741171 10.48 BRCA1
## 4: Female Reproductive - All GSM1098188 11.08 BRCA1
## 5: Female Reproductive - All  GSM800466 10.60 BRCA1
## 6: Female Reproductive - All  GSM988637 10.93 BRCA1
  1. A scatter plot comparing the genome-wide co-expression correlations for BRCA1 and BRCA2.
res$compared$correlationPlot

  1. The same plot, binned to reduce the computational requirements for plotting:
res$compared$correlationPlotBin

  1. A heatmap showing the genes with the top variance between BRCA1 and BRCA2 by co-expression correlation. This is simply a measure of the absolute difference between them.
res$compared$correlationVarianceHeatmap

  1. A heatmap showing the genes with the top similarity in co-expression correlation between BRCA1 and BRCA2.
res$compared$correlationSimilarityHeatmap

  1. A heatmap showing the pathways with the top variance between BRCA1 and BRCA2 by corGSEA score.
res$compared$pathwayVarianceHeatmap

  1. A heatmap showing the pathways with the top similarity in corGSEA score between BRCA1 and BRCA2.
res$compared$pathwaySimilarityHeatmap

Cross-compare mode

In analyzeGenePairs(), cross-compare mode allows the user to analyze the co-expression of two genes across all tissue-disease conditions (geneVsGene) or one gene in cancer vs normal (normalVsCancer).

Gene vs Gene

When genesOfInterest is supplied with two different genes and crossCompareMode=TRUE, then geneVsGene mode is executed.

res <- analyzeGenePairs(genesOfInterest = c("BRCA1", "BRCA2"), 
                        crossCompareMode = TRUE)
## 
## Running cross comparison mode ... 
## 
## Gene one is not the same as gene two ... 
## 
## Will perform comparison of BRCA1 and BRCA2 across all available tissue-disease conditions... 
## 
## Retrieving any missing correlation data...
## 
## Analyzing: BRCA1...1
## Analyzing: BRCA1...2
## Analyzing: BRCA1...3
## Analyzing: BRCA1...4
## Analyzing: BRCA1...5
## Analyzing: BRCA1...6
## Analyzing: BRCA1...7
## Analyzing: BRCA1...8
## Analyzing: BRCA1...9
## Analyzing: BRCA1...10
## Analyzing: BRCA1...11
## Analyzing: BRCA1...12
## Analyzing: BRCA1...13
## Analyzing: BRCA1...14
## Analyzing: BRCA1...15
## Analyzing: BRCA1...16
## Analyzing: BRCA1...17
## Analyzing: BRCA1...18
## Analyzing: BRCA1...19
## Analyzing: BRCA1...20
## Analyzing: BRCA1...21
## Analyzing: BRCA1...22
## Analyzing: BRCA1...23
## Analyzing: BRCA1...24
## Analyzing: BRCA1...25
## Analyzing: BRCA1...26
## Analyzing: BRCA1...27
## Analyzing: BRCA1...28
## Analyzing: BRCA1...29
## Analyzing: BRCA1...30
## Analyzing: BRCA1...31
## Analyzing: BRCA1...32
## Analyzing: BRCA1...33
## Analyzing: BRCA1...34
## Analyzing: BRCA1...35
## Analyzing: BRCA1...36
## Analyzing: BRCA1...37
## Analyzing: BRCA1...38
## Analyzing: BRCA1...39
## Analyzing: BRCA1...40
## Analyzing: BRCA1...41
## Analyzing: BRCA1...42
## Analyzing: BRCA1...43
## Analyzing: BRCA1...44
## Analyzing: BRCA2...45
## Analyzing: BRCA2...46
## Analyzing: BRCA2...47
## Analyzing: BRCA2...48
## Analyzing: BRCA2...49
## Analyzing: BRCA2...50
## Analyzing: BRCA2...51
## Analyzing: BRCA2...52
## Analyzing: BRCA2...53
## Analyzing: BRCA2...54
## Analyzing: BRCA2...55
## Analyzing: BRCA2...56
## Analyzing: BRCA2...57
## Analyzing: BRCA2...58
## Analyzing: BRCA2...59
## Analyzing: BRCA2...60
## Analyzing: BRCA2...61
## Analyzing: BRCA2...62
## Analyzing: BRCA2...63
## Analyzing: BRCA2...64
## Analyzing: BRCA2...65
## Analyzing: BRCA2...66
## Analyzing: BRCA2...67
## Analyzing: BRCA2...68
## Analyzing: BRCA2...69
## Analyzing: BRCA2...70
## Analyzing: BRCA2...71
## Analyzing: BRCA2...72
## Analyzing: BRCA2...73
## Analyzing: BRCA2...74
## Analyzing: BRCA2...75
## Analyzing: BRCA2...76
## Analyzing: BRCA2...77
## Analyzing: BRCA2...78
## Analyzing: BRCA2...79
## Analyzing: BRCA2...80
## Analyzing: BRCA2...81
## Analyzing: BRCA2...82
## Analyzing: BRCA2...83
## Analyzing: BRCA2...84
## Analyzing: BRCA2...85
## Analyzing: BRCA2...86
## Analyzing: BRCA2...87
## Analyzing: BRCA2...88

This analysis produces a list containing several figures and tables:

  1. The co-expression correlation results within each tissue-disease condition, along with the average co-expression values and variance for each gene.
res$Correlations %>%
       arrange(desc(average)) %>%
  head(n=3)
##       BRCA1_Adipose_Cancer BRCA2_Adipose_Cancer BRCA1_Adipose_Normal
## BRCA2                0.891                1.000                0.568
## BRCA1                1.000                0.891                1.000
## CASC5                0.817                0.813                0.576
##       BRCA2_Adipose_Normal BRCA1_Bladder_Cancer BRCA2_Bladder_Cancer
## BRCA2                1.000                0.813                1.000
## BRCA1                0.568                1.000                0.813
## CASC5                0.833                0.902                0.849
##       BRCA1_Bone_Cancer BRCA2_Bone_Cancer BRCA1_Bone_Normal BRCA2_Bone_Normal
## BRCA2             0.592             1.000             0.857             1.000
## BRCA1             1.000             0.592             1.000             0.857
## CASC5             0.674             0.893             0.888             0.847
##       BRCA1_Brain_Cancer BRCA2_Brain_Cancer BRCA1_Brain_Normal
## BRCA2              0.819              1.000              0.738
## BRCA1              1.000              0.819              1.000
## CASC5              0.822              0.875              0.742
##       BRCA2_Brain_Normal BRCA1_Cardiac_Normal BRCA2_Cardiac_Normal
## BRCA2              1.000                0.451                1.000
## BRCA1              0.738                1.000                0.451
## CASC5              0.907                0.456                0.811
##       BRCA1_Cartilage_Normal BRCA2_Cartilage_Normal BRCA1_Endothelial_Normal
## BRCA2                  0.638                  1.000                    0.764
## BRCA1                  1.000                  0.638                    1.000
## CASC5                  0.732                  0.684                    0.861
##       BRCA2_Endothelial_Normal BRCA1_Esophagus_Cancer BRCA2_Esophagus_Cancer
## BRCA2                    1.000                  0.060                   1.00
## BRCA1                    0.764                  1.000                   0.06
## CASC5                    0.840                  0.654                   0.36
##       BRCA1_Esophagus_Normal BRCA2_Esophagus_Normal
## BRCA2                  0.707                  1.000
## BRCA1                  1.000                  0.707
## CASC5                  0.953                  0.817
##       BRCA1_Female_reproductive_Cancer BRCA2_Female_reproductive_Cancer
## BRCA2                            0.623                            1.000
## BRCA1                            1.000                            0.623
## CASC5                            0.710                            0.785
##       BRCA1_Female_reproductive_Normal BRCA2_Female_reproductive_Normal
## BRCA2                            0.841                            1.000
## BRCA1                            1.000                            0.841
## CASC5                            0.882                            0.911
##       BRCA1_Immune_Cancer BRCA2_Immune_Cancer BRCA1_Immune_Normal
## BRCA2               0.585               1.000               0.610
## BRCA1               1.000               0.585               1.000
## CASC5               0.815               0.651               0.841
##       BRCA2_Immune_Normal BRCA1_Intestines_Cancer BRCA2_Intestines_Cancer
## BRCA2               1.000                   0.778                   1.000
## BRCA1               0.610                   1.000                   0.778
## CASC5               0.682                   0.706                   0.794
##       BRCA1_Intestines_Normal BRCA2_Intestines_Normal BRCA1_Kidney_Cancer
## BRCA2                   0.821                   1.000               0.842
## BRCA1                   1.000                   0.821               1.000
## CASC5                   0.527                   0.614               0.883
##       BRCA2_Kidney_Cancer BRCA1_Kidney_Normal BRCA2_Kidney_Normal
## BRCA2               1.000               0.931               1.000
## BRCA1               0.842               1.000               0.931
## CASC5               0.926               0.820               0.822
##       BRCA1_Liver_Cancer BRCA2_Liver_Cancer BRCA1_Liver_Normal
## BRCA2              0.821              1.000              0.505
## BRCA1              1.000              0.821              1.000
## CASC5              0.767              0.857              0.477
##       BRCA2_Liver_Normal BRCA1_Male_reproductive_Normal
## BRCA2              1.000                          0.409
## BRCA1              0.505                          1.000
## CASC5              0.612                          0.643
##       BRCA2_Male_reproductive_Normal BRCA1_Mammary_Cancer BRCA2_Mammary_Cancer
## BRCA2                          1.000                0.690                1.000
## BRCA1                          0.409                1.000                0.690
## CASC5                          0.629                0.799                0.713
##       BRCA1_Mammary_Normal BRCA2_Mammary_Normal BRCA1_Muscle_Cancer
## BRCA2                0.845                1.000               0.764
## BRCA1                1.000                0.845               1.000
## CASC5                0.908                0.883               0.895
##       BRCA2_Muscle_Cancer BRCA1_Muscle_Normal BRCA2_Muscle_Normal
## BRCA2               1.000               0.755               1.000
## BRCA1               0.764               1.000               0.755
## CASC5               0.796               0.773               0.888
##       BRCA1_Pancreas_Cancer BRCA2_Pancreas_Cancer BRCA1_Pancreas_Normal
## BRCA2                 0.771                 1.000                 0.708
## BRCA1                 1.000                 0.771                 1.000
## CASC5                 0.760                 0.834                 0.778
##       BRCA2_Pancreas_Normal BRCA1_Prenatal_Cancer BRCA2_Prenatal_Cancer
## BRCA2                 1.000                 0.701                 1.000
## BRCA1                 0.708                 1.000                 0.701
## CASC5                 0.879                 0.775                 0.858
##       BRCA1_Prenatal_Normal BRCA2_Prenatal_Normal BRCA1_Prostate_Cancer
## BRCA2                 0.571                 1.000                 0.808
## BRCA1                 1.000                 0.571                 1.000
## CASC5                 0.538                 0.742                 0.793
##       BRCA2_Prostate_Cancer BRCA1_Prostate_Normal BRCA2_Prostate_Normal
## BRCA2                 1.000                 0.898                 1.000
## BRCA1                 0.808                 1.000                 0.898
## CASC5                 0.861                 0.942                 0.918
##       BRCA1_Respiratory_Cancer BRCA2_Respiratory_Cancer
## BRCA2                    0.785                    1.000
## BRCA1                    1.000                    0.785
## CASC5                    0.779                    0.832
##       BRCA1_Respiratory_Normal BRCA2_Respiratory_Normal BRCA1_Retina_Normal
## BRCA2                    0.765                    1.000               0.755
## BRCA1                    1.000                    0.765               1.000
## CASC5                    0.854                    0.855               0.779
##       BRCA2_Retina_Normal BRCA1_Skin_Cancer BRCA2_Skin_Cancer BRCA1_Skin_Normal
## BRCA2               1.000             0.724             1.000             0.768
## BRCA1               0.755             1.000             0.724             1.000
## CASC5               0.959             0.800             0.815             0.878
##       BRCA2_Skin_Normal BRCA1_Stem_like_Cancer BRCA2_Stem_like_Cancer
## BRCA2             1.000                  0.585                  1.000
## BRCA1             0.768                  1.000                  0.585
## CASC5             0.846                  0.583                  0.869
##       BRCA1_Stem_like_Normal BRCA2_Stem_like_Normal BRCA1_Stomach_Cancer
## BRCA2                  0.848                  1.000                0.771
## BRCA1                  1.000                  0.848                1.000
## CASC5                  0.849                  0.841                0.778
##       BRCA2_Stomach_Cancer BRCA1_Stomach_Normal BRCA2_Stomach_Normal
## BRCA2                1.000                0.637                1.000
## BRCA1                0.771                1.000                0.637
## CASC5                0.867                0.740                0.904
##       BRCA1_Thyroid_Cancer BRCA2_Thyroid_Cancer BRCA1_Thyroid_Normal
## BRCA2                0.895                1.000                0.519
## BRCA1                1.000                0.895                1.000
## CASC5                0.924                0.941                0.547
##       BRCA2_Thyroid_Normal   average   variance
## BRCA2                1.000 0.8548523 0.03366140
## BRCA1                0.519 0.8548523 0.03366140
## CASC5                0.921 0.7892500 0.01469241
  1. The correlation p values for each condition.
head(res$`P values`, n=3)
##      BRCA1_Adipose_Cancer BRCA2_Adipose_Cancer BRCA1_Adipose_Normal
## A1BG         1.429101e-06         1.233671e-06         1.532356e-05
## A1CF         9.647610e-06         1.633674e-04         3.011732e-04
## A2M          2.451212e-07         7.303493e-08         5.297196e-05
##      BRCA2_Adipose_Normal BRCA1_Bladder_Cancer BRCA2_Bladder_Cancer
## A1BG         1.375515e-05         1.102002e-06         5.193783e-05
## A1CF         1.597039e-05         5.497299e-06         1.488720e-01
## A2M          4.301172e-06         4.363948e-07         2.630311e-06
##      BRCA1_Bone_Cancer BRCA2_Bone_Cancer BRCA1_Bone_Normal BRCA2_Bone_Normal
## A1BG      4.613896e-06      2.781100e-05      2.136895e-03      0.0003726911
## A1CF      2.017450e-01      2.781100e-05      1.132711e-05      0.0001633674
## A2M       3.280996e-06      1.339545e-05      4.212776e-05      0.0003754446
##      BRCA1_Brain_Cancer BRCA2_Brain_Cancer BRCA1_Brain_Normal
## A1BG       7.554884e-05       2.161610e-04       5.738861e-05
## A1CF       1.133493e-02       6.496327e-05       4.504482e-04
## A2M        8.347306e-07       1.489341e-06       1.866402e-05
##      BRCA2_Brain_Normal BRCA1_Cardiac_Normal BRCA2_Cardiac_Normal
## A1BG       5.180937e-04         3.642654e-06         5.977836e-05
## A1CF       1.575096e-05         1.787498e-05         7.596938e-07
## A2M        1.184767e-06         2.908913e-01         2.240981e-06
##      BRCA1_Cartilage_Normal BRCA2_Cartilage_Normal BRCA1_Endothelial_Normal
## A1BG           7.807097e-06           6.745699e-06             3.987952e-05
## A1CF           4.613896e-06           1.077346e-05             1.281731e-03
## A2M            8.479733e-07           5.920962e-06             2.654175e-06
##      BRCA2_Endothelial_Normal BRCA1_Esophagus_Cancer BRCA2_Esophagus_Cancer
## A1BG             1.588460e-04            1.65979e-06           3.974747e-06
## A1CF             1.544883e-04            4.17508e-06           3.160264e-06
## A2M              5.271963e-06            4.17508e-06           3.342691e-05
##      BRCA1_Esophagus_Normal BRCA2_Esophagus_Normal
## A1BG           3.787528e-07           1.339545e-05
## A1CF           1.128868e-06           6.859702e-03
## A2M            8.137162e-08           1.852708e-06
##      BRCA1_Female_reproductive_Cancer BRCA2_Female_reproductive_Cancer
## A1BG                     3.607860e-06                     5.581658e-04
## A1CF                     1.553299e-03                     8.649631e-05
## A2M                      7.724159e-05                     1.943984e-04
##      BRCA1_Female_reproductive_Normal BRCA2_Female_reproductive_Normal
## A1BG                     4.431929e-06                     8.565095e-06
## A1CF                     5.070298e-03                     1.462351e-04
## A2M                      1.128868e-06                     2.752223e-06
##      BRCA1_Immune_Cancer BRCA2_Immune_Cancer BRCA1_Immune_Normal
## A1BG        7.544636e-06         0.042529271        8.666226e-06
## A1CF        1.949842e-05         0.007912909        7.539760e-03
## A2M         6.924488e-05         0.001377529        5.512242e-05
##      BRCA2_Immune_Normal BRCA1_Intestines_Cancer BRCA2_Intestines_Cancer
## A1BG        2.607465e-05            2.781100e-05            6.601797e-04
## A1CF        3.867317e-04            8.851973e-05            4.875614e-04
## A2M         1.943984e-04            2.280738e-06            2.341926e-06
##      BRCA1_Intestines_Normal BRCA2_Intestines_Normal BRCA1_Kidney_Cancer
## A1BG            4.014808e-04            3.616344e-03        1.539589e-06
## A1CF            9.275709e-05            1.418043e-02        1.790749e-06
## A2M             1.176621e-05            1.839613e-05        9.506695e-08
##      BRCA2_Kidney_Cancer BRCA1_Kidney_Normal BRCA2_Kidney_Normal
## A1BG        8.367240e-06        5.672677e-03        2.404929e-04
## A1CF        1.132711e-05        2.236988e-07        2.817186e-07
## A2M         2.451212e-07        7.384143e-08        2.004448e-07
##      BRCA1_Liver_Cancer BRCA2_Liver_Cancer BRCA1_Liver_Normal
## A1BG       3.362405e-07       8.614376e-07       1.491089e-05
## A1CF       3.250303e-06       2.447611e-05       6.777763e-05
## A2M        2.727315e-06       1.866402e-05       1.787498e-05
##      BRCA2_Liver_Normal BRCA1_Male_reproductive_Normal
## A1BG       1.632188e-06                   1.304766e-05
## A1CF       4.093509e-06                   3.255528e-03
## A2M        3.375179e-06                   5.291571e-03
##      BRCA2_Male_reproductive_Normal BRCA1_Mammary_Cancer BRCA2_Mammary_Cancer
## A1BG                   7.544636e-06         2.164735e-03         1.279990e-04
## A1CF                   4.096017e-03         1.220516e-03         4.856115e-04
## A2M                    4.061116e-05         1.501728e-06         4.660806e-06
##      BRCA1_Mammary_Normal BRCA2_Mammary_Normal BRCA1_Muscle_Cancer
## A1BG         8.873033e-06         5.057882e-06        2.391115e-07
## A1CF         7.990411e-03         4.454423e-05        1.165805e-06
## A2M          1.417383e-06         2.854583e-06        8.311306e-08
##      BRCA2_Muscle_Cancer BRCA1_Muscle_Normal BRCA2_Muscle_Normal
## A1BG        2.752223e-06        2.008148e-05        2.854583e-06
## A1CF        1.779931e-04        1.254035e-03        1.354603e-03
## A2M         1.613024e-07        7.900646e-07        2.981349e-07
##      BRCA1_Pancreas_Cancer BRCA2_Pancreas_Cancer BRCA1_Pancreas_Normal
## A1BG          1.253850e-06          1.984152e-06          3.016722e-06
## A1CF          2.583337e-06          2.383783e-06          6.455803e-06
## A2M           2.661080e-07          5.063062e-07          2.777400e-06
##      BRCA2_Pancreas_Normal BRCA1_Prenatal_Cancer BRCA2_Prenatal_Cancer
## A1BG          6.526801e-06          4.431929e-06          1.707612e-03
## A1CF          1.093202e-06          2.372429e-05          4.136039e-05
## A2M           8.453325e-05          1.565426e-06          1.839613e-05
##      BRCA1_Prenatal_Normal BRCA2_Prenatal_Normal BRCA1_Prostate_Cancer
## A1BG          6.361346e-05          1.921505e-05          1.707612e-03
## A1CF          2.335956e-05          1.501728e-06          4.371910e-05
## A2M           2.781100e-05          2.459463e-04          1.429101e-06
##      BRCA2_Prostate_Cancer BRCA1_Prostate_Normal BRCA2_Prostate_Normal
## A1BG          3.269712e-01          7.718359e-06          2.230795e-05
## A1CF          3.231604e-03          8.270464e-06          2.447611e-05
## A2M           1.790749e-06          1.685892e-07          2.127000e-07
##      BRCA1_Respiratory_Cancer BRCA2_Respiratory_Cancer BRCA1_Respiratory_Normal
## A1BG             8.768863e-06             1.893696e-05             3.503310e-04
## A1CF             2.588889e-01             9.481094e-02             8.649631e-05
## A2M              1.175244e-06             6.526801e-06             9.032033e-07
##      BRCA2_Respiratory_Normal BRCA1_Retina_Normal BRCA2_Retina_Normal
## A1BG             2.804638e-04        4.613896e-06        4.130566e-07
## A1CF             1.369830e-03        3.285870e-05        1.147174e-06
## A2M              5.858029e-06        1.102002e-06        9.700721e-08
##      BRCA1_Skin_Cancer BRCA2_Skin_Cancer BRCA1_Skin_Normal BRCA2_Skin_Normal
## A1BG      9.086085e-06      4.805074e-06      5.734624e-06      1.071841e-04
## A1CF      3.230297e-05      3.987952e-05      4.567563e-06      1.502870e-04
## A2M       2.068719e-05      5.076420e-04      1.165805e-06      1.866402e-05
##      BRCA1_Stem_like_Cancer BRCA2_Stem_like_Cancer BRCA1_Stem_like_Normal
## A1BG           4.854374e-06           1.984152e-06           5.920962e-06
## A1CF           2.015195e-04           3.156615e-02           1.526441e-03
## A2M            2.470155e-06           7.051971e-06           3.646805e-05
##      BRCA2_Stem_like_Normal BRCA1_Stomach_Cancer BRCA2_Stomach_Cancer
## A1BG           6.248484e-06         1.477069e-06         4.854374e-06
## A1CF           3.122766e-05         1.357378e-05         8.514839e-02
## A2M            7.390447e-05         6.057403e-07         2.300924e-06
##      BRCA1_Stomach_Normal BRCA2_Stomach_Normal BRCA1_Thyroid_Cancer
## A1BG         5.856752e-05         4.662892e-03         6.316660e-06
## A1CF         1.155136e-04         4.854374e-06         1.633674e-04
## A2M          2.961488e-06         8.175089e-06         1.092494e-07
##      BRCA2_Thyroid_Cancer BRCA1_Thyroid_Normal BRCA2_Thyroid_Normal
## A1BG         4.805074e-06         5.217415e-06         2.970022e-05
## A1CF         3.070451e-03         9.962777e-05         2.260758e-06
## A2M          1.168885e-07         3.573465e-06         8.682541e-07
  1. The VST box plots for each gene across conditions:
ggpubr::ggarrange(res$crossCompareVST$VST_boxPlotOne, res$crossCompareVST$VST_boxPlotTwo,
                  nrow = 2)

  1. The data which the expression boxplots are based upon:
head(res$crossCompareVST$VST_DF)
##                           Group              Tissue sampleType    Samples
## 1: female reproductive - cancer Female Reproductive     Cancer  GSM741172
## 2: female reproductive - cancer Female Reproductive     Cancer  GSM741170
## 3: female reproductive - cancer Female Reproductive     Cancer  GSM741171
## 4: female reproductive - cancer Female Reproductive     Cancer GSM1098188
## 5: female reproductive - cancer Female Reproductive     Cancer  GSM800466
## 6: female reproductive - cancer Female Reproductive     Cancer  GSM988637
##    BRCA1_VST BRCA2_VST
## 1:     10.69     9.232
## 2:     11.26     9.475
## 3:     10.48     8.994
## 4:     11.08     9.474
## 5:     10.60    10.560
## 6:     10.93     9.703
  1. For each tissue-disease condition, a scatter plot of the genome-wide co-expression correlations between BRCA1 and BRCA2.
res$pairResList$`Bone Cancer`$scatterPlot

  1. For each tissue-disease condition, a heatmap showing the top variable genes between BRCA1 and BRCA2.
res$pairResList$`Bone Cancer`$heatMap

Normal vs Cancer

When genesOfInterest is supplied with only one gene, Tissue includes Cancer and Normal, and crossCompareMode=TRUE, then normalVsCancer mode is executed.

res <- analyzeGenePairs(genesOfInterest = c("BRCA1", "BRCA1"), 
                        Tissue = c("Cancer", "Normal"),
                        crossCompareMode = TRUE)
## 
## Running cross comparison mode ... 
## 
## Gene one is the same as gene two ... 
## 
## Will perform normal vs cancer comparison on BRCA1 ... 
## 
## Retrieving any missing correlation data...
## 
## Analyzing: BRCA1...1
## Analyzing: BRCA1...2
## Analyzing: BRCA1...3
## Analyzing: BRCA1...4
## Analyzing: BRCA1...5
## Analyzing: BRCA1...6
## Analyzing: BRCA1...7
## Analyzing: BRCA1...8
## Analyzing: BRCA1...9
## Analyzing: BRCA1...10
## Analyzing: BRCA1...11
## Analyzing: BRCA1...12
## Analyzing: BRCA1...13
## Analyzing: BRCA1...14
## Analyzing: BRCA1...15
## Analyzing: BRCA1...16
## Analyzing: BRCA1...17
## Analyzing: BRCA1...18
## Analyzing: BRCA1...19
## Analyzing: BRCA1...20
## Analyzing: BRCA1...21
## Analyzing: BRCA1...22
## Analyzing: BRCA1...23
## Analyzing: BRCA1...24
## Analyzing: BRCA1...25
## Analyzing: BRCA1...26
## Analyzing: BRCA1...27
## Analyzing: BRCA1...28
## Analyzing: BRCA1...29
## Analyzing: BRCA1...30
## Analyzing: BRCA1...31
## Analyzing: BRCA1...32
## Analyzing: BRCA1...33
## Analyzing: BRCA1...34
## Analyzing: BRCA1...35
## Analyzing: BRCA1...36
## Analyzing: BRCA1...37
## Analyzing: BRCA1...38
## Analyzing: BRCA1...39
## Analyzing: BRCA1...40

The primary difference betwen normalVsCancer and geneVsGene is that analyzeGenePairs will output:

  1. A comparative boxplot showing the difference between cancer and normal conditions across tissues with respect to BRCA1 expression:
res$crossCompareVST$VST_boxPlot

  1. A list of scatter plots in which the genome-wide co-expression correlations for BRCA1 are compared between cancer and normal conditions:
res$pairResList$`Immune - Normal`$scatterPlot

  1. And the list also contains heatmaps showing the top variable genes with respect to BRCA1 gene co-expression between cancer and normal:
res$pairResList$`Immune - Normal`$heatMap

Gene vs Gene List Analysis

This mode provides an empirical approach for determining whether a gene is significantly correlated with a list of genes. This is an alternative to the typical Pearson correlation p value which can only determine whether any two genes are significantly co-expressed. To run this mode, use the geneVsGeneListAnalyze() function:

res <- geneVsGeneListAnalyze(pairedGenesList = list("BRCA1" = c("BRCA2", "EZH2", "CCND1",
                                                         "SLC7A11", "GCLC", "CDKN1A")),
                              Sample_Type = "cancer",
                              Tissue = "bone")
## 
## BRCA1

This returns several plots and tables:

  1. It returns to genome-wide correlations for BRCA1
head(res$correlations)
##            BRCA1
## A1BG    -0.33400
## A1CF    -0.00562
## A2M     -0.36900
## A2ML1   -0.03070
## A2MP1   -0.14200
## A3GALT2 -0.17600
  1. Along with the p values corresponding to these Pearson correlations.
head(res$`P values`)
##                BRCA1
## A1BG    4.613896e-06
## A1CF    2.017450e-01
## A2M     3.280996e-06
## A2ML1   6.372330e-03
## A2MP1   6.924488e-05
## A3GALT2 3.583187e-05
  1. It returns a histogram showing the genome-wide co-expression correlations for BRCA1 along with the secondary gene list annotated on top:
res$BRCA1$Correlation_histogram

  1. A plot showing the distribution of p values from bootstrapping with the observed p values for the specified gene list. NOTE that the summit represents the point with the highest density from the empirical distribution, not necessarily a specific observation.
res$BRCA1$sigTest$tTest_pvalsPlot

  1. A plot show the empirical distribution of bootstrapped mean and median correlation values with the observed correlation for the specified gene list shown, along with a p value that indicates significance. NOTE that this uses a simplistic approach to finding significance (anything > .95 is significant) and the method used above is preferred.
res$BRCA1$sigTest$meansPlot

res$BRCA1$sigTest$mediansPlot

  1. The data accompanying each plot:
data.frame(means = res$BRCA1$sigTest$means, 
           medians = res$BRCA1$sigTest$medians,
           pvals = res$BRCA1$sigTest$tTest_pvals) %>% head()
##          means  medians      pvals
## 1  0.068300000  0.03140 0.01434408
## 2 -0.001123333  0.01548 0.01742272
## 3  0.060450000  0.03335 0.09604538
## 4 -0.089833333 -0.06665 0.02779362
## 5 -0.047033333 -0.06365 0.02306242
## 6  0.080900000  0.10330 0.03642956

Gene List Topology Analysis

Many methods for dimensionality reduction exist, but most are focused on sample-level comparisons and few methods for analyzing feature-space topology exist. In the final analysis mode, correlationAnalyzeR uses gene co-expression correlation values as a metric for dimensionality reduction via PCA and tSNE with agglomerative clustering to determine the topology of a list of genes.

The analysis can be accessed using the analyzeGenesetTopology() function from this package:

genesOfInterest <- c("CDK12", "AURKB", "SFPQ", "NFKB1", "BRCC3", "BRCA2", "PARP1",
                     "EZH2", "CCND1", "SLC7A11", "GCLC", "CDKN1A", "MTAP",
                     "DHX9", "SON", "AURKA", "SETX", "BRCA1", "ATMIN")
res <- analyzeGenesetTopology(genesOfInterest = genesOfInterest,
                              Sample_Type = "cancer", Tissue = "bone")
## 
## Retrieving TERM2GENE...
## 
## Retrieving correlation data...
## 
## Starting cross comparison

This produces several tables and figures:

  1. The co-expression correlations for each gene in the supplied gene list:
head(res$Correlation_Data)
##           CDK12    AURKB    SFPQ   NFKB1  BRCC3  BRCA2   PARP1   EZH2  CCND1
## A1BG    -0.3020 -0.00278 -0.0733 -0.1760 -0.324 -0.191 -0.1790 -0.208  0.145
## A1CF     0.0304 -0.35900 -0.3700 -0.0765 -0.185  0.191 -0.4850 -0.266 -0.379
## A2M     -0.2210 -0.35200 -0.1770  0.1520 -0.122 -0.241 -0.2630 -0.316 -0.345
## A2ML1   -0.1720  0.00964  0.2400 -0.4040 -0.177  0.355  0.0113  0.499  0.469
## A2MP1   -0.1550 -0.32100 -0.4150 -0.0834 -0.111 -0.232 -0.3550 -0.327 -0.471
## A3GALT2 -0.2530 -0.02010  0.0612 -0.1290 -0.118 -0.113 -0.1110  0.229  0.106
##         SLC7A11    GCLC  CDKN1A    MTAP    DHX9      SON  AURKA    SETX
## A1BG    -0.0709 -0.1650 -0.0318 -0.1840 -0.2200 -0.39200 -0.206 -0.1600
## A1CF    -0.0222  0.0385 -0.0092  0.1890 -0.3150 -0.23000 -0.124  0.0645
## A2M     -0.2830  0.0868  0.2670  0.1180 -0.2720  0.00385 -0.346 -0.0429
## A2ML1    0.1820 -0.3260 -0.5230 -0.0161  0.1810 -0.19900 -0.115  0.2600
## A2MP1   -0.3310  0.0580  0.1440  0.1820 -0.3630 -0.15500 -0.231 -0.2190
## A3GALT2 -0.1460 -0.3610 -0.0927  0.0407 -0.0379 -0.02750 -0.311 -0.0688
##            BRCA1    ATMIN
## A1BG    -0.33400 -0.07740
## A1CF    -0.00562 -0.11600
## A2M     -0.36900 -0.00942
## A2ML1   -0.03070 -0.06380
## A2MP1   -0.14200 -0.05840
## A3GALT2 -0.17600 -0.21200
  1. The p values corresponding to these co-expression correlations:
head(res$`P values`)
##                CDK12        AURKB         SFPQ        NFKB1        BRCC3
## A1BG    6.455803e-06 3.019223e-01 5.076420e-04 3.583187e-05 5.110386e-06
## A1CF    6.549620e-03 3.607860e-06 3.250303e-06 4.469452e-04 3.070741e-05
## A2M     1.762152e-05 3.860133e-06 3.521007e-05 5.624057e-05 1.098700e-04
## A2ML1   3.846702e-05 9.911473e-02 1.357378e-05 2.383783e-06 3.521007e-05
## A2MP1   5.297196e-05 5.271963e-06 2.163862e-06 3.453293e-04 1.462351e-04
## A3GALT2 1.147113e-05 1.992120e-02 8.670981e-04 9.275709e-05 1.215453e-04
##                BRCA2        PARP1         EZH2        CCND1      SLC7A11
## A1BG    2.781100e-05 3.400797e-05 2.131666e-05 6.496327e-05 5.605105e-04
## A1CF    2.781100e-05 1.204068e-06 9.765120e-06 2.988953e-06 1.539160e-02
## A2M     1.339545e-05 1.012866e-05 5.555476e-06 4.134050e-06 7.988439e-06
## A2ML1   3.749491e-06 7.411171e-02 1.075831e-06 1.371571e-06 3.230297e-05
## A2MP1   1.511542e-05 3.749491e-06 4.954847e-06 1.349286e-06 4.756385e-06
## A3GALT2 1.385537e-04 1.462351e-04 1.575096e-05 1.680602e-04 6.361346e-05
##                 GCLC       CDKN1A         MTAP         DHX9          SON
## A1BG    4.371910e-05 5.773534e-03 3.122766e-05 1.787498e-05 2.654175e-06
## A1CF    3.353589e-03 1.072106e-01 2.873548e-05 5.614415e-06 1.553538e-05
## A2M     3.064001e-04 9.647610e-06 1.215453e-04 9.086085e-06 2.646928e-01
## A2ML1   5.006040e-06 8.890480e-07 3.444274e-02 3.285870e-05 2.447611e-05
## A2MP1   1.016110e-03 6.635088e-05 3.230297e-05 3.472622e-06 5.297196e-05
## A3GALT2 3.539464e-06 2.515643e-04 2.858100e-03 3.508101e-03 8.647497e-03
##                AURKA         SETX        BRCA1        ATMIN
## A1BG    2.197104e-05 4.805570e-05 4.613896e-06 4.316206e-04
## A1CF    1.045840e-04 7.422648e-04 2.017450e-01 1.279990e-04
## A2M     4.093509e-06 2.454713e-03 3.280996e-06 1.030775e-01
## A2ML1   1.313956e-04 1.050948e-05 6.372330e-03 7.666517e-04
## A2MP1   1.532356e-05 1.813315e-05 6.924488e-05 9.957179e-04
## A3GALT2 5.858029e-06 6.129114e-04 3.583187e-05 2.008148e-05
  1. A heatmap of the top 50 variant genes across the gene list by co-expression values:
res$variantGenesHeatmap_Top

  1. The data matrix accompanying this heatmap:
head(res$variantGenesHeatmap_Top_MAT)
##           CDK12 AURKB  SFPQ  NFKB1    BRCC3 BRCA2 PARP1  EZH2 CCND1 SLC7A11
## KIAA1456 -0.217 0.157 0.411 -0.454 -0.03340 0.312 0.179 0.734 0.671   0.298
## HOOK1    -0.188 0.176 0.434 -0.396  0.05760 0.269 0.270 0.782 0.674   0.302
## GDF6     -0.161 0.245 0.456 -0.371  0.00420 0.242 0.287 0.761 0.668   0.298
## DCDC2    -0.159 0.175 0.439 -0.425  0.00941 0.300 0.252 0.714 0.691   0.276
## LIPI     -0.180 0.228 0.445 -0.399  0.06830 0.287 0.300 0.767 0.688   0.320
## UGT3A2   -0.194 0.261 0.436 -0.384  0.03570 0.227 0.308 0.773 0.703   0.291
##            GCLC CDKN1A     MTAP  DHX9      SON    AURKA  SETX   BRCA1    ATMIN
## KIAA1456 -0.328 -0.651 -0.04730 0.324 -0.05300 -0.08060 0.327 0.02680 -0.04460
## HOOK1    -0.354 -0.626  0.02920 0.400  0.00424 -0.06330 0.337 0.02200  0.00424
## GDF6     -0.358 -0.638 -0.07600 0.387  0.03430 -0.03340 0.297 0.04750 -0.05040
## DCDC2    -0.316 -0.658 -0.05990 0.383 -0.04020 -0.03100 0.335 0.04220 -0.00426
## LIPI     -0.298 -0.638  0.00739 0.415  0.02420 -0.00376 0.319 0.05240  0.01260
## UGT3A2   -0.321 -0.609 -0.07610 0.406  0.03660 -0.01810 0.270 0.00819 -0.01660
  1. A heatmap of the top 500 variant genes across the gene list by co-expression values:
res$variantGenesHeatmap

  1. The data matrix accompanying this heatmap:
head(res$variantGenesHeatmap_MAT)
##           CDK12 AURKB  SFPQ  NFKB1    BRCC3 BRCA2 PARP1  EZH2 CCND1 SLC7A11
## KIAA1456 -0.217 0.157 0.411 -0.454 -0.03340 0.312 0.179 0.734 0.671   0.298
## HOOK1    -0.188 0.176 0.434 -0.396  0.05760 0.269 0.270 0.782 0.674   0.302
## GDF6     -0.161 0.245 0.456 -0.371  0.00420 0.242 0.287 0.761 0.668   0.298
## DCDC2    -0.159 0.175 0.439 -0.425  0.00941 0.300 0.252 0.714 0.691   0.276
## LIPI     -0.180 0.228 0.445 -0.399  0.06830 0.287 0.300 0.767 0.688   0.320
## UGT3A2   -0.194 0.261 0.436 -0.384  0.03570 0.227 0.308 0.773 0.703   0.291
##            GCLC CDKN1A     MTAP  DHX9      SON    AURKA  SETX   BRCA1    ATMIN
## KIAA1456 -0.328 -0.651 -0.04730 0.324 -0.05300 -0.08060 0.327 0.02680 -0.04460
## HOOK1    -0.354 -0.626  0.02920 0.400  0.00424 -0.06330 0.337 0.02200  0.00424
## GDF6     -0.358 -0.638 -0.07600 0.387  0.03430 -0.03340 0.297 0.04750 -0.05040
## DCDC2    -0.316 -0.658 -0.05990 0.383 -0.04020 -0.03100 0.335 0.04220 -0.00426
## LIPI     -0.298 -0.638  0.00739 0.415  0.02420 -0.00376 0.319 0.05240  0.01260
## UGT3A2   -0.321 -0.609 -0.07610 0.406  0.03660 -0.01810 0.270 0.00819 -0.01660
  1. The same as (5), but with co-correlative genes (genes which are similarly co-correlated across each gene in the supplied list) instead of variant genes.
res$cocorrelativeGenesHeatmap

  1. And the corresponding data matrix:
head(res$cocorrelativeGenesHeatmap_MAT)
##               CDK12  AURKB   SFPQ   NFKB1  BRCC3    BRCA2  PARP1   EZH2  CCND1
## AASDHPPT     0.0916  0.264  0.594 -0.0507  0.452  0.52400  0.472  0.608  0.516
## ABCD3        0.1600  0.151  0.538  0.0447  0.563  0.52300  0.487  0.497  0.302
## ABCE1        0.1810  0.297  0.648  0.1230  0.436  0.59700  0.483  0.617  0.516
## ABCF1        0.5350  0.522  0.592  0.4030  0.443  0.08270  0.672  0.330  0.255
## AC004022.8  -0.2830 -0.396 -0.533 -0.2970 -0.338 -0.00953 -0.536 -0.231 -0.325
## AC096579.13 -0.3140 -0.313 -0.490 -0.2360 -0.329 -0.10100 -0.479 -0.175 -0.239
##             SLC7A11   GCLC  CDKN1A    MTAP   DHX9    SON  AURKA   SETX  BRCA1
## AASDHPPT      0.471  0.193 -0.2850 0.28300  0.707  0.133  0.386  0.554  0.425
## ABCD3         0.442  0.293 -0.0801 0.34500  0.660  0.152  0.405  0.598  0.487
## ABCE1         0.518  0.204 -0.1510 0.25000  0.758  0.157  0.443  0.598  0.479
## ABCF1         0.158  0.412  0.2380 0.08260  0.587  0.496  0.546  0.170  0.359
## AC004022.8   -0.160 -0.229 -0.2160 0.06300 -0.467 -0.406 -0.358 -0.175 -0.229
## AC096579.13  -0.165 -0.265 -0.2000 0.00711 -0.442 -0.393 -0.359 -0.226 -0.269
##              ATMIN
## AASDHPPT     0.535
## ABCD3        0.587
## ABCE1        0.520
## ABCF1        0.327
## AC004022.8  -0.373
## AC096579.13 -0.361
  1. The PCA plot showing the gene list members projected in PC1 and PC2, labeled, and colored by hierarchical cluster membership:
res$PCA_plot

  1. The data frame corresponding to (9):
res$PCA_data
##    geneNames         PC1         PC2 clusters
## 1      CDK12  0.08785426  0.24414259        1
## 2      AURKB -0.14233336  0.06205815        2
## 3       SFPQ -0.28904305  0.12649761        2
## 4      NFKB1  0.24055804  0.24030287        1
## 5      BRCC3 -0.03354104  0.26391350        1
## 6      BRCA2 -0.17340668  0.28311924        3
## 7      PARP1 -0.18967139  0.11271175        2
## 8       EZH2 -0.50201755 -0.05092973        2
## 9      CCND1 -0.39594993 -0.03714854        2
## 10   SLC7A11 -0.15724525  0.23344593        3
## 11      GCLC  0.22148318  0.35545070        1
## 12    CDKN1A  0.39638795  0.17942647        1
## 13      MTAP  0.03198465  0.19728059        3
## 14      DHX9 -0.26763275  0.22077471        2
## 15       SON -0.04835706  0.06004943        2
## 16     AURKA  0.02053370  0.34491863        1
## 17      SETX -0.21287102  0.22704985        3
## 18     BRCA1 -0.05307863  0.30243257        1
## 19     ATMIN  0.01395277  0.36058617        1
  1. The pathway enrichment of the input gene list displayed as a dotplot:
res$inputGenes_pathwayEnrich_dotplot

  1. The pathway enrichment results in a data frame:
head(res$inputGenes_pathwayEnrich_data)
##                                                                                                          ID
## GO_POSITIVE_REGULATION_OF_CELL_CYCLE                                   GO_POSITIVE_REGULATION_OF_CELL_CYCLE
## GO_RESPONSE_TO_RADIATION                                                           GO_RESPONSE_TO_RADIATION
## GO_NEGATIVE_REGULATION_OF_CELL_CYCLE_PHASE_TRANSITION GO_NEGATIVE_REGULATION_OF_CELL_CYCLE_PHASE_TRANSITION
## GO_RESPONSE_TO_IONIZING_RADIATION                                         GO_RESPONSE_TO_IONIZING_RADIATION
## GO_POSITIVE_REGULATION_OF_CELL_CYCLE_PROCESS                   GO_POSITIVE_REGULATION_OF_CELL_CYCLE_PROCESS
## BLUM_RESPONSE_TO_SALIRASIB_DN                                                 BLUM_RESPONSE_TO_SALIRASIB_DN
##                                                                                                 Description
## GO_POSITIVE_REGULATION_OF_CELL_CYCLE                                   GO_POSITIVE_REGULATION_OF_CELL_CYCLE
## GO_RESPONSE_TO_RADIATION                                                           GO_RESPONSE_TO_RADIATION
## GO_NEGATIVE_REGULATION_OF_CELL_CYCLE_PHASE_TRANSITION GO_NEGATIVE_REGULATION_OF_CELL_CYCLE_PHASE_TRANSITION
## GO_RESPONSE_TO_IONIZING_RADIATION                                         GO_RESPONSE_TO_IONIZING_RADIATION
## GO_POSITIVE_REGULATION_OF_CELL_CYCLE_PROCESS                   GO_POSITIVE_REGULATION_OF_CELL_CYCLE_PROCESS
## BLUM_RESPONSE_TO_SALIRASIB_DN                                                 BLUM_RESPONSE_TO_SALIRASIB_DN
##                                                       GeneRatio   BgRatio
## GO_POSITIVE_REGULATION_OF_CELL_CYCLE                       8/19 396/22755
## GO_RESPONSE_TO_RADIATION                                   8/19 446/22755
## GO_NEGATIVE_REGULATION_OF_CELL_CYCLE_PHASE_TRANSITION      7/19 270/22755
## GO_RESPONSE_TO_IONIZING_RADIATION                          6/19 144/22755
## GO_POSITIVE_REGULATION_OF_CELL_CYCLE_PROCESS               7/19 302/22755
## BLUM_RESPONSE_TO_SALIRASIB_DN                              7/19 341/22755
##                                                             pvalue     p.adjust
## GO_POSITIVE_REGULATION_OF_CELL_CYCLE                  5.012634e-10 8.281177e-07
## GO_RESPONSE_TO_RADIATION                              1.279966e-09 8.281177e-07
## GO_NEGATIVE_REGULATION_OF_CELL_CYCLE_PHASE_TRANSITION 1.366879e-09 8.281177e-07
## GO_RESPONSE_TO_IONIZING_RADIATION                     1.466344e-09 8.281177e-07
## GO_POSITIVE_REGULATION_OF_CELL_CYCLE_PROCESS          2.974362e-09 1.343817e-06
## BLUM_RESPONSE_TO_SALIRASIB_DN                         6.890156e-09 2.594144e-06
##                                                             qvalue
## GO_POSITIVE_REGULATION_OF_CELL_CYCLE                  3.357156e-07
## GO_RESPONSE_TO_RADIATION                              3.357156e-07
## GO_NEGATIVE_REGULATION_OF_CELL_CYCLE_PHASE_TRANSITION 3.357156e-07
## GO_RESPONSE_TO_IONIZING_RADIATION                     3.357156e-07
## GO_POSITIVE_REGULATION_OF_CELL_CYCLE_PROCESS          5.447778e-07
## BLUM_RESPONSE_TO_SALIRASIB_DN                         1.051655e-06
##                                                                                                   geneID
## GO_POSITIVE_REGULATION_OF_CELL_CYCLE                      AURKB/SFPQ/BRCA2/EZH2/CCND1/CDKN1A/AURKA/BRCA1
## GO_RESPONSE_TO_RADIATION                              AURKB/BRCC3/BRCA2/PARP1/CCND1/SLC7A11/CDKN1A/BRCA1
## GO_NEGATIVE_REGULATION_OF_CELL_CYCLE_PHASE_TRANSITION          AURKB/BRCC3/EZH2/CCND1/CDKN1A/AURKA/BRCA1
## GO_RESPONSE_TO_IONIZING_RADIATION                                   BRCC3/BRCA2/PARP1/CCND1/CDKN1A/BRCA1
## GO_POSITIVE_REGULATION_OF_CELL_CYCLE_PROCESS                    AURKB/SFPQ/EZH2/CCND1/CDKN1A/AURKA/BRCA1
## BLUM_RESPONSE_TO_SALIRASIB_DN                                     AURKB/SFPQ/PARP1/EZH2/DHX9/AURKA/BRCA1
##                                                       Count
## GO_POSITIVE_REGULATION_OF_CELL_CYCLE                      8
## GO_RESPONSE_TO_RADIATION                                  8
## GO_NEGATIVE_REGULATION_OF_CELL_CYCLE_PHASE_TRANSITION     7
## GO_RESPONSE_TO_IONIZING_RADIATION                         6
## GO_POSITIVE_REGULATION_OF_CELL_CYCLE_PROCESS              7
## BLUM_RESPONSE_TO_SALIRASIB_DN                             7
  1. The object generated by clusterProfiler during pathway enrichment (this is compatible with the other functions in the clusterProfiler package):
res$inputGenes_pathwayEnrich
## #
## # over-representation test
## #
## #...@organism     UNKNOWN 
## #...@ontology     UNKNOWN 
## #...@gene     chr [1:19] "CDK12" "AURKB" "SFPQ" "NFKB1" "BRCC3" "BRCA2" "PARP1" "EZH2" ...
## #...pvalues adjusted by 'BH' with cutoff <0.05 
## #...938 enriched terms found
## 'data.frame':    938 obs. of  9 variables:
##  $ ID         : chr  "GO_POSITIVE_REGULATION_OF_CELL_CYCLE" "GO_RESPONSE_TO_RADIATION" "GO_NEGATIVE_REGULATION_OF_CELL_CYCLE_PHASE_TRANSITION" "GO_RESPONSE_TO_IONIZING_RADIATION" ...
##  $ Description: chr  "GO_POSITIVE_REGULATION_OF_CELL_CYCLE" "GO_RESPONSE_TO_RADIATION" "GO_NEGATIVE_REGULATION_OF_CELL_CYCLE_PHASE_TRANSITION" "GO_RESPONSE_TO_IONIZING_RADIATION" ...
##  $ GeneRatio  : chr  "8/19" "8/19" "7/19" "6/19" ...
##  $ BgRatio    : chr  "396/22755" "446/22755" "270/22755" "144/22755" ...
##  $ pvalue     : num  5.01e-10 1.28e-09 1.37e-09 1.47e-09 2.97e-09 ...
##  $ p.adjust   : num  8.28e-07 8.28e-07 8.28e-07 8.28e-07 1.34e-06 ...
##  $ qvalue     : num  3.36e-07 3.36e-07 3.36e-07 3.36e-07 5.45e-07 ...
##  $ geneID     : chr  "AURKB/SFPQ/BRCA2/EZH2/CCND1/CDKN1A/AURKA/BRCA1" "AURKB/BRCC3/BRCA2/PARP1/CCND1/SLC7A11/CDKN1A/BRCA1" "AURKB/BRCC3/EZH2/CCND1/CDKN1A/AURKA/BRCA1" "BRCC3/BRCA2/PARP1/CCND1/CDKN1A/BRCA1" ...
##  $ Count      : int  8 8 7 6 7 7 7 6 6 4 ...
## #...Citation
##   Guangchuang Yu, Li-Gen Wang, Yanyan Han and Qing-Yu He.
##   clusterProfiler: an R package for comparing biological themes among
##   gene clusters. OMICS: A Journal of Integrative Biology
##   2012, 16(5):284-287

Enriching with large gene lists

Unlike the web application version of Correlation AnalyzeR, the R package is capable of handling arbitrarily-large gene lists for analyzeGenesetTopology(). One instance where one might wish to perform an analysis like this could be in parsing an existing gene set from curated sources like Gene Ontology.

To obtain the list of genes for this analysis, it is convenient to use the msigdbr package in the following manner:

library(tidyverse)
## Warning: package 'tidyr' was built under R version 4.0.4
MDF <- msigdbr::msigdbr(category = "C2", subcategory = "CGP")
geneList <- MDF %>%
  filter(gs_name == "RIGGI_EWING_SARCOMA_PROGENITOR_UP") %>%
  pull(gene_symbol)

We have now obtained a vector with the 434 genes in the “RIGGI_EWING_SARCOMA_PROGENITOR_UP” gene set from the Chemical and Genetic Perturbations (CGP) database in the “C2” collection of MSigDB. A link to the info page for this gene set can be found here. Now, we can use this list as the input for analyzeGenesetTopology(). NOTE: when a gene in our gene list is not found in the correlation data, it will automatically be skipped.

res <- analyzeGenesetTopology(genesOfInterest = geneList, 
                              Sample_Type = "cancer",
                              Tissue = "bone")
## Warning in analyzeGenesetTopology(genesOfInterest = geneList, Sample_Type = "cancer", : 
##          'C15orf48, C1orf226, ECRG4, H2AC6, H2BC4, H2BC5, H2BC6, H2BC7, H2BS1, H4C8, ITGB2-AS1, JCAD, KASH5, KRTAP4-9, LINC00839, LINC01503, LINC02762, LRATD1, LRATD2, MALAT1, MARCHF1, PALM2AKAP2, PRXL2A, RUBCNL, STING1, TRMT9B'
##                       not found in correlation data and is not an official MSIGDB name.
##                       Please check available gene data with getAvailableGenes().
##                       Your gene(s) of interest may have an updated name or
##                       have a species-specific identifier. Find offical MSIGDB
##                       names by examining the MSIGDB_Geneset_Names object.
## 
##                       Continuing without this/these gene(s)...
## 
## Retrieving TERM2GENE...
## 
## Retrieving correlation data...
## 
## Starting cross comparison
## 
## Using TSNE instead of PCA for large sample sizes.
## To disable this behavior, set 'alternativeTSNE' to FALSERead the 410 x 410 data matrix successfully!
## OpenMP is working. 1 threads.
## Using no_dims = 2, perplexity = 30.000000, and theta = 0.500000
## Computing input similarities...
## Building tree...
## Done in 0.10 seconds (sparsity = 0.270518)!
## Learning embedding...
## Iteration 50: error is 66.030554 (50 iterations in 0.04 seconds)
## Iteration 100: error is 66.021746 (50 iterations in 0.03 seconds)
## Iteration 150: error is 66.034030 (50 iterations in 0.03 seconds)
## Iteration 200: error is 66.046966 (50 iterations in 0.03 seconds)
## Iteration 250: error is 66.031184 (50 iterations in 0.03 seconds)
## Iteration 300: error is 1.315898 (50 iterations in 0.03 seconds)
## Iteration 350: error is 1.313036 (50 iterations in 0.02 seconds)
## Iteration 400: error is 1.312164 (50 iterations in 0.02 seconds)
## Iteration 450: error is 1.312486 (50 iterations in 0.02 seconds)
## Iteration 500: error is 1.312154 (50 iterations in 0.02 seconds)
## Iteration 550: error is 1.311493 (50 iterations in 0.02 seconds)
## Iteration 600: error is 1.310892 (50 iterations in 0.02 seconds)
## Iteration 650: error is 1.311133 (50 iterations in 0.02 seconds)
## Iteration 700: error is 1.311040 (50 iterations in 0.02 seconds)
## Iteration 750: error is 1.311216 (50 iterations in 0.02 seconds)
## Iteration 800: error is 1.311071 (50 iterations in 0.02 seconds)
## Iteration 850: error is 1.310981 (50 iterations in 0.02 seconds)
## Iteration 900: error is 1.311059 (50 iterations in 0.02 seconds)
## Iteration 950: error is 1.311291 (50 iterations in 0.02 seconds)
## Iteration 1000: error is 1.311196 (50 iterations in 0.02 seconds)
## Iteration 1050: error is 1.311270 (50 iterations in 0.02 seconds)
## Iteration 1100: error is 1.311291 (50 iterations in 0.02 seconds)
## Iteration 1150: error is 1.311232 (50 iterations in 0.02 seconds)
## Iteration 1200: error is 1.311371 (50 iterations in 0.02 seconds)
## Iteration 1250: error is 1.311285 (50 iterations in 0.02 seconds)
## Iteration 1300: error is 1.311283 (50 iterations in 0.02 seconds)
## Iteration 1350: error is 1.311351 (50 iterations in 0.02 seconds)
## Iteration 1400: error is 1.311289 (50 iterations in 0.02 seconds)
## Iteration 1450: error is 1.311180 (50 iterations in 0.02 seconds)
## Iteration 1500: error is 1.311216 (50 iterations in 0.02 seconds)
## Iteration 1550: error is 1.311275 (50 iterations in 0.02 seconds)
## Iteration 1600: error is 1.311164 (50 iterations in 0.02 seconds)
## Iteration 1650: error is 1.311133 (50 iterations in 0.02 seconds)
## Iteration 1700: error is 1.311301 (50 iterations in 0.02 seconds)
## Iteration 1750: error is 1.311126 (50 iterations in 0.02 seconds)
## Iteration 1800: error is 1.311186 (50 iterations in 0.02 seconds)
## Iteration 1850: error is 1.311227 (50 iterations in 0.02 seconds)
## Iteration 1900: error is 1.311182 (50 iterations in 0.02 seconds)
## Iteration 1950: error is 1.311244 (50 iterations in 0.02 seconds)
## Iteration 2000: error is 1.311241 (50 iterations in 0.02 seconds)
## Iteration 2050: error is 1.311374 (50 iterations in 0.02 seconds)
## Iteration 2100: error is 1.311317 (50 iterations in 0.02 seconds)
## Iteration 2150: error is 1.311174 (50 iterations in 0.02 seconds)
## Iteration 2200: error is 1.311245 (50 iterations in 0.02 seconds)
## Iteration 2250: error is 1.311224 (50 iterations in 0.03 seconds)
## Iteration 2300: error is 1.311291 (50 iterations in 0.02 seconds)
## Iteration 2350: error is 1.311273 (50 iterations in 0.02 seconds)
## Iteration 2400: error is 1.311338 (50 iterations in 0.02 seconds)
## Iteration 2450: error is 1.311061 (50 iterations in 0.02 seconds)
## Iteration 2500: error is 1.311321 (50 iterations in 0.02 seconds)
## Iteration 2550: error is 1.311296 (50 iterations in 0.02 seconds)
## Iteration 2600: error is 1.311127 (50 iterations in 0.02 seconds)
## Iteration 2650: error is 1.311084 (50 iterations in 0.02 seconds)
## Iteration 2700: error is 1.311179 (50 iterations in 0.02 seconds)
## Iteration 2750: error is 1.311254 (50 iterations in 0.02 seconds)
## Iteration 2800: error is 1.311297 (50 iterations in 0.02 seconds)
## Iteration 2850: error is 1.311312 (50 iterations in 0.02 seconds)
## Iteration 2900: error is 1.311294 (50 iterations in 0.02 seconds)
## Iteration 2950: error is 1.311299 (50 iterations in 0.02 seconds)
## Iteration 3000: error is 1.311214 (50 iterations in 0.02 seconds)
## Iteration 3050: error is 1.311350 (50 iterations in 0.02 seconds)
## Iteration 3100: error is 1.311362 (50 iterations in 0.02 seconds)
## Iteration 3150: error is 1.311311 (50 iterations in 0.02 seconds)
## Iteration 3200: error is 1.311370 (50 iterations in 0.02 seconds)
## Iteration 3250: error is 1.311332 (50 iterations in 0.02 seconds)
## Iteration 3300: error is 1.311287 (50 iterations in 0.02 seconds)
## Iteration 3350: error is 1.311254 (50 iterations in 0.02 seconds)
## Iteration 3400: error is 1.311193 (50 iterations in 0.02 seconds)
## Iteration 3450: error is 1.311179 (50 iterations in 0.02 seconds)
## Iteration 3500: error is 1.311226 (50 iterations in 0.02 seconds)
## Iteration 3550: error is 1.311170 (50 iterations in 0.02 seconds)
## Iteration 3600: error is 1.311106 (50 iterations in 0.02 seconds)
## Iteration 3650: error is 1.311283 (50 iterations in 0.02 seconds)
## Iteration 3700: error is 1.311098 (50 iterations in 0.02 seconds)
## Iteration 3750: error is 1.311229 (50 iterations in 0.02 seconds)
## Iteration 3800: error is 1.311374 (50 iterations in 0.02 seconds)
## Iteration 3850: error is 1.311064 (50 iterations in 0.02 seconds)
## Iteration 3900: error is 1.311335 (50 iterations in 0.02 seconds)
## Iteration 3950: error is 1.311230 (50 iterations in 0.02 seconds)
## Iteration 4000: error is 1.311175 (50 iterations in 0.02 seconds)
## Iteration 4050: error is 1.311167 (50 iterations in 0.02 seconds)
## Iteration 4100: error is 1.311235 (50 iterations in 0.02 seconds)
## Iteration 4150: error is 1.311152 (50 iterations in 0.02 seconds)
## Iteration 4200: error is 1.311208 (50 iterations in 0.02 seconds)
## Iteration 4250: error is 1.311051 (50 iterations in 0.02 seconds)
## Iteration 4300: error is 1.311399 (50 iterations in 0.02 seconds)
## Iteration 4350: error is 1.311245 (50 iterations in 0.02 seconds)
## Iteration 4400: error is 1.311308 (50 iterations in 0.02 seconds)
## Iteration 4450: error is 1.311240 (50 iterations in 0.02 seconds)
## Iteration 4500: error is 1.311352 (50 iterations in 0.02 seconds)
## Iteration 4550: error is 1.311195 (50 iterations in 0.02 seconds)
## Iteration 4600: error is 1.311136 (50 iterations in 0.02 seconds)
## Iteration 4650: error is 1.311086 (50 iterations in 0.02 seconds)
## Iteration 4700: error is 1.311216 (50 iterations in 0.02 seconds)
## Iteration 4750: error is 1.311057 (50 iterations in 0.02 seconds)
## Iteration 4800: error is 1.311276 (50 iterations in 0.02 seconds)
## Iteration 4850: error is 1.311271 (50 iterations in 0.02 seconds)
## Iteration 4900: error is 1.311345 (50 iterations in 0.02 seconds)
## Iteration 4950: error is 1.311254 (50 iterations in 0.02 seconds)
## Iteration 5000: error is 1.311303 (50 iterations in 0.02 seconds)
## Fitting performed in 2.15 seconds.

Because of the large number of genes supplied, a tSNE was calculated instead of PCA. This behavior can be prevented by setting the alternativeTSNE parameter to FALSE. The visualization is designed to allow easier cluster interpretation and does not include gene labels:

res$TSNE_plot

However, the underlying plot data is supplied as well:

head(res$TSNE_data)
##   geneNames        tsne1       tsne2 hclust
## 1       A2M -1.221786599 -0.04844189      1
## 2     ABCA5 -0.657285426 -1.28988016      2
## 3     ABHD6  0.658190185  0.45528606      3
## 4     ACACB  0.209647628  0.05357400      4
## 5   ADAMTS3 -0.416643908  0.58589809      5
## 6    ADARB1  0.007257496  0.09008766      6

Which means that, using plotly, it is straightforward to create an interactive visualization that includes gene name information:

plt <- (res$TSNE_data %>%
  ggplot(aes(x = tsne1, y = tsne2, color = hclust, label = geneNames)) +
  geom_point()) %>%
  plotly::ggplotly()

Session info

sessionInfo()
## R version 4.0.3 (2020-10-10)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 10 x64 (build 19042)
## 
## Matrix products: default
## 
## locale:
## [1] LC_COLLATE=English_United States.1252 
## [2] LC_CTYPE=English_United States.1252   
## [3] LC_MONETARY=English_United States.1252
## [4] LC_NUMERIC=C                          
## [5] LC_TIME=English_United States.1252    
## 
## attached base packages:
## [1] parallel  stats4    stats     graphics  grDevices utils     datasets 
## [8] methods   base     
## 
## other attached packages:
##  [1] forcats_0.5.1               stringr_1.4.0              
##  [3] purrr_0.3.4                 readr_1.4.0                
##  [5] tidyr_1.1.3                 tibble_3.0.6               
##  [7] ggplot2_3.3.3               tidyverse_1.3.0            
##  [9] dplyr_1.0.4                 EnsDb.Hsapiens.v86_2.99.0  
## [11] ensembldb_2.14.0            AnnotationFilter_1.14.0    
## [13] GenomicFeatures_1.42.1      AnnotationDbi_1.52.0       
## [15] airway_1.10.0               SummarizedExperiment_1.20.0
## [17] Biobase_2.50.0              GenomicRanges_1.42.0       
## [19] GenomeInfoDb_1.26.2         IRanges_2.24.1             
## [21] S4Vectors_0.28.1            BiocGenerics_0.36.0        
## [23] MatrixGenerics_1.2.1        matrixStats_0.58.0         
## [25] correlationAnalyzeR_1.0.0  
## 
## loaded via a namespace (and not attached):
##   [1] SMVar_1.3.3              rappdirs_0.3.3           rtracklayer_1.49.5      
##   [4] bit64_4.0.5              knitr_1.31               DelayedArray_0.16.1     
##   [7] data.table_1.13.6        rpart_4.1-15             RCurl_1.98-1.2          
##  [10] doParallel_1.0.16        generics_0.1.0           preprocessCore_1.52.1   
##  [13] callr_3.5.1              cowplot_1.1.1            usethis_2.0.1           
##  [16] RSQLite_2.2.3            shadowtext_0.0.7         bit_4.0.4               
##  [19] enrichplot_1.10.2        lubridate_1.7.10         xml2_1.3.2              
##  [22] assertthat_0.2.1         viridis_0.5.1            xfun_0.21               
##  [25] hms_1.0.0                jquerylib_0.1.3          evaluate_0.14           
##  [28] fansi_0.4.2              progress_1.2.2           caTools_1.18.1          
##  [31] dbplyr_2.1.0             readxl_1.3.1             igraph_1.2.6            
##  [34] DBI_1.1.1                geneplotter_1.68.0       htmlwidgets_1.5.3       
##  [37] ellipsis_0.3.1           crosstalk_1.1.1          ggpubr_0.4.0            
##  [40] backports_1.2.1          annotate_1.68.0          biomaRt_2.46.3          
##  [43] vctrs_0.3.6              remotes_2.2.0            abind_1.4-5             
##  [46] cachem_1.0.4             withr_2.4.1              ggforce_0.3.3           
##  [49] checkmate_2.0.0          GenomicAlignments_1.26.0 prettyunits_1.1.1       
##  [52] cluster_2.1.0            DOSE_3.16.0              lazyeval_0.2.2          
##  [55] crayon_1.4.1             genefilter_1.72.1        pkgconfig_2.0.3         
##  [58] labeling_0.4.2           tweenr_1.0.1             nlme_3.1-149            
##  [61] pkgload_1.2.0            ProtGenerics_1.22.0      nnet_7.3-14             
##  [64] devtools_2.3.2           rlang_0.4.10             lifecycle_1.0.0         
##  [67] downloader_0.4           BiocFileCache_1.14.0     modelr_0.1.8            
##  [70] cellranger_1.1.0         rprojroot_2.0.2          polyclip_1.10-0         
##  [73] Matrix_1.2-18            carData_3.0-4            boot_1.3-25             
##  [76] reprex_1.0.0             base64enc_0.1-3          processx_3.4.5          
##  [79] pheatmap_1.0.12          png_0.1-7                viridisLite_0.3.0       
##  [82] bitops_1.0-6             KernSmooth_2.23-17       Biostrings_2.58.0       
##  [85] blob_1.2.1               qvalue_2.22.0            jpeg_0.1-8.1            
##  [88] rstatix_0.7.0            gridGraphics_0.5-1       ggsignif_0.6.1          
##  [91] scales_1.1.1             memoise_2.0.0            magrittr_2.0.1          
##  [94] plyr_1.8.6               gplots_3.1.1             zlibbioc_1.36.0         
##  [97] compiler_4.0.3           scatterpie_0.1.5         RColorBrewer_1.1-2      
## [100] metaMA_3.1.2             DESeq2_1.30.0            Rsamtools_2.6.0         
## [103] cli_2.3.1                XVector_0.30.0           ps_1.6.0                
## [106] htmlTable_2.1.0          Formula_1.2-4            MASS_7.3-53             
## [109] mgcv_1.8-33              WGCNA_1.70-3             tidyselect_1.1.0        
## [112] stringi_1.5.3            highr_0.8                yaml_2.2.1              
## [115] GOSemSim_2.16.1          askpass_1.1              locfit_1.5-9.4          
## [118] latticeExtra_0.6-29      ggrepel_0.9.1            grid_4.0.3              
## [121] sass_0.3.1               fastmatch_1.1-0          tools_4.0.3             
## [124] rio_0.5.26               rstudioapi_0.13          foreach_1.5.1           
## [127] foreign_0.8-80           gridExtra_2.3            Rtsne_0.15              
## [130] farver_2.1.0             ggraph_2.0.5             digest_0.6.27           
## [133] rvcheck_0.1.8            BiocManager_1.30.10      SuperExactTest_1.0.7    
## [136] Rcpp_1.0.6               car_3.0-10               broom_0.7.5             
## [139] httr_1.4.2               colorspace_2.0-0         rvest_1.0.0             
## [142] XML_3.99-0.5             fs_1.5.0                 splines_4.0.3           
## [145] graphlayouts_0.7.1       ggplotify_0.0.5          plotly_4.9.3            
## [148] sessioninfo_1.1.1        xtable_1.8-4             jsonlite_1.7.2          
## [151] dynamicTreeCut_1.63-1    tidygraph_1.2.0          testthat_3.0.2          
## [154] R6_2.5.0                 Hmisc_4.5-0              pillar_1.5.1            
## [157] htmltools_0.5.1.1        glue_1.4.2               fastmap_1.1.0           
## [160] clusterProfiler_3.18.1   BiocParallel_1.24.1      RMySQL_0.10.21          
## [163] codetools_0.2-16         fgsea_1.16.0             pkgbuild_1.2.0          
## [166] utf8_1.2.1               lattice_0.20-41          bslib_0.2.4             
## [169] curl_4.3                 gtools_3.8.2             zip_2.1.1               
## [172] GO.db_3.12.1             openxlsx_4.2.3           openssl_1.4.3           
## [175] limma_3.46.0             survival_3.2-7           rmarkdown_2.7           
## [178] desc_1.3.0               munsell_0.5.0            DO.db_2.9               
## [181] fastcluster_1.1.25       GenomeInfoDbData_1.2.4   iterators_1.0.13        
## [184] impute_1.64.0            haven_2.3.1              reshape2_1.4.4          
## [187] gtable_0.3.0             msigdbr_7.2.1

Questions

Feel free to email Henry Miller () any time with questions, bug reports, or if you want to contribute!