co-expression analysis for two different tissues of same sample

Bioinformatics Asked on May 4, 2021

I have gene expression datasets A and B that contain as many rows as genes and as many columns as samples. The rows in A and B represent a common set of genes measured in different tissues of the same 5 patients. My objective is to do a correlation between the set of genes in A and B to infer whether genes in both tissues are co-expressed based on the given condition or not?

Here are sample and patients IDs information with their Expression profile

Patient_ID <- as.character(quote(c(p_1, p_2,p_3, p_4, p_5)))[-1] 
SampleA <- as.character(quote(c(A_1, A_2, A_3, A_4, A_5)))[-1]
SampleB <- as.character(quote(c(B_1, B_2, B_3, B_4, B_5)))[-1]

Expression profile of the two tissues

A <- matrix(rnorm(250), nrow = 50)
B <- matrix(rnorm(250), nrow = 50)

I have tried two approaches

first approach

rownames(A) <- paste0("g_",1:50) ## genes 
colnames(A) <- Patient_ID # patient IDs 

prefix "b." is added to every gene in Tissue B to identify that they are from tissue B.

rownames(B) <- paste0("b.g_",1:50) ## genes 
colnames(B) <- Patient_ID  ## patient IDs 

Since both have the same column IDs, I used rbind function to join the two datasets.
Then I did correlation as a transposed matrix and extracted the top right bock of the matrix where I can get correlation values between Tissue A and Tissue B

bind <- Hmisc::rcorr(t(rbind(A,B)))
n = nrow(A)
final <- bind$r[1:n, (n+1):(2*n)]

Second approach

rownames(A) <- paste0("g_",1:50) ## genes 
colnames(A) <- SampleA ## Sample IDs in A

rownames(B) <- paste0("g_",1:50) ## genes in B tissue  
colnames(B) <- SampleB  ## Sample IDs in B 
bind.col <- Hmisc::rcorr(t(cbind(A,B)))
bind.col <- bind.col$r

Therefore, I would like to ask which approach is correct to determine if genes of Tissue A and Tissue B are co-expressed based on the given condition?
If both are incorrect I wish to get feedback on how to proceed?
Thank you!

Add your own answers!

Related Questions

Block wise protein imputation

2  Asked on March 23, 2021 by whateversclever


RAD Seq Data Analysis without barcode

2  Asked on March 20, 2021 by biobash


FASTA and PDB: How to specify chain?

2  Asked on March 19, 2021 by lazer-guided-lazerbeam


How can I use my Myheritage DNA results file for further analysis?

1  Asked on March 19, 2021 by user3390486


Within and between sample count normalization

1  Asked on March 16, 2021 by maxno3


Too slow issue of BioMart

1  Asked on March 12, 2021 by user224050


Obtaining Whole Genetic Sequence

2  Asked on March 11, 2021


Ask a Question

Get help from others!

© 2023 All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir