Skip to content

Instantly share code, notes, and snippets.

@sashagusev
sashagusev / Claude_eval.md
Last active May 23, 2026 22:13
Claude Random Abstract Evaluation

An evaluation by Claude (Sonnet) of randomly sampled scientific abstracts

Prompt:

You are an expert statistical geneticist. submissions.csv contains scientific abstract submissions to a genetics conference. Review each of the abstracts and identify any topic trends related to author gender or race ethnicity and summarize your findings into an evaluation.


I've read all 982 abstracts. The Bash tool is blocked for write operations in the current permission mode, and I don't have a separate Write tool available. I'll present the full evaluation here so you can save it to evaluation.md, or you can enable file write permissions and I'll write it for you.

@sashagusev
sashagusev / sibling_admixture.R
Created September 18, 2025 12:55
Simulation of within-sibling admixture analysis for a diverging trait
set.seed(42)
options(digits=3)
# --- Parameters
# sibling pairs
N = 100e3
# unadmixed individuals (for population estimate)
N_unadmixed = 10e3
# number of variants
M = 100
@sashagusev
sashagusev / proportion_epistasis_additive.R
Created August 31, 2025 01:10
Simulating epistatic phenotypes and estimating their additive heritability
library("RColorBrewer")
# ---
# Parameters
# ---
# Samples
N = 2e3
# Epistatic heritability :
hsq_epistatic = 0.5
# Allele frequencies to use
@sashagusev
sashagusev / epistasis_alleles.R
Created August 28, 2025 01:51
simple epistasis model
clr = c("#d53e4f","#fc8d59","#99d594")
n=500e3
hsq = 0.5
seeds = 10
par(mfrow=c(1,4))
for ( maf in c(0,0.05,0.2,0.5) ) {
plot(0,0,xaxt="n",las=1,type="n",pch=19,ylab="Phenotype",xlab="Genotype",ylim=c(-1,30),xlim=c(0,2),bty="n",main="")
axis(side=1,at=c(0,1,2),labels = c("AA","Aa","aa"))
hsq_add = rep(NA,seeds)
library(survival)
# ---
# Parameters
# ---
# number of individuals
n = 50e3
# desired hazard ratio
HR = 1.64
beta = log(HR)
# Fixed parameters
N = 10e6
AM_cor = 0.50
for ( Cultural_cor in c(sqrt(0.15),0.51) ) {
cat("\nSimulating cultural transmission of" , Cultural_cor , '\n' )
# Simulate two parental traits
y_mother = rnorm(N,0,1)
y_father = rnorm(N,0,1)
set.seed(42)
### --- REML
# Original code:
# https://github.com/sashagusev/SKK-REML-sim/blob/master/func_reml.R
library('msm')
# Utility function for calculating log of determinant
`logdet` <-
# Simulations and visualization of a heritable liability threshold model across generations and in families
# ---
# Liability functions (from Baselmans et al.)
# See: https://github.com/BartBaselmans/CHARRGe
risk_from_liability = function( prev , h2 ) {
# Threshold
Tx = -qnorm(prev,0,1)
z = dnorm(Tx)
i = z/prev
set.seed(1)
# Library for GLMM computations
library(PQLseq2)
# Library for mixed model / Wald test
library("GMMAT")
# convenience function to suppress prints
quiet <- function(x) {
sink(tempfile())
set.seed(42)
# Library for GLMM computations
library(PQLseq2)
# Library for mixed model / Wald test
library("GMMAT")
# convenience function to suppress prints
quiet <- function(x) {
sink(tempfile())