I study how genetic variation shapes cardiometabolic traits, particularly blood lipids, through GWAS, rare-variant analyses, and Bayesian methods for assessing replication. I contribute to TOPMed and the Global Lipids Genetics Consortium.
Background
Aug. 2026–present — Postdoctoral Fellow at Amgen, working with Pradeep Natarajan.
Course Coordinator — Introduction to Statistical Computing (2023).
Teaching Assistant — Statistical Genetics, Introduction to R, and Accelerated Statistical Training (2021–2022).
News
Aug. 2026Started as a Postdoctoral Fellow at Amgen, working with Pradeep Natarajan.
Feb. 2026Joined the Natarajan Lab at MGH and the Broad Institute as a Postdoctoral Researcher.
Nov. 2025Defended my PhD dissertation in Biostatistics at Boston University.
Teaching
At Boston University:
Course Coordinator — Introduction to Statistical Computing (2023).
Teaching Assistant — Statistical Genetics, Introduction to R, and Accelerated Statistical Training (2021–2022).
The Cognitive Siphoning Effect of AI
2026-12-04
山西晋祠鱼沼飞梁
When the tool quietly becomes the intellectual pursuit
Over the past year, I have noticed a shift in what occupies my mind.
As a statistical geneticist, my thoughts used to gravitate toward biology. Even outside working hours, I found myself returning to questions that had emerged from my research. How do we connect genetic associations to biological mechanisms? Why do rare and common variants sometimes tell different stories about the same gene? How can we integrate human genetics with experimental biology to better understand disease?
Lately, my thoughts have gravitated toward AI. How can I build a better research agent? How should multiple agents collaborate? Can AI independently formulate a biological hypothesis, design an analysis, and interpret the results?
I started using AI to solve genetics problems. Somewhere along the way, I started spending my curiosity on AI problems.
From tool to pursuit
My adoption of AI began for practical reasons. Statistical genetics involves a considerable amount of coding, and AI coding agents have substantially reduced the time I spend implementing methods, debugging pipelines, and exploring unfamiliar datasets. I expected to spend the time saved thinking about biology.
Instead, my curiosity moved toward increasingly abstract questions. Once I saw that an agent could implement an analysis, I wondered whether it could design the analysis itself. Then I wondered whether it could identify interesting scientific questions independently. Eventually, I found myself thinking about the architecture of an autonomous research system.
Each question was more ambitious than the previous one and further removed from the original biological problem.
I recently set up a dedicated Mac mini to experiment with AI agents. An effort to improve my research productivity has since developed into an exploration of agent orchestration, persistent memory, remote access, and workflow automation. These have become intellectual interests in their own right.
The cognitive siphoning effect
I think of this as the cognitive siphoning effect of AI: the phenomenon in which AI frees up cognitive resources within an intellectual pursuit and subsequently redirects those resources toward itself.
I am learning faster, exploring more ideas, and working more efficiently. At the same time, the allocation of my curiosity has changed.
What I find particularly interesting is how this extends beyond working hours. Much of scientific curiosity develops in unstructured mental space—while walking, driving, or doing very little. These are the moments when I used to think about genetics and now increasingly think about AI.
There is a paradox here. AI reduces the cognitive cost of solving problems while continuously generating new problems of its own. The cognitive resources it releases become available for further exploration of AI itself.
The original intellectual pursuit becomes more efficient, yet occupies less of the mind.
Why the pull is so strong
A biological hypothesis can take months or years to validate. Even in computational genetics, an interesting idea may require weeks of work before I know whether it leads anywhere.
Experimenting with AI offers a much shorter feedback cycle. I can test an agent configuration, redesign a workflow, or prototype a system in an afternoon. The rapid evolution of the technology means that there is almost always another possibility to explore.
There is also the appeal of abstraction. Instead of solving one genetics problem, why not build a system capable of solving many? Instead of performing one analysis, why not automate an entire class of analyses?
This logic can extend almost indefinitely. A tool becomes a system, the system becomes a platform, and the platform itself becomes a research problem. Each additional layer opens up new intellectual possibilities.
I find this progression genuinely fascinating. I also find myself spending progressively less time thinking about the biological questions that initiated it.
Drift versus direction
Intellectual interests evolve. The emergence of a technology as transformative as AI naturally creates new research interests, and I find many of the opportunities at the intersection of AI and biology compelling.
What interests me is the distinction between direction and drift. Choosing a new intellectual pursuit is an exercise of curiosity. Gradually adopting one through repeated exposure to faster feedback and new technical possibilities is a different process.
I suspect this phenomenon extends well beyond genetics.
A geneticist, a physicist, and an economist might once have spent their idle intellectual time thinking about fundamentally different problems. Today, all three might find themselves thinking about how to build better AI agents.
As AI becomes a general-purpose technology across intellectual professions, it also becomes a shared object of intellectual curiosity.
What happens to intellectual diversity when people with vastly different disciplinary backgrounds begin directing their curiosity toward the same technology?
AI could expand our collective capacity to solve problems while narrowing the diversity of problems that attract our attention.
What do I actually want to understand?
I have started asking myself a question: If AI became sufficiently capable tomorrow that I no longer needed to think about prompts, agents, models, or workflows, what would I want to spend my time thinking about?
My answer is still human biology and disease. I want to understand how genetic variation gives rise to biological mechanisms, how those mechanisms contribute to disease, and how we might intervene.
The distinction between building the capacity to do science and doing science has become increasingly important to me.
Interestingly, I used AI to help articulate this very observation. Writing about the cognitive siphoning effect of AI has itself become another intellectual activity centered on AI.
AI is changing what we think about.
As the cost of solving intellectual problems declines, I wonder whether the more consequential question will be where we choose to direct our curiosity.
AI Agents in Statistical Genetics Coding: A Practical Guide
2026-05-04
山西永祚寺双塔
Statistical genetics is a coding-intensive field. On any given day you might be writing R scripts for quality control, building GWAS pipelines in Python, submitting batch jobs to an HPC cluster, or debugging statistical models — across projects spanning GWAS meta-analysis, whole-genome sequencing, rare variant association testing, and functional genomics.
AI coding agents have reshaped how I work. This guide covers the tools I use, the concepts that make them effective, and practical patterns for statistical genetics — including how to work safely with sensitive genomic data.
Before picking a tool, check with your institution’s IT or compliance team. In academic and clinical research settings, enterprise-licensed tools — such as GitHub Copilot under an institutional Microsoft or GitHub agreement — are often cleared for research use, whereas personal-subscription tools typically require separate compliance review before you use them in institutional environments.
Lack of institutional approval does not mean a tool is inherently unsafe — only that it has not completed formal review under an enterprise agreement. The core question to ask before adopting any AI tool: Is this tool covered by an enterprise agreement with a BAA (Business Associate Agreement) or equivalent data governance terms?
The AI toolkit
VS Code: the hub
All of my AI tools live inside VS Code, which I run both locally and over remote SSH on cluster head nodes. Keeping everything in the IDE makes it the natural integration point.
GitHub Copilot
GitHub Copilot is often already covered by university or institute GitHub enterprise licenses, making it the lowest-friction place to start. Check with your IT department before paying out of pocket.
Copilot inside VS Code goes well beyond inline autocomplete. Copilot Chat covers most of what a dedicated AI CLI offers: reading files, editing across a repo, running terminal commands, and executing multi-step tasks. Three features are especially useful:
Autopilot mode runs tasks end-to-end without pausing for approval at every step. Configurable approval levels — including an “approve all” option — let it operate much like a CLI agent.
Auto model routes each task to an appropriate model from a pool spanning Anthropic (Claude), OpenAI (Codex/GPT), and Google (Gemini). Routine steps go to faster, cheaper models while harder reasoning goes to stronger ones.
Local models (such as Qwen or custom endpoints) are supported as well. Open-source models handle boilerplate, simple refactoring, and format conversions reliably; even when they trail frontier models slightly on complex reasoning, they are more than capable for everyday research code.
Billing note: GitHub Copilot moved to usage-based billing in June 2026, replacing legacy premium requests with GitHub AI Credits (more on managing costs below). Confirm with your IT or finance team how your enterprise agreement handles credit allowances and overages.
Claude Code
Claude Code is Anthropic’s terminal-first coding agent, which I use on a personal subscription alongside Copilot. It lives in your shell, reads and edits files across the repo, runs commands, and holds whole-project context — making it particularly strong for extended, multi-step work.
Even if you use another agent, four concepts from Claude Code are worth understanding because the same patterns carry over:
Memory: persistent context across sessions — your directory layout, HPC environment, conventions, and preferred packages — so you stop re-explaining your setup.
Skills: reusable, domain-specific workflows invoked by name; essentially encoded playbooks for recurring tasks.
Hooks: event-driven automation, such as running a linter after every edit or validating memory and partition flags in a SLURM script before submission.
Multi-agents: parallel sub-agents that explore different parts of a codebase or documentation simultaneously and report back to the main thread.
Other tools
I turn to Codex for quick one-off code generation and explaining unfamiliar scripts, and Gemini when I need a large context window — digesting long documentation, comparing multiple pipeline scripts, or inspecting lengthy summary-statistic outputs.
Setting up your agent for success: the context file
The highest-leverage step you can take before unleashing an AI agent on a research repo is giving it explicit project context. Claude Code reads a CLAUDE.md file at the project root; Copilot uses .github/copilot-instructions.md, and several other tools look for AGENTS.md.
Here is an example from one of my active projects:
## Scientific Focus
- Prioritize statistical and biological correctness over surface-level style
- When reviewing analysis scripts, lead with the science before describing mechanics
## Project Structure
- Pipeline: limma differential expression → gene-level effect sizes →
burden correlation → plots
- Key directories: ref_data/ (reference), data/ (intermediate),
results/ (per-analysis outputs)
## HPC Environment (Grid Engine / SGE)
- Submit jobs with qsub; interactive sessions with qrsh
- GPU jobs require three flags: -l gpu=1, -l os=RedHat8, -hard
- Container runtime: podman (rootless, Docker CLI-compatible)
- GPU batch job template:
#!/usr/bin/env bash
#$ -l gpu=1
#$ -l os=RedHat8
#$ -hard
#$ -l h_rt=HH:MM:SS
#$ -l h_vmem=<N>G
podman run --device nvidia.com/gpu=all --rm \
--security-opt=label=disable <image><command>## Data Conventions
- Use ENSG IDs throughout (not gene symbols)
## Coding Standards
- R is primary; use data.table and the apply family over loops
- Scripts must be self-contained with explicit seeds
- Keep commit messages ≤ 5 words
This turns generic suggestions into project-aware code. The agent reaches for data.table::fread instead of read.csv, writes Grid Engine directives instead of generic SLURM headers, uses podman instead of docker, and defaults to ENSG IDs. Twenty minutes up front saves hours of cleanup later.
The workflow: Explore, Plan, Implement, Commit
Whatever tool you use, a four-phase loop consistently beats jumping straight to “write me a script.”
Explore
Have the agent inspect what already exists before writing a line of code. Point it to prior scripts, documentation, and environment files so it builds on your conventions instead of reinventing them.
# Example prompt
"I need to run a rare variant burden test on TOPMed data.
Search this project for existing STAAR or SKAT scripts.
Check the renv lockfile to see which R packages are installed.
Look at how previous analyses handled variant annotation."
Plan
Map out the approach before writing code: inputs, outputs, reusable functions, and edge cases such as missing phenotypes, multi-allelic variants, or related individuals. In statistical genetics, a quiet bug in variant filtering or covariate adjustment can invalidate an entire run.
Most agents offer a dedicated plan mode — use it, and review the plan before letting the agent edit anything.
Implement
With exploration and planning in context, the agent’s code becomes much sharper. A few habits help:
Specify the statistics precisely. “Run a burden test” is too vague. “Run STAAR-O with MAF < 0.01, adjusting for age, sex, and the first 10 PCs, looping over all annotated genes on chr22” gives the agent what it needs.
Offload the boilerplate: SLURM/SGE headers, CLI argument parsing, logging, and path handling.
Own the methodology. The agent can code up any method you name; picking the right one still requires your statistical judgment.
Commit
Inspect the diff, run a sanity check, and commit. A well-configured agent can draft a concise commit message, verify that no hardcoded local paths slipped in, and confirm .gitignore still excludes data files.
Approval settings: keeping the agent out of dangerous territory
Agents shine when they can read files, run commands, and make edits without interrupting you on every keystroke. Unchecked autonomy, however, invites costly mistakes: deleted files, overwritten outputs, or accidental pushes to a remote repo. Approval settings draw the boundary between what the agent can do freely and where it must stop and ask.
Copilot agent approval settings in VS Code
The main switch is chat.permissions.default, which accepts three values:
default: pauses and asks before running terminal commands or editing files. Safest, and the right baseline for new tasks.
autopilot: auto-approves tool calls until the task finishes. Reserve this for tightly scoped tasks after you have signed off on a plan.
autoApprove: bypasses approvals entirely. Avoid this in research environments — it removes the safety net without granular controls.
For finer control, VS Code exposes per-category settings:
maxRequests is an underrated guardrail against runaway loops: if an agent spins out or drifts past scope, it stops at 25 steps and hands control back. Raise it for open-ended exploration; leave it at the default for well-defined tasks.
Domain filtering (chat.agent.deniedNetworkDomains / chat.agent.allowedNetworkDomains) is especially valuable in genomics. Blocking everything outside the model APIs prevents accidental data exfiltration to external endpoints.
VS Code also includes a sandbox mode on macOS and Linux that isolates agent shell commands. Set chat.agent.sandbox.enabled to "on" for full filesystem isolation, or "allowNetwork" when network access is required — a sensible default for unfamiliar sessions.
You can also assign separate models to planning and implementation (substitute your preferred current model IDs from VS Code settings):
allow rules let the agent run specific commands or write to approved paths without prompting. deny rules are hard blocks — the agent cannot override them even if asked. For a genomics repo, a clean baseline allows running R, PLINK2, and REGENIE, permits reading across the repo and writing inside src/ and scripts/, and hard-blocks any writes to /protected/.
Plan mode as a pre-flight check
Beyond helping with design, plan mode (the Plan agent in Copilot, or plan mode in Claude Code) doubles as a safety review. Before approving a sweeping task — “refactor the QC pipeline” or “add chromosome-stratified outputs downstream” — scan the plan for:
Unexpected files slated for edits
Risky shell commands (deletions, overwrites, or external network calls)
Wrong assumptions about file paths or data formats
Approving a plan is not a blank check: still read the diff before committing.
Actions that should always require approval
No matter how much autonomy you grant elsewhere, keep a human in the loop for:
Deletions and overwrites — rm, truncating existing files, or clearing directories
Remote Git actions — push, force-push, or branch deletion
Writes to protected data directories — anywhere real genomic or phenotypic data lives
External network or API calls — anything sending data outside your environment
HPC job submission — qsub, sbatch, or similar; a misconfigured array job can burn cluster allocation and be painful to unwind
The point isn’t to slow the agent down — it’s to ensure irreversible or high-impact actions always have a deliberate check.
Working with sensitive genomic data
Sensitive data raises the stakes enough to warrant its own discipline.
The core rule: never let an AI agent read individual-level data files directly. Genomic and clinical datasets are governed by DUAs, IRB protocols, and institutional policies. Even with local tools, data can still end up in chat logs, remote API payloads, or unexpected caches.
Instead, separate metadata from data:
Inspect the data yourself. Check headers and directory structure manually:
Share only the schema and paths. Column names, file formats, variable definitions, and directory layouts are almost always enough for the agent to write working code:
My phenotype file is tab-separated with a header row:
FID, IID, AGE, SEX, BMI, LDL, HDL, TG
~8,000 rows. Path: /protected/topmed/pheno.txt
My genotype data is PLINK2 format (pgen/psam/pvar) at:
/protected/topmed/geno/chr{1..22}.*
Write a REGENIE step 1 command using this phenotype file
with age, sex, and BMI as covariates.
Let the agent write the code; you run it. Review the script, then execute it on your cluster. The data never leaves your controlled environment.
Check your DUA before sharing aggregate results. Summary statistics, QQ plots, and effect-size distributions are usually non-identifiable and lower risk, but some agreements restrict sharing intermediate outputs as well.
This pattern preserves full AI leverage on the hardest part — writing accurate statistical code — while keeping identifiable data strictly inside your perimeter.
Common workflows where agents shine
GWAS QC pipelines: chaining PLINK2 commands for sample and variant QC (missingness, Hardy-Weinberg equilibrium, sex discrepancies, relatedness). Supply the thresholds; the agent generates a clean, commented shell script.
Rare variant aggregation tests: STAAR or SKAT scripts in R that load annotations, define variant sets, fit null models, and iterate across genomic regions. The high boilerplate-to-logic ratio makes this ideal territory for agents.
Visualization: Manhattan, QQ, regional association, and forest plots. Heavy ggplot2 styling is tedious by hand and fast to iterate on with an agent.
HPC job submission: SLURM or Grid Engine array scripts split by chromosome or region. Getting job-array syntax, resource flags, and output paths right on the first try is where a well-written CLAUDE.md pays for itself immediately.
Advanced usage
Models vs. agents: knowing what is actually running
This distinction matters in day-to-day work, not just in theory.
An LLM (Large Language Model) is the underlying neural network — Claude Opus, Sonnet, and Haiku; OpenAI’s GPT and Codex models; Google’s Gemini; open-weight families like Qwen, and so on. On its own, it is stateless: no persistent memory, no filesystem awareness, and no ability to execute code. It is a powerful text-in, text-out engine.
An agent wraps one or more LLMs in the infrastructure needed to take action:
Tools: reading and writing files, running shell commands, calling APIs, searching the web
Context and memory: persisting project state and pulling relevant files into the prompt
Action loop: planning a step, running a tool, inspecting the result, and adjusting
Orchestration: routing sub-tasks to different models or spawning parallel workers
Claude Code, GitHub Copilot, and Codex are all agents. Each has its own UX, toolset, and orchestration layer, yet they can run on the same underlying models. Claude Sonnet inside Claude Code and Claude Sonnet inside Copilot share the same raw reasoning ability; the wrapper determines what the model can do, not how well it thinks.
Three practical takeaways for research:
Your workflow is portable. You can swap underlying models without rewriting your prompts or your CLAUDE.md.
Fit beats raw model size. A lighter model inside an agent wired directly into your HPC environment often outperforms a frontier model that can only paste suggestions into a chat box.
Cost and latency live at the model layer. Switching to a smaller model inside the same agent cuts cost and speeds up iteration without changing how you work.
Switching models mid-workflow
In Claude Code, --model at launch or /model mid-session lets you swap model tiers on the fly using built-in aliases to match cost and speed to the task:
# Start with a frontier reasoning model for exploration and architecture
claude --model opus
# Step down to a balanced model for implementation
/model sonnet
# Use the lightest model for pure boilerplate
/model haiku
A practical three-step rhythm for a GWAS pipeline:
Design (Opus or Sonnet): “Here is my project structure and phenotype columns. Design a REGENIE step 1 and step 2 pipeline that accounts for relatedness using a KING kinship matrix.”
Boilerplate (Sonnet or Haiku): “Write the SLURM array script for step 2, one job per chromosome.”
Review (Sonnet): “Check the generated script for statistical correctness: covariate flags, phenotype paths, and output naming.”
Copilot’s Auto mode applies the same principle automatically; switching manually gives you tighter control when you want it.
MCP: connecting agents to external tools
The Model Context Protocol (MCP) is an open standard for connecting AI agents to external APIs and databases through a unified interface. Instead of copying PubMed abstracts or gnomAD allele frequencies out of a browser, you attach an MCP server and let the agent query those resources directly.
An MCP server sits between the agent and an external service, translating natural-language requests into structured API calls. Once configured, the agent treats it like any built-in tool: ask for what you need, and the result lands right in your session.
Several MCP servers are immediately useful in statistical genetics:
PubMed / NCBI: search literature and pull abstracts without leaving your editor — handy for checking a method’s original paper or known gene-trait associations.
bioRxiv: query preprint metadata and abstracts to track emerging GWAS work ahead of peer review.
ChEMBL: look up compound bioactivity, targets, and drug mechanisms — useful at the drug-gene interface (e.g., lipid-lowering targets or Mendelian randomization).
ClinicalTrials.gov: search trials by condition or intervention for translational context around GWAS hits.
gnomAD (community or custom servers): fetch population-level allele frequencies, variant annotations, and constraint metrics without switching tabs.
The payoff is workflow continuity. Without MCP, writing a lncRNA annotation script means breaking focus to open a browser, look up a variant on gnomAD, copy the frequency, and paste it back. With a gnomAD MCP server registered, you simply ask: “Check the gnomAD allele frequency for rs12345 in EUR and AFR.” The answer appears inline, and you keep moving.
In Claude Code, add servers via claude mcp add or your project’s .mcp.json. In VS Code Copilot, configure them under MCP Servers in Copilot settings.
The MCP registry catalogs community-maintained servers across domains. If you need a niche resource — say, an internal biobank API — the spec is light enough to build a custom server in an afternoon.
Cost awareness
Following GitHub Copilot’s June 2026 shift to usage-based billing (GitHub AI Credits) — and similarly across API-backed tools like Claude Code — your spend depends directly on both which model tier you pick and how much context you carry across turns:
Frontier models cost dramatically more per token than standard or lightweight tiers, and long agentic loops multiply that spend across dozens of tool calls.
Practical habits to keep spend under control:
Default to Standard: Sonnet-class models handle GWAS QC scripting, plotting, and boilerplate comfortably at a fraction of frontier-tier cost.
Reserve Frontier models for hard thinking: pipeline architecture, subtle statistical bugs, or reviewing a complex script — and never leave a frontier-tier agentic loop running unsupervised on routine work.
Keep context lean: under usage-based billing, every file or log in your conversation is re-billed on subsequent turns. Pasting an entire VCF header when you only need column names wastes credits on every follow-up exchange. Start fresh sessions when switching tasks.
Ask targeted questions: “Why is REGENIE step 2 returning NA p-values on chr6?” consumes far fewer tokens — and usually gets a sharper fix — than “Review my entire pipeline.”
Track your burn rate: check GitHub Settings → Billing → Copilot (or your provider’s usage dashboard) after your first few agentic sessions to calibrate.
Tips and caveats
Where AI agents are reliably strong:
Writing syntactically clean R, Python, and bash
Translating a clearly specified statistical method into working code
Refactoring tangled scripts into clean, modular functions
Interpreting error messages and proposing fixes
Where they still fall short:
Choosing the right statistical method for your study design — they will happily code whatever you ask for, right or wrong
Knowing your cluster’s quirks without explicit instructions in a context file
Evaluating scientific validity — a spotless Manhattan plot can still be a batch artifact
How to verify AI-generated statistical code:
Read every line. A flipped sign, dropped covariate, or off-by-one filter can fail silently.
Run a pilot on a small subset (e.g., chromosome 22) before launching a 22-chromosome array job.
Benchmark against known results or a prior pipeline version whenever possible.
Sanity-check distributions — test statistics, p-values, and effect sizes should land in plausible ranges.
Avoid locking yourself into a single provider. AI coding tools move faster than almost any other area of software engineering; today’s frontrunner can easily be third-best in six months. Anchor your workflow to the interface — VS Code, a clear context file, and the Explore → Plan → Implement → Commit loop — rather than to one model. Copilot’s Auto mode helps by routing across Anthropic, OpenAI, Google, and others without manual tracking. Outside Copilot, set aside an afternoon every few months to test a new model on a real analysis you know well so your mental map stays current.
AI agents do not replace statistical genetics expertise — they amplify it, clearing away the mechanical friction of coding so you can spend more of your time on the science.
I study how genetic variation shapes cardiometabolic traits, particularly blood lipids, through GWAS, rare-variant analyses, and Bayesian methods for assessing replication. I contribute to TOPMed and the Global Lipids Genetics Consortium.
Background
Aug. 2026–present — Postdoctoral Fellow at Amgen, working with Pradeep Natarajan.