Entering edit mode
9.9 years ago
zizigolu
★
4.4k
Hi,
I have a list of transcription factors like below
TF <- read.table("whole TF.txt", header = T, sep = "\t")
> View(TF)
AGI_ID
AT1G01010
AT1G01030
AT1G01060
AT1G01160
AT1G01210
AT1G01250
and 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
Then how I can remove gene-gene interaction from my correlation matrix please?
Thank you
Note that my answer means you should use:
not
thank you I used
but no happen I saw
I know you won't get any output from that, but if you
head()the file orView()it or whatever then it should be correct.thank you,
may you please help me to remove gene-gene interaction from my matrix?
What I wrote will presumably set those to 0. There's no way to actually remove them from the matrix.
thank you I think I got your mean. you made those interaction 0. now how I can extract the resulted matrix (the matrix with gene-gene interaction=0) ??? because the result of
is only a value equal to 0 and not re writable or Viewable
That changes
Net. JustView(Net). If you want that as a different object thensorry but
somethingNew <- Net
is the same
while I need the result of
as a different object
I know, I showed you EXACTLY how to do that. Read what I wrote. There is no reason to ask any further questions about this, you've already received all the answers you need.
ok thank you