Skip to content

Instantly share code, notes, and snippets.

View vjcitn's full-sized avatar

Vince Carey vjcitn

View GitHub Profile
@vjcitn
vjcitn / gist:c936ecca8ae24c3343a4dac8d668e6fb
Created April 8, 2025 12:54
save the tabview program
#' explore workspace tables
#' @import AnVIL
#' @import shiny
#' @import DT
#' @export
tabview = function() {
knownTabs = c("anvil_biosample", "donor", "project", "anvil_project", "file",
"anvil_file", "activity", "anvil_activity")
colhelper = list(anvil_project = c("import:timestamp", "title",
@vjcitn
vjcitn / log1k.txt
Created March 23, 2025 18:21
log events for making R4.6
make[4]: Leaving directory '/home/stvjc/SECURE/R-46-sec-src/src/extra/tre'
make[4]: Entering directory '/home/stvjc/SECURE/R-46-sec-src/src/extra/tre'
gcc -I. -I. -I../../../src/include -I../../../src/include -I/usr/local/include -DHAVE_CONFIG_H -fopenmp -fpic -O2 -Wall -Wformat=2 -Wconversion -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS -fstack-clash-protection -fstack-protector-strong -Wl,-z,nodlopen -Wl,-z,noexecstack -Wl,-z,now -Wl,--as-needed -Wl,--no-copy-dt-needed-entries -fvisibility=hidden -c regcomp.c -o regcomp.o
gcc -I. -I. -I../../../src/include -I../../../src/include -I/usr/local/include -DHAVE_CONFIG_H -fopenmp -fpic -O2 -Wall -Wformat=2 -Wconversion -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS -fstack-clash-protection -fstack-protector-strong -Wl,-z,nodlopen -Wl,-z,noexecstack -Wl,-z,now -Wl,--as-needed -Wl,--no-copy-dt-needed-entries -fvisibility=hidden -c regerror.c -o regerror.o
regcomp.c: In function ‘tre
@vjcitn
vjcitn / mkr46.txt
Created March 23, 2025 18:19
log of making R 4.6 with specific cflags
This file has been truncated, but you can view the full file.
make[1]: Entering directory '/home/stvjc/SECURE/R-46-sec-src/doc/manual'
creating RESOURCES
creating FAQ
creating doc/html/resources.html
make[1]: Leaving directory '/home/stvjc/SECURE/R-46-sec-src/doc/manual'
make[1]: Entering directory '/home/stvjc/SECURE/R-46-sec-src/m4'
make[1]: Nothing to be done for 'R'.
make[1]: Leaving directory '/home/stvjc/SECURE/R-46-sec-src/m4'
make[1]: Entering directory '/home/stvjc/SECURE/R-46-sec-src/tools'
make[1]: Nothing to be done for 'R'.
@vjcitn
vjcitn / Dockerfile.RbowtieCuda.rbocud0.0.3
Created March 22, 2025 03:06
A dockerfile supporting a test of RbowtieCuda
FROM rocker/r-ver:devel
RUN apt update
RUN apt install -y vim git cmake
RUN git clone https://github.com/FranckRICHARD01/RbowtieCuda
# likely unnecessary
#RUN apt-get purge -y nvidia* libnvidia*
#RUN apt-get remove -y nvidia-*
#RUN rm -f /etc/apt/sources.list.d/*cuda*
@vjcitn
vjcitn / gist:7580b425341eab756fd62b59d10faae7
Created March 8, 2025 23:22
pull lung samples from atlas
library(cellNexus)
library(dplyr)
md = get_metadata()
dd = md |> filter(disease=="normal", tissue %in% c("lung", "lung_parenchyma", "lung_epithelium"))
lungsce1M = get_single_cell_experiment(dd)
HDF5Array::setAutoBlockSize(size = 1e+09)
@vjcitn
vjcitn / exploreCN.R
Created March 8, 2025 11:19
explore cellNexus metadata
exploreCN = function() {
md = cellNexus::get_metadata()
vbls = colnames(md)
ui = fluidPage(
sidebarLayout(
sidebarPanel(
helpText("navigate metadata of cellNexus"),
checkboxGroupInput("vars", "vbls",
choices=sort(colnames(md)), inline=TRUE)
),
@vjcitn
vjcitn / exploreCAQ.R
Created March 7, 2025 23:00
simple descriptive data interactively filtered, for CuratedAtlasQueryR
library(shiny)
library(CuratedAtlasQueryR)
library(dplyr)
library(rlang)
library(DT)
#' explore the CuratedAtlasQueryR metadata
#' @export
exploreCAQ = function() {
md = CuratedAtlasQueryR::get_metadata()
vbls = colnames(md)
@vjcitn
vjcitn / gist:4e6af8b67103e78d599b104b091c0abe
Created March 2, 2025 11:13
AnnotationPipeline step -- from preliminary sqlite to sanctionedSqlite for a single organism
# This function can be run in a 'newPkgs' folder after sufficient
# results have been obtained in annosrc/db, to produce a sanctionedSqlite database
# for a single organism
# the following constants are crucial
whattype <- tolower("OrgDb")
wheretoput <- 20250301
theversion <- "3.21.0"
@vjcitn
vjcitn / chkInclusion.R
Created February 16, 2025 22:18
extraction of shapes and counts of transcripts within shape boundaries
library(SpatialData)
library(SpatialData.data)
library(sf)
library(SummarizedExperiment)
if (!exists("mb")) mb = MouseBrainMERFISH()
make_circles = function(spd, shapetype="cells") {
cshape = SpatialData::shapes(spd)[[shapetype]]
df1 = data(cshape) |> as.data.frame()
@vjcitn
vjcitn / gist:c2a7d034b84cfc33ee1e9e3b1f9354c7
Created February 16, 2025 18:58
code for producing sf ellipse geometry from data frame with center, lengths of major/minor radii, and orientation angle in degrees
df2ellipses = function(datf, npts=100) {
requireNamespace("sfdep")
requireNamespace("sf")
stopifnot(all(c("X_centroid", "Y_centroid", "maj", "min", "angdeg") %in% names(datf)))
dd = data.matrix(datf[,c("X_centroid", "Y_centroid")])
cens = lapply(seq_len(nrow(datf)), function(x) sf::st_point(dd[x,]))
maj = datf$maj
min = datf$min
angle_in_deg = datf$angdeg # angle_in_rad/0.01745329
dd = data.matrix(cbind(dd, angdeg=datf[,"angdeg"])) #angle_in_deg)