Giter VIP home page Giter VIP logo

peakpeeker's People

Contributors

j-andrews7 avatar jake-steele avatar lhk33 avatar

Watchers

 avatar  avatar

peakpeeker's Issues

Utilize async to ensure responsiveness of the app as peak calling runs

Using software that hangs while it's waiting on some intensive process to finish is annoying. async programming is a way around that, as it uses a placeholder as a promise of output when a given bit of code is done running.

So for example, if we're running a peak caller and want stuff to not just freeze up for the 15-30 seconds until it's done, we can utilize a promise to allow R to spawn an additional process to say, "Hey, we'll show this when it's done, but you can continue doing whatever with the UI in the meantime until then."

I don't actually know if this will be necessary, but I suspect it might be, especially when more than a few instances are used/running at once. Another thing I've never used in R, but hey, we're here to learn.

Write shiny module for chosen OG peak caller

This is likely the bit that the entire project hinges on, mostly. Shiny Modules should allow us to instance new...instances, I guess, of a peak caller pretty easily, without duplicating code. Being able to say "just pop a new do-hicky in" rather than hard-coding it all will be pretty nice and make adding additional peak callers much easier.

I've never done this, so we'll see how it goes.

  • Write UI for chosen peak caller.
    • Parameters/left pane.
    • Track/right pane.
  • Write server code.
    • Peak calling, see #8.
    • Output conversion, see #9.
    • Output display.

Determine which peakcaller to start with and which to add later

There are a whole buncha peak callers, some specialize for different assays. Using something generic/common like MACS2 is likely a good first attempt.

Other options include MACS 1.4.3, PeakRanger, SICER, and SICER2. The SICERs are meant more for broad peaks, while PeakRanger has a few different modes/callers included for different purposes, which is useful. It was also used by modENCODE, so some traction there.

Regardless, start with one, we can try to add others later or if we have time. Comments and additions welcome here.

Implement button to add new instance of peak caller.

By default, there will be no peak callers box shown. We'll need to add a button that does a few things:

  • Get peakcaller chosen from a selectInput dropdown menu containing all the options (will only have one to start).
  • Add a new shiny module for the selected peak caller, ensuring temp stuff is named/kept track of appropriately. See the insertUI docs for how this can be done...probably.

Probably more. This is one of the more challenging aspects of the project.

Implement and test using basilisk to install peakcaller envs.

I think something like the following will work:

#' @importFrom basilisk BasiliskEnvironment
env_macs2 <- BasiliskEnvironment("env_macs2", pkgname="ClientPackage",
                            packages=c("macs2==2.2.7.1", "python==3.8"),
                            channels=c("bioconda", "conda-forge"))

env_macs <- BasiliskEnvironment("env_macs", pkgname="ClientPackage",
                            packages=c("macs==1.4.3", "python==2.7"),
                            channels=c("bioconda", "conda-forge"))

And then we can use system or system2 to use them, e.g.:

#' Test function
#'
#' Does nothing but test that we can load modules from different virtual environments.
#'
#' @return A list of names of objects exposed in each module.
#' @export
#' @importFrom reticulate import
#' @importFrom basilisk basiliskStart basiliskRun basiliskStop BasiliskEnvironment
#' @importFrom basilisk.utils activateEnvironment deactivateEnvironment

test <- function() {
  cl <- basiliskStart(env_macs2)
  macs2.v <- basiliskRun(cl, function() {
    outtie <- system2('macs2', args = c('--version'), stdout = TRUE)
    return(outtie)
  })
  basiliskStop(cl)

  cl <- basiliskStart(env_macs)
  macs.v <- basiliskRun(cl, function() {
    outtie <- system2('macs', args = c('--version'), stdout = TRUE)
    return(outtie)
  })
  basiliskStop(cl)

  list(macs=macs.v, macs2=macs2.v)
}

Note that we'll have to nest everything in basiliskRun. I don't think this will work on Windows, and it's dependent on the peak callers being available in conda/bioconda. I made sure to add MACS 1.4.3, and most of the others are already available for at least linux and OSX. PeakRanger is only available for linux from conda - this may be something I can fix on the conda side after the fact.

Determine which parameters matter/should be added for peak callers of interest

Many of the peak callers mentioned in #2 have a ton of parameters. Some matter, some don't. Making note of which ones are worth making available to the user and which should just use default settings will be important.

Pretty easy to adjust later, so we can throw the obvious ones up at first and go from there.

  • MACS2
  • PeakRanger - Actually has 3 different peak callers in it (ranger, ccat, bcp).
  • MACS - Gonna have to check the command line for this one, can't even find the manual online anymore.
  • SICER2 - This actually contains another variant of their peakcaller called RECOGNICER too.

Find good toy data (ChIP, ATAC, CUTNRUN) and test region

Obviously need data to test on. Getting both sharp (TF) and broad data (histone marks) and the various assays.

And preferably finding a region with decent peaks across these marks/assays (GAPDH, MYC?)

  • ATAC-seq
  • TF ChIP-seq
  • Histone ChIP-seq
  • Some sorta CUTNRUN
  • Find region

Actually do peak calling

Two options here. Either create a new peakcalling function for each caller, or use a generic one that does the initial calling and just have caller-specific clean-up/conversion/whatever functions to get the results in an appropriate format for viewing in the browser.

Doesn't really matter which we choose first, but probably cleaner to put it all in the module code as described in #7 eventually.

  • Do peakcalling.
  • Convert bed, narrowPeak, etc output to GFF. See #9.
  • Have browser catch output and display it. Probably need an observer for this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.