R Shiny volcano plot
0
0
Entering edit mode
3.1 years ago
Nobody ▴ 30

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 • 1.2k views
ADD COMMENT
0
Entering edit mode

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)) +
ADD REPLY
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 2107 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6