Бам файл выглядит как кривая Гильберта в блестящем окне R и указатели с Highcharter - PullRequest
0 голосов
/ 08 ноября 2019

Я уже сделал кривую Гильбера из файла bam (1-я хромосома). Я хотел бы появиться в блестящем окне R и обрабатывать указатели и координаты хромосом с высоким уставом. Буду признателен за любую помощь. Спасибо !!!

Я подготовил server.R и ui.R плюс файл преобразования BAM в вектор, а затем преобразовал файл Bam кривой Гильберта, преобразованный в вектор, а затем в кривую Гильберта

library(chromstaR)
library(GenomicRanges)
library(HilbertCurve)
library(circlize)
bampath <-"C:/Users/Admin/Documents/R/win- 
library/3.6/GenomicRanges/extdata/wgEncodeUwRepliSeqBg02esG1bAlnRep1.bam"
bam <- bampath

reads <- readBamFileAsGRanges(bam, chromosomes='chr1', 
pairedEndReads=FALSE,
                    min.mapq=10, remove.duplicate.reads=TRUE)

hc = GenomicHilbertCurve(chr = "chr1", level = 5)
hc_points(hc, reads, gp = gpar(col = "red"))  

сервер R для 1-го входа БАМ

 library(shiny)

library(datasets)

# Set some global shiny options
# Increase max upload size so as to accomodate BAM files
options(shiny.maxRequestSize=10000*1024^2)

shinyServer(
  function(input, output, session) {

# Intitiate list of observers
    observers <- list()
# Record data source changes


# Set up response to clear uploaded file buttons
    output$bam_1 <- renderUI({
      input$clear_bam_1
      fileInput(
        inputId="bam_1",label=""
      )
    })

# Fill in the spot we created for a plot
    output$hilbert <- renderPlot({
  # Initialize the visualization environment
      plot(1:100,1:100,xaxt="n",yaxt="n",pch=20,col="white",
           xlab="",ylab="")
      text(50,50,"The image will be displayed here",cex=5,font=2)
      output$coords <- renderText({
        "Chromosomal coordinates will be displayed here"
      })
      output$browser <- renderUI({
        tags$div(
          style=paste(
            "background-color: #ffcc82;",
            "margin-top: 5px;",
            "margin-bottom: 10px;",
            "border-style: solid;",
            "border-width: 1px;",
            "border-color: #e68701;",
            "padding: 10px;",
            "border-radius: 5px;"
          ),
          "Associated UCSC Genome Browser session",
          tags$br(),
          tags$a(
            href="http://genome.ucsc.edu",
            target="_blank",
            "http://genome.ucsc.edu"
          )
        )
      })
    })

пользовательский интерфейс для 1-го файла БАМ

библиотека (блестящая)

shinyUI(
  fluidPage(
    tags$head(
      tags$script(
        type="text/javascript",
        src="jscolor/jscolor.js"
      ),
      tags$style("#messages{color: #e50000;}")
    ),
    titlePanel("ShinyHil"),
    fluidRow(
      column(3,wellPanel(
        h4("Input source"),
        tabsetPanel(
          id="input_type",
          tabPanel(
            title="BAM files",
            fluidRow(
              column(1,h6("1st")),
              column(7,htmlOutput("bam_1")),
              column(2,actionButton(
                inputId="clear_bam_1",label="Clear"
              ))
            )

tabPanel(
            title="BAM link",
            fluidRow(
              column(1,h6("1st")),
              #column(7,htmlOutput("link_1")),
              column(7,textInput(
                inputId="link_1",label=""
              )),
              column(2,actionButton(
                inputId="clear_link_1",label="Clear"
              ))
            )
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...