Entering edit mode
9.0 years ago
zizigolu
★
4.3k
hello,
I have two matrices of gene IDs with the same dimension but whenever I am trying to measure fscore using them telling
networks have not the same node names
> head(A[,1:4])
AT1G01060 AT1G01170 AT1G01180 AT1G01260
AT1G01060 0 0 0 0
AT1G01170 0 0 0 0
AT1G01180 0 0 0 0
AT1G01260 0 0 0 0
AT1G01380 0 0 0 0
AT1G01490 0 0 0 0
> dim(A)
[1] 3123 3123
> head(B[,1:4])
AT5G10140 AT5G11260 AT5G62020 AT5G20240
AT5G10140 0 0 0 0
AT5G11260 0 0 1 0
AT5G62020 0 0 0 0
AT5G20240 0 0 0 0
AT3G54340 0 0 0 0
AT3G27010 0 0 0 0
> dim(B)
[1] 3123 3123
how I can have these two matrices with the same gene names? I mean keeping the same genes and removing which is different between two matrices then two matrices become will have the same genes
thank you
thank you very much, yes you understood my mean well but the question is , genes coming from where in other word which is my reference for subsetting?
Hi Fereshteh,
Your reference should be the genes you want to be the same. Another simple workaround is to use the function:
ex.:
you can also bind them by column using
cbind()
and applyunique()
to the new data.frame.I am not quite sure if this is what you are looking for, but send me a message anytime.
Regards,
R.
thank you so much