Skip to content

Instantly share code, notes, and snippets.

@zhanxw
zhanxw / create_forked_task.R
Created June 26, 2019 16:48 — forked from jcheng5/create_forked_task.R
Concurrent, forked, cancellable tasks in Shiny
library(shiny)
# Also uses parallel, shinyjs, tools
# Create a long-running task, executed in a forked process. (Doesn't work on Windows)
#
# The return value is a promise-like object with three
# methods:
# - completed(): FALSE initially, then TRUE if the task succeeds,
# fails, or is cancelled. Reactive, so when the state changes
# any reactive readers will invalidate.
@zhanxw
zhanxw / report.hilight.bug.R
Created April 5, 2018 16:43
geom_hilight() does not work
library(ggtree)
# load a tree
# tree <- treeio::read.tree("phylotree.nwk")
# this is eqivalent to:
tree <- structure(list(edge = structure(c(14L, 15L, 16L, 15L, 17L, 17L,
17L, 15L, 18L, 18L, 18L, 15L, 19L, 15L, 20L, 15L, 15L, 15L, 14L,
21L, 15L, 16L, 1L, 17L, 2L, 3L, 4L, 18L, 5L, 6L, 7L, 19L, 8L,
20L, 9L, 10L, 11L, 12L, 21L, 13L), .Dim = c(20L, 2L)), Nnode = 8L,
node.label = c("Root", "k__Bacteria", "p__Bacteroidetes",
"p__Firmicutes", "p__Proteobacteria", "p__Actinobacteria",
@zhanxw
zhanxw / Imputation.ipynb
Last active May 19, 2016 22:53
Lab: Imputation workshop
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zhanxw
zhanxw / Phasing.ipynb
Last active May 19, 2016 22:52
Lab: phasing workshop
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.