曼哈顿图可视化备用页面
此页面用于服务器拒绝曼哈顿图可视化访问时备用
使用前请确认:
- 计算机已安装R 4.05及以上版本
- 安装Rstudio软件
使用说明
- 下载基于混合线性模型计算得到的文件
点击此处下载 关于该压缩文件说明:为减小文件大小,压缩文件采用分卷压缩,请解压后在同一文件夹下再一次解压
- 下载R shiny UI端和server端文件
点击此处下载 关于该文件说明:UI端和server端被写入同一文件app.R中
- 将以上所有文件置于同一目录,运行
# app.R 代码
library(shiny)
ui <- fluidPage(
titlePanel("Manhattan plot"),
sidebarLayout(
sidebarPanel(
checkboxGroupInput("traits",label = h6("Choose traits"),choices = list("ANG_BTM"=4,
"ANG_TOP"=5,
"AREA"=6,
"AVG_DEN"=7,
"RTP_COUNT"=8,
"SKL_WIDTH"=9,
"WIDTH_MAX"=10,
"WIDTH_MED"=11),selected =4 ),
radioButtons("radio", label = h6("Choose manhattan plot type"),
choices = list("Horizontal version" = "m", "Circle version" = "c"),
selected = "c"),
sliderInput("slider1", label = h6("Threshold value"), min = 1e-6,
max = 1e-4,value = 1e-5),
helpText("Please note that because of the huge raw data,image plot and computation are slow.Please be patient.
After the download button is clicked, the image will be drawn. Please wait patiently and do not click multiple times.
Due to the computing power limitations of the site, the downloaded images are limited as 500 * 500 pixels.")
),
# Show a plot of the generated distribution
mainPanel(
tabsetPanel(type = "tabs",
tabPanel("plot",plotOutput("plot"))
)
)
)
)
# Define server logic required to draw a histogram
server <- function(input, output) {
library(CMplot)
data<-read.table("datanew.txt",header = T)
output$plot <- renderPlot({
c_v<-c()
for (i in input$traits) {
c_v<-c(c_v,as.numeric(i))
}
datanew<<-data[,c(1:3,c_v)]
CMplot(datanew,type="p",plot.type=input$radio,r=0.4,chr.labels=paste("Chr",c(1:10),sep=""),
threshold=c(input$slider1),cir.chr.h=1.5,amplify=TRUE,
threshold.lty=c(1),threshold.col=c("red"),
signal.line=1,signal.col=c("red"),
chr.den.col=c("darkgreen","yellow","red"),
bin.size=1e6,outward=FALSE,file="jpg",
memo="",dpi=300,file.output=F,verbose=TRUE,width=1000,height=1000)
})
}
# Run the application
shinyApp(ui = ui, server = server)