This is a test version of Biostars. For the public version, visit https://www.biostars.org.
R Shiny volcano plot

hello community,

I want to generate a volcanoplot with a csv file ==> file1: gene;Id;log2FC;P-Value;P-Value-adj in my server :

server <- function(input, output) {
    re <- reactive({
        req(input$file1)
        data <- read.csv(input$file1$datapath, sep = ";")
        return(data)
        })

output$table <- renderDataTable({
    D <- re()
    DT::datatable(D)
}
)
output$plot2<-renderPlot({
    D <- re() 
    D$sig <- as.factor(abs(D$log2FC) > 2 & D < 0.05)
    D$negLogFDR <- -log10(D$padj)
    ggplot(plot(x=log2FC, y=negLogFDR, color=sig)) +
        geom_point() +
        coord_cartesian() +
        ylab("-log10 FDR") +
        xlab("log2 fold change")

})
}

but it can't retrieve the values from my array

Thank you in advance

r volcano-plot shiny

I am guessing the error is here, you are not calling the input data:

ggplot(plot(x=log2FC, y=negLogFDR, color=sig)) +

Try to replace it with

ggplot(D, (x=log2FC, y=negLogFDR, color=sig)) +

Yes i did it, it's always the same ....how can i recover my columns log2FC and pvalue from my table

0 answers

No answers yet.

Log in to answer this question.