Hello,
I am new in igraph and I am trying to represent connection between sequences I have in one or more cells (expansion size) and I color them according to their cell biological populations. In the test_ss_NA table I have a column called expansion.
cdr3b <- test_cdr3b$trb.cdr3 (sequences)
nkt.seqs <- unique(cdr3b)
nkt.graph <- graph.empty(n = length(nkt.seqs), directed=F)
nkt.dist <- stringdist::stringdistmatrix(nkt.seqs, nkt.seqs, method="lv")
nkt.graph <- add.edges(nkt.graph, t(which(nkt.dist <= 1, arr.ind=T)))
nkt.graph <- igraph::simplify(nkt.graph)
colors <- test_ss_NA %>%
mutate(color= ifelse(hto.type == "umft84", "#d11141",
ifelse(hto.type == "unmapped",'#12CBC4', "grey"))) %>%
.$color
V(nkt.graph)$color <- colors
plot(delete.vertices(simplify(nkt.graph), degree(nkt.graph)==0), vertex.size=3, vertex.label= NA , edge.color = "black")
This code above work for the color but when I add this for the size
sizes <- test_ss_NA$expansion
V(nkt.graph)$size <- sizes
nothinh work anymore
Could someone help me for this?