This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Reproducing this radar plot in r

Hello

I have two groups of patients; Responders for a drug and non-responders. For each group I looked for disturbed pathways so that pathways are in columns and patients in the rows

> dput(head(responders[1:2,]))
structure(list(Samples = c("LP6008460.DNA_A04", "s30"), BER = c(0L, 
0L), WNT = 0:1, CR = c(0L, 0L), CPF = c(0L, 0L), TM = c(0L, 0L
), HR = c(0L, 0L), FA = c(0L, 0L), RTK.RAS = c(1L, 1L), CC = c(1L, 
1L), p53 = c(1L, 1L), NOTCH = c(0L, 0L), Hippo = 0:1, PI3K = 0:1, 
    NER = c(0L, 0L), NHEJ = c(0L, 0L), MMR = c(0L, 0L), MYC = c(0L, 
    0L), CS = c(0L, 0L), TLS = c(0L, 0L), UR = c(0L, 0L), TGF.Beta = 1:0, 
    OD = c(0L, 0L), Response = c("Responder", "Responder")), row.names = 1:2, class = "data.frame")
> 


> dput(head(nonresponders[1:2,]))
structure(list(Samples = c("LP6008031.DNA_B02", "LP6005500.DNA_H03"
), BER = 1:0, WNT = 0:1, CR = c(0L, 0L), CPF = c(1L, 1L), TM = c(0L, 
0L), HR = 1:0, FA = c(0L, 0L), RTK.RAS = c(1L, 1L), CC = c(1L, 
1L), p53 = c(1L, 1L), NOTCH = c(1L, 1L), Hippo = c(0L, 0L), PI3K = c(1L, 
1L), NER = 0:1, NHEJ = 1:0, MMR = c(0L, 0L), MYC = 1:0, CS = c(0L, 
0L), TLS = 1:0, UR = 1:0, TGF.Beta = 0:1, OD = c(0L, 0L), Response = c("Non-Responder", 
"Non-Responder")), row.names = 1:2, class = "data.frame")
>

I want to have such a plot, but each pathway is a chunk of this plot and responders and non-responders are two side-by-side bars for each pathway

enter image description here

For example here each bacteria could be a different pathway

The Python script for this figure is here https://docs.bokeh.org/en/latest/docs/gallery/burtin.html but I don't know how to use Python

r

Can you edit your posts to include the results of dput(head(responders[1:2,])) and dput(head(nonresponders[1:2,]))?

Thank you so much. I have edited the main post

I have found this code to give a polar plot but I don't know how to combine two groups in that with different colours

 require(gdata)
    library(reshape2)
    library(ggplot2)
    library(fmsb)
    library(plotrix)
    library(RColorBrewer)
    library(gplots)
    library(NMF)
    rownames(responders)=responders[,1]
    responders=responders[,-1]
   responders=responders[,-23]
    coordpos<-seq(0,350,by=360/(length(colnames(responders))))
    pdf(paste(getwd(),"pdf.pdf",sep=""))
    polar.plot(colSums(responders)/nrow(responders),coordpos,main="Responders",
               start=90,clockwise=TRUE,lwd=5,line.col="#43a2ca",rp.type="p",
               labels=names(colSums(responders)),label.pos=coordpos,radial.lim=c(0,1))
    dev.off()

This gives polar plot for one group. Do you know how to combine the second group in the plot with different colour?

enter image description here

0 answers

No answers yet.

Log in to answer this question.