This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' produce an ontology_index instance from semantic sql sqlite connection | |
#' @param con DBI::dbConnect value for sqlite table | |
#' @return result of ontologyIndex::ontology_index evaluated for the labels and | |
#' parent-child relations in tables statements and edge of the semantic sql resource | |
#' @export | |
semsql_to_oi = function(con) { | |
# sqlite> select * from statements where predicate = 'rdfs:label' limit 40; | |
alltabs = DBI::dbListTables(con) | |
stopifnot(all(c("edge", "statements") %in% alltabs)) | |
labdf = dplyr::tbl(con, "statements") |> dplyr::filter(predicate == "rdfs:label") |> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
library(imager) | |
mpath = "https://mghp.osn.xsede.org/bir190004-bucket01/BiocGeneralData/mast.jpg" | |
happ = function () { | |
ui = fluidPage( | |
sidebarLayout( | |
sidebarPanel( | |
helpText("slider for cannyEdges alpha"), | |
sliderInput("alpha", "alpha", min = 0, max = 1, step = 0.05, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
colorapp2 = function () | |
{ | |
colordot = function (r, g, b) { | |
plot(0, 0, col = grDevices::rgb(r, g, b), pch = 19, cex = 15) | |
} | |
ui = fluidPage( | |
sidebarLayout( | |
sidebarPanel( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:jammy | |
LABEL org.label-schema.license="GPL-2.0" \ | |
org.label-schema.vcs-url="https://github.com/rocker-org/" \ | |
org.label-schema.vendor="Rocker Project" \ | |
maintainer="Dirk Eddelbuettel <edd@debian.org>" | |
## Set a default user. Available via runtime flag `--user docker` | |
## Add user to 'staff' group, granting them write privileges to /usr/local/lib/R/site.library | |
## User should also have & own a home directory (for rstudio or linked volumes to work properly). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this code will process 4k PBMCs from TENx with SingleR and scater | |
# compute some approximate PCs and produce an interactive scatterplot | |
# in PC space with a biplot | |
ii = rownames(installed.packages()) | |
if (!("BiocManager" %in% ii))install.packages("BiocManager") | |
req = c("celldex", "TENxPBMCData", "SingleR", "irlba", "scater", | |
"scales", "ggplot2", "devtools", "plotly") | |
needed = setdiff(req, ii) | |
if (length(needed)>0) BiocManager::install(needed, ask=FALSE, update=FALSE) | |
library(celldex) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filtered_biplot = function (prcomp_output, sce, sampvar = "Barcode", colorvar = "label.main", | |
which = c(1, 2), nvar = 5, shr = 0.6, ...) | |
{ | |
rownames(prcomp_output$x) = sce[[sampvar]] | |
rownames(prcomp_output$rotation) = rownames(sce) | |
proj = prcomp_output$x[, which] | |
rot = prcomp_output$rot[, which] | |
sss = function(x) sum(x^2) | |
lens = apply(rot, 1, sss) | |
kprot = rot[order(lens, decreasing = TRUE)[1:nvar], ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> r1 = run_cifar100() # pip3 install tensorflow; BiocManager::install("vjcitn/littleDeep", dependencies=TRUE) | |
No non-system installation of Python could be found. | |
Would you like to download and install Miniconda? | |
Miniconda is an open source environment management system for Python. | |
See https://docs.conda.io/en/latest/miniconda.html for more details. | |
Would you like to install Miniconda? [Y/n]: n | |
Installation aborted. | |
2023-04-29 18:14:44.950515: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. | |
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# process .bib file into a batch query to pubmed (https://pubmed.ncbi.nlm.nih.gov/batchcitmatch/) | |
# get first page | |
fixp = function(x) gsub("--.*", "", x) | |
# produce a batch query | |
build_query = function (x) | |
paste(x$journal, x$year, x$volume, fixp(x$pages), x$author[[1]]$family, | |
paste0(x$author[[1]]$family, x$year), sep = "|") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
as_renv_entry = function(x) { | |
stopifnot(all(c("Package", "git_url", "git_last_commit") %in% names(x))) | |
class(x) = c("renv_entry", class(x)) | |
x | |
} | |
print.renv_entry = function(x, ...) { | |
cat(sprintf("renv entry for %s %s\n", x$Package, x$git_branch)) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' produce matrices of AD values from VcfFile instance for a given genomic interval | |
#' @param vf instance of VcfFile, should be tabix indexed | |
#' @param rng compatible GRanges instance | |
#' @param genome character(1) obligatory for readVcf | |
#' @return list with matrices allele1 and allele2, similar to the AD matrix, and ref and alt as obtained directly | |
#' @examples | |
#' x = VariantAnnotation::VcfFile("ALL.chrX.BI_Beagle.20100804.genotypes.vcf.gz") | |
#' param = GRanges("X", IRanges(60000, width=10000)) | |
#' m = ad_mats(x, param) | |
#' m$allele1[1:4,1:10] |