Entering edit mode
8.3 years ago
zizigolu
★
4.3k
Hi,
I have a complete list of transcription factors in Arabidopsis thaliana like below
TF <- read.table("whole TF.txt", header = T, sep = "\t")
> View(TF)
AGI_ID
AT1G01010
AT1G01030
AT1G01060
AT1G01160
AT1G01210
AT1G01250
and and by my expression data sets I produced a correlation matrix contains both genes and transcription factors like below
>genes <- read.table("genes.txt", header = T, sep = "\t")
> library(netbenchmark)
> Net <- cor(genes)
> head(Net[1:4,1:4])
AT1G01060 AT1G01170 AT1G01260 AT1G01380
AT1G01060 1.00000000 0.34783519 -0.09805551 -0.17400162
AT1G01170 0.34783519 1.00000000 -0.47605524 0.04211973
AT1G01260 -0.09805551 -0.47605524 1.00000000 -0.04742131
AT1G01380 -0.17400162 0.04211973 -0.04742131 1.00000000
In the above matrix I have interaction between gene-gene, gene-transcription factor and transcription factor-transcription factor. I want to remove gene-gene part from above matrix by setdiff
function.
I did like below
nonTF <- setdiff(Net, TF)
Net <- Net[nonTF,nonTF]==0
But View(Net)
is FALSE
and
Net <- Net[nonTF, nonTF] <- 0
View(Net)
is 0
Then how can I remove gene-gene interaction from my correlation matrix and keep the rest of interactions please?
Thank you