I have a data frame of z-scores between various gene pairs. The dataframe looks like this:
df <- data.frame(geneID=c("CDKN2A", "JUN", "IRS2","MTOR",
"NRAS"),
ABL1=c(-0.19,NA,2.01,0.4,1.23),
AKT1=c(0.11,2.45,NA,NA,1.67),
AKT2=c(1.19,NA,2.41,0.78,1.93),
AKT3=c(2.78,NA,NA,0.7,2.23),
ALK=c(NA,NA,NA,2.4,1.23))
I would like to filter z-scores higher than 2 and output them into separate dataframe in the following format:
gene1 gene2 z-score
IRS2 ABL1 2.01
JUN AKT1 2.45
CDKN2A AKT3 2,78
NRAS AKT3 2.23
MTOR ALK 2.4
I tried to filtered out rows and columns, but it turns out that I lose some of values that meet the threshold of 2. The dimensionality of my table is 18215 rows and 270 columns.
I would highly appreciate any help or suggestions!
Thank you very much! Olha