Skip to content

Instantly share code, notes, and snippets.

View vjcitn's full-sized avatar

Vince Carey vjcitn

View GitHub Profile
@vjcitn
vjcitn / agymagic.py
Created July 19, 2026 11:44
code provided by google search to 'rewrite' prompt cell with python code, start the cell with %%antigravity
import sys
from IPython.core.magic import register_cell_magic
from IPython.display import Javascript
import IPython
@register_cell_magic
def antigravity(line, cell):
"""Invokes Google Antigravity CLI to rewrite the current cell based on a prompt."""
import subprocess
import json
@vjcitn
vjcitn / Dockerfile
Last active July 17, 2026 23:11
For Antigravity in AnVIL
FROM us.gcr.io/broad-dsp-gcr-public/terra-base:1.0.1
USER root
# utilities for Bioconductor AnVIL package installation
RUN apt-get update && \
apt-get install -y libuv1-dev libcurl4-openssl-dev libssl-dev
# If `AnVILGCP` is being installed, it relies on the `gcloud` command line utility
RUN curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --batch --yes --no-tty --dearmor -o /usr/share/keyrings/cloud.google.gpg
@vjcitn
vjcitn / avdialog.txt
Last active July 16, 2026 11:46
Antigravity dialog to enumerate 1000 genomes data resources in a workspace
This was produced in AnVIL using vjcitn/anvbiocagy:0.0.2 custom environment, after invoking "agy" and authenticating
────────────────────────────────────────────────────────────
> please write some R code that will produce a markdown table of the key data resources in this workspace
● ListDir(/home/jupyter)
● Bash(find . -maxdepth 3 -not -path '*/.*')
● ListDir(/home/jupyter/packages)
● Bash(find . -type f -not -path '*/.*')
● Bash(find . -maxdepth 2 -not -path '*/.cache*' -not -path '*/.local*' -not -path '*/.gemini*' -not -path '*/.config*' -not -
@vjcitn
vjcitn / summ.R
Created June 25, 2026 01:06
for AnVIL AI work, demonstrate ollama with updated model
text = "Voyager to SpatialFeatureExperiment (SFE) aims to be analogous scater to SFE, implementing basic exploratory spatial data analysis (ESDA) and plotting. SFE inherits from SCE and SpatialExperiment (SPE), so all methods written for SCE and SPE can be used for SFE as well.
In this first version, ESDA is based on the classic geospatial package spdep, but future versions will incorporate methods from GWmodel, adespatial, and etc.
These are the main functionalities of the Voyager at present:
Univariate global spatial statistics, such as Moran’s I, Geary’s C, permutation testing of I and C, correlograms, global G, and semivariogram.
Univariate local spatial statistics, such as local Moran’s I, local Geary’s C, Getis-Ord Gi*, Moran scatter plot, and local spatial heteroscedasticity (LOSH).
Multivariate spatial statistics, such as MULTISPATI PCA and a multivariate generalization of local Geary’s C.
Bivariate spatial statistics, such as Lee’s L (global and local) and cross variograms.
@vjcitn
vjcitn / makeMAGEtqtl.R
Last active June 18, 2026 00:56
script to produce a tQTLExperiment
library(tQTLExperiment)
data(mageSEfilt, package="CSHLvc2026")
plink_paths <- cache_mage_chr17_plink()
## [ cache hit ] CCDG_mage_chr17.fam
## [ cache hit ] CCDG_mage_chr17.bim
## [ cache hit ] CCDG_mage_chr17.bed
## [ validate ] Checking .bed magic bytes ...
## [ validate ] .bed magic bytes OK.
plpre <- tools::file_path_sans_ext(plink_paths[["bed"]]) # works but not a list!
cd <- as.data.frame(colData(mageSEfilt))
@vjcitn
vjcitn / get_mageplink.R
Created June 16, 2026 15:26
obtain PLINK resources for CCDG 1KG genotypes for MAGE chr17
@vjcitn
vjcitn / log.txt
Created June 8, 2026 11:27
osta build error 1
processing file: bkg-python-interoperability.qmd
1/41
2/41 [unnamed-chunk-1]
3/41
4/41 [libraries]
5/41
6/41 [venv-]
7/41
8/41 [req]
9/41
@vjcitn
vjcitn / OSTA4anvil.md
Created June 8, 2026 10:56
Markdown for description of OSTA for AnVIL workspace

an instance of the Orchestrating Spatial Transcriptomics Analysis book

Jun 8 2026: use us.gcr.io/broad-dsp-gcr-public/terra-base:1.0.1 to have sudo capabilities.

To install the infrastructure, et a machine with 4 CPUs and 150 GB disk.

We use r2u to get packages and ubuntu infrastructure. Specifically, we use the script

#!/bin/bash
@vjcitn
vjcitn / efademo7.R
Created June 3, 2026 16:34
some shape analysis with xenium example
#' sfe_efa_bridge.R
#'
#' Bridge between SpatialFeatureExperiment cell boundary polygons
#' and Elliptic Fourier Analysis (Momocs).
#'
#' Extracts cell segmentation polygons from an SFE object,
#' computes EFA coefficients per cell, stores them as a
#' reducedDim or colData, and provides reconstruction/visualization.
#'
#' Dependencies:
@vjcitn
vjcitn / docirc.R
Created May 28, 2026 22:52
produce data in an elliptical pattern
# Set seed for reproducibility
set.seed(123)
# Generate 15 uniform points in the unit circle
n <- 15
# Method: Generate points uniformly in unit circle using polar coordinates
# We need to use square root to ensure uniform distribution
r <- sqrt(runif(n)) # Square root to get uniform distribution
theta <- runif(n, 0, 2*pi)