Entering edit mode
hi,
if i have two lists, name
A
B
C
and interaction
from to InteractionType
1 3 0.179539385
2 1 0.176986341
2 3 0.169999731
and i know A=1 , B=2 and C=3
then how i can replace the number with A , B and C????
thank u
sorry, you all right but in stackflow i don't have needed score then i can't ask any question
but i could not get what to do, u mean like below??
LETTER <- c("A", "B","C")
x$from <- LETTERS[x$from]
Well, that was just an example. You haven't specified what the "to" and "from" fields are; are they fields in a
data.frame
? Or are they part of some other structure? More detail is necessary if you want exact code.I have this genes
> head(genes[,1])
[1] AT1G01170 AT1G01260 AT1G01380 AT1G01490 AT1G01500 AT1G01610
2884 Levels: AT1G01170 AT1G01260 AT1G01380 AT1G01490 AT1G01500 AT1G01610 ... AT5G67430
also I have this edge list of the above genes derived from a gene regulatory inferring algorithm but as you conider the output is not by gene name anymore and is by number of genes like below
> head(edgelist[1:10,1:3])
TFLocus TargetLocus InteractionType
177 18 0.179539385
539 306 0.176986341
539 422 0.169999731
580 270 0.154084348
529 416 0.136705154
383 97 0.12308019
for example gene 18 and gene 177 connect with 0.179539384784291 value
how i can replace these numbers with the name of my genes???? for example genes 1 is AT1G01170 and gene 2 is AT1G01260
thank you
Well, if
edgelist
is adata.frame
, and the numbers are indices pointing to the gene, you should be able to do:thank you so much, it worked
I am really thankful