**40**wrote:

hi,

i have a gold standard in Arabidopsis thaliana( genes and transcription factors and their interaction) like below

TFLocus TargetLocus InteractionType

AT5G10140 AT1G65480 -1

AT5G11260 AT1G27480 -1

AT5G11260 AT5G53370 -1

AT5G11260 AT1G03630 -1

AT5G11260 AT1G13600 -1

AT5G11260 AT2G41670 -1

AT5G11260 AT2G05160 -1

AT5G11260 AT2G40170 -1

AT5G11260 AT1G62780 -1

using this code i have an adjacency matrix

library(igraph)

## Read edge list with weights edge_list <- read.table("Ara_GoldST.txt", header = T, sep = "\t", header=FALSE) ## Form undirected graph from edge list G <- graph.data.frame(edge_list,directed=TRUE) ## Get adjacency matrix ## Set edge weights to values in the InteractionType column by setting A<-as_adjacency_matrix(G,type="both",names=TRUE,sparse=FALSE)

but max(A) is 5 while I need a directed adjacency only contains 0 and 1. how I can get that please?

even i tried

as.directed(G, "mutual") to make my graph directed but my adjacency matrix is undirected and contains 0, 1, 2, 3, 4 and 5 while i only need 0 and 1

thank you for any suggestion

**14k**• written 3.9 years ago by Angel •

**40**