Bootcamp / Session 2 / 2.4
Session 2.4 · Hands-on · Bioinformatics Core
You get one real RNA-Seq count table and one chat with Claude, and you do everything by talking to it. You never write code, and nobody hands you a prompt. You write every request yourself, Claude writes and runs the code, and you check every answer, ask follow-up questions, and push back when something looks off. That conversation is the skill this part teaches. By the end you will have built a metadata table from sample names, made five of Tommy's six plots, and watched multiple testing correction happen to your own p-values.
The introduction to the exercise and the closing. The work time itself is not in the video.
The data come from Vernia et al., 2014, Cell Metabolism, a collaboration between the Davis and Garber labs here at UMass Chan. JNK is a stress signaling kinase that switches on when mice eat a high-fat diet, and it helps drive obesity and insulin resistance. The authors removed JNK from liver cells and asked what the liver does without it. Their answer: liver JNK holds back the nuclear receptor PPARα. Without JNK, PPARα target genes that burn fatty acids and make ketone bodies go up, and so does FGF21, a hormone the liver releases into the blood. FGF21 turns out to carry much of the metabolic benefit of losing liver JNK.
The table you will use holds liver RNA-Seq counts from that work: four genotypes, each on a normal chow diet and on a high-fat diet (hfd), with three mice per group. wt is the control. ALAB, J1c, and J2c are the lab's own labels for the JNK-deficient livers, and the paper describes the exact alleles. We will come back to this same dataset in Session 4 for a proper differential expression analysis.
| Diet | wt | ALAB | J1c | J2c |
|---|---|---|---|---|
| chow | 3 mice | 3 mice | 3 mice | 3 mice |
| hfd | 3 mice | 3 mice | 3 mice | 3 mice |
If you have not set up yet, do 2.0 Get set up first. It shows the places you can work (Claude in the browser, the Claude desktop app, Claude Science, ChatGPT or Codex, and VS Code) and how to set up each one. Whichever you pick, do this whole exercise in one conversation, so the assistant remembers the data and every step you have taken.
This page says “Claude” throughout. If you use ChatGPT or Codex, read it as your assistant: the tasks, hints, and checkpoints stay the same.
Your first message sets the ground rules for the rest of the conversation, the same way you would brief a new lab member.
Write your first message. Tell Claude who you are and how you want it to work for the rest of the chat. Make sure it covers:
I am a biologist learning to analyze RNA-Seq data, and I do not write code. For this whole conversation: - write and run the code yourself (Python is fine) and show me the results and plots - explain each step in plain language in a few sentences - do not show me code unless I ask for it - if you have to make an assumption or a choice, tell me what you chose and why - if something looks wrong in the data, stop and tell me Reply with OK and wait for my first task.
The table is one tab-separated file, about 16 MB: genes_expression_expected_count.tsv. Your first task prompt gives Claude its web address. If Claude says it cannot reach the address, download the file with that link, attach it to the chat with the paperclip, and tell Claude “use the file I attached instead”.
Every task below has the same shape: ask (write your own prompt from the task description; open the hint only after you have tried), check (compare with the green checkpoint), then keep talking (follow up on at least one of the suggestions in the dashed box under each checkpoint, or on your own idea). If your numbers differ from the checkpoint, do not move on. Ask Claude why they differ. Getting to the bottom of that is the most useful thing you will practice today.
A good prompt names the data, says exactly what to do (including any thresholds), and says what you want back: a plot, a number, a table, or a file. Vague prompts get vague answers, and different numbers from your neighbor’s.
Claude can be confidently wrong, especially about biology and papers. When it tells you a fact, ask how it knows, and check anything that matters.
Ask Claude to load the table from https://biocore.umassmed.edu/data/session2/genes_expression_expected_count.tsv and describe it, without analyzing anything yet. Ask for:
Load this tab-separated RNA-Seq count table with Python and pandas: https://biocore.umassmed.edu/data/session2/genes_expression_expected_count.tsv Do not analyze anything yet. Tell me: 1. how many rows and columns it has, and the column names 2. what one row represents, and whether the gene names are unique 3. what kind of numbers the sample columns hold 4. how many rows are zero in every sample
Checkpoint 77,922 rows and 26 columns: gene, transcript, and 24 sample columns. Gene names are unique, so one row is one gene. The values are expected counts (numbers of reads, some with decimals). 40,181 genes are zero in every sample.
The sample names hold the whole experimental design, for example hfd.J1c.rep2. Pull it out into a table you can group, color, and test by.
The 24 sample names follow the pattern diet.genotype.replicate. Ask Claude to turn them into a metadata table. Ask for:
hfd_J1c)metadata.tsv for you to downloadThe 24 sample column names follow the pattern diet.genotype.replicate. Build a metadata table with one row per sample and the columns: sample, diet, genotype, replicate, and group (diet and genotype joined, like hfd_J1c). Show me the table, then a cross-tabulation of diet against genotype, and save it as metadata.tsv so I can download it.
Checkpoint 24 rows. Two diets (chow, hfd) by four genotypes (wt, ALAB, J1c, J2c), with exactly 3 samples in every cell. Eight groups.
metadata.tsv in Excel.Ask Claude to clean and normalize the counts, and to show you how deeply each sample was sequenced. Your prompt should ask it to:
1. Drop genes that are zero in every sample. 2. Make a barplot of the total counts per sample (library size), colored by diet. 3. Keep genes with at least 10 counts in at least 3 samples. 4. Normalize to counts per million (CPM) using each sample's library size, then take log2(CPM + 1). Call this the log table and use it from now on. Tell me the library size range and how many genes you kept.
Checkpoint Library sizes run from about 7.4 to 24.1 million reads, so some samples were sequenced three times deeper than others. 15,974 genes pass the filter.
Ask Claude to show you why count data needs a log. Ask for:
For the first sample, using the genes left after step 1 of the last prompt (zero-in-every-sample removed, but before the 10-count filter), draw two histograms side by side: the raw counts, and log2(count + 1). What fraction of genes are zero in that sample, and which gene has the highest count?
Checkpoint The raw histogram is one tall bar at zero and nothing else visible. The log histogram shows a real shape. About 40% of those genes are zero in this sample. The top gene is Alb (albumin), with over 800,000 counts, which is what you expect from liver.
Ask Claude to compare the distributions of all 24 samples in the log table. Ask for:
Using the log table, draw a violin plot with a boxplot inside, one per sample, filled by diet, with samples grouped by genotype. Report the lowest and highest per-sample median.
Checkpoint 24 violins of nearly the same shape. Per-sample medians fall between about 3.0 and 3.5 log2(CPM + 1). No sample stands out as broken.
Ask Claude for three scatter plots from the log table:
chow.wt.rep1 against chow.wt.rep2, with a y = x line and the Pearson correlationUsing the log table: 1. Scatter chow.wt.rep1 against chow.wt.rep2, with a y = x line. Report the Pearson correlation. 2. Average the three replicates of each group. Scatter chow_wt (x) against hfd_wt (y), with a y = x line. First draw it with solid points, then again with transparent points. 3. Label the 10 genes farthest from the diagonal, and tell me which went up on hfd and which went down.
Checkpoint Replicates hug the diagonal (r about 0.991). Diet spreads points off it (group means r about 0.983). Among the farthest genes: Cyp2b9, Lcn2, and Serpina7 go up on hfd, while Moxd1, Cyp3a11, and Cyp4a12b go down.
Ask Claude to show you Fgf21, the gene at the center of the paper. Ask for:
Plot Fgf21 in the log table for all 24 samples: one column per group, every sample drawn as a dot, with a boxplot behind the dots. Order the groups chow_wt, chow_ALAB, chow_J1c, chow_J2c, then the same for hfd. Which groups stand out?
Checkpoint On chow every group sits near 2.5 to 3.2. On hfd, hfd_ALAB jumps to about 5.2 and hfd_J2c to about 4.3, while hfd_wt stays near 3.2.
Ask Claude which factor drives the biggest differences between samples. Using the 500 most variable genes in the log table, ask for:
Using the 500 most variable genes in the log table: 1. Compute the sample-to-sample Pearson correlation and draw it as a clustered heatmap, with diet and genotype as colored annotation bars. 2. Run PCA (center the genes, no scaling). Plot PC1 against PC2, color by diet, shape by genotype, and put the percent variance on each axis. Which factor separates the samples on PC1, and which on PC2?
Checkpoint In the heatmap, samples mostly group by diet. How cleanly depends on the clustering method: with some settings the two diets split perfectly, with others a less typical sample such as hfd.ALAB.rep3 sits on a branch of its own. PC1 explains about 29% of the variance and separates diet. PC2 (about 16.5%) pulls ALAB away from wt, with J1c and J2c in between.
Your tree looks different from your neighbor's? Ask Claude which distance and linkage it used, then try another. A dendrogram is one method's answer, not a fact about the data. PCA does not depend on that choice.
A chat is not a record. Before you close it, make sure you leave with more than a scrollback of plots. As Eric put it in 2.3: ask for the script, not the answer.
Before you close the chat, ask Claude for everything you would need to redo or report this analysis:
We are done for today. Please give me: 1. one Python script, as a downloadable file, that redoes every step we did from the original data address, with a short comment above each step 2. a methods paragraph I could adapt for a paper, naming each filter and threshold we used 3. a list of every figure we made, with one sentence on what each one shows 4. anything you assumed or chose on my behalf during this conversation 5. a one-page report as an artifact, with the key figures, the methods paragraph, and three findings in plain language, so I can publish it and share the link
On claude.ai: ask for the report “as an artifact”. It opens in a panel next to the chat. Use its Publish button to get a link you can send to your PI or paste into your lab notes. Anyone with the link can see it, so publish only what you are allowed to share.
On Codex: ask it to write the report as an HTML or Markdown file in your project and tell you the file name. If your Codex is connected to GitHub, ask it to open a pull request instead, and share that link.
Checkpoint You can download a script, and the methods paragraph names the filter (at least 10 counts in at least 3 samples), log2(CPM + 1), and the 500 most variable genes for the heatmap and PCA. If a number in it disagrees with what you saw earlier, ask Claude which one is right.
Done early? This one ties straight back to 2.1. It uses a plain t-test on purpose, to show why RNA-Seq needs better tools. Afterwards, ask for the step 9 wrap-up again so your script and methods include it.
Ask Claude to test every gene in the log table with a Welch t-test of hfd_wt against chow_wt (3 against 3). Then ask it to:
For every gene in the log table, run a Welch t-test of hfd_wt against chow_wt (3 against 3). 1. How many genes have p < 0.05? How many would you expect by chance alone? 2. Draw a histogram of all the p-values with bins 0.05 wide. 3. Adjust with Benjamini-Hochberg. How many genes have adjusted p < 0.05? 4. Now shuffle each gene's six values at random between the two groups, so there is no real difference left, and repeat steps 1 to 3 on the shuffled data. 5. Finish with a volcano plot of the real test: log2 fold change against -log10(p).
Checkpoint About 16,000 genes tested and 2,722 with p < 0.05, far more than the roughly 800 chance alone would give. The histogram has a spike near zero. After Benjamini-Hochberg: zero genes. The shuffled data give about 600 genes with p < 0.05 (about 4%), a flat histogram, and zero after correction.
Two minutes: whether you made it, how far you got in the hands-on, and what to change. We ask this after every session.