RNA-seq Bioinformatics

Introduction to bioinformatics for RNA sequence analysis

Differential Expression AI Exercise


RNA-seq_Flowchart4


DE Analysis. AI exercise

In this tutorial you will:

Complete a Google form as you go through this exercise

We will use a google form to capture basic information about AI tool choice (and model version), AI prompts used, etc. Refer to the course slack channel for a link to this form.

Outline of the exercise

For this exercise I want you to imagine that you did not have the previous section as a guide on how to perform a differential expression analysis in R. Imagine that you obtained the gene counts matrix “gene_read_counts_table_all_final.tsv” from your sequencing core, a collaborator, or a public source. See if you can complete a DE analysis like the one you just completed step-by-step but using an AI assistant. Here is an overview of the basic steps (more details on each below):

  1. Locate the input data and define a location for results
  2. Choose an AI tool and make note of the model used (record your choice in the Google form)
  3. Develop your initial prompt to the AI (record your prompt in the Google form)
  4. With help from the AI create a differential expression analysis in R and run it.
  5. Answer a few specific questions and produce a visualization for comparison of results to your colleagues.

1. Input data and output location

For the exercise use the following:

Hint. To quickly see what the input data looks like, you can do the following to display the first two lines of each:

head(read.delim("/cloud/project/data/bulk_rna/gene_read_counts_table_all_final.tsv"), n=2)
head(read.delim(gzfile("/cloud/project/data/bulk_rna/ENSG_ID2Name.txt.gz")), n=2)

2. Choice of AI tool

There are several broad approaches to using AI for bioinformatics analysis, and your choice of tool will shape how the interaction unfolds. The main paradigms are:

Note that given the cloud-based RStudio environment used in this course, the conversational assistant approach is the most practical. Using this approach you can work in a browser tab alongside your RStudio session with no additional setup. The IDE-integrated approach is possible but would require downloading the input data files to your laptop. Locally-run models are beyond the scope of this exercise.

For this exercise, use whichever AI tool you are comfortable with, or take the opportunity to try one you have heard about but not used before, or simply pick one from the list below. A few commonly used options across these categories:

Tool Type Provider
ChatGPT Conversational OpenAI
Claude Conversational Anthropic
Gemini Conversational Google
Microsoft Copilot Conversational Microsoft
GitHub Copilot IDE-integrated Microsoft/GitHub
Cursor IDE-integrated Cursor
Ollama Local models Open source

Make note of both the tool and the specific model version you use (e.g. GPT-4o, Claude Sonnet 3.7, Gemini 2.0 Flash). Model versions vary significantly in capability and the field moves quickly. Record your choice in the Google form.

3. Develop initial prompt

Before starting, take a few minutes to think about what you will tell the AI. A well-constructed prompt is likely to produce more useful code than a vague one, and the differences across students will make for a rich comparison later. You do not need to craft a perfect prompt! Part of the point of this exercise is to see what happens with different approaches.

As you draft your prompt, consider what information the AI would need to produce useful, runnable code. Some dimensions to think about (without being told exactly what to include):

Write your initial prompt, then record it in the Google form before sending it to the AI. You may refine it through the conversation.

4. Complete the differential expression analysis

Enter your prompt into the AI tool of your choice and examine the response carefully before running anything. Consider:

Iterate with the AI as needed. When you are satisfied, copy the code into your Posit cloud environment and execute it line by line. At each step, inspect the output and try to understand what the code is doing before moving on. If something fails or produces unexpected results, you may go back to the AI to debug.

Record your answers to the above questions, along with any significant follow-up prompts, in the Google form.

5. Evaluate the outcome

Before wrapping up, make sure your analysis produces results that address the following. These are the questions you will answer in the Google form and the basis for class discussion:

Record your answers in the Google form and save your volcano plot image to your results directory. Be prepared to share it for class discussion. The variation across students in both results and plot appearance will be part of what we examine together.

6. Further reading and exploration

The following resources are starting points for deepening your understanding of the concepts touched on in this exercise. This is a fast-moving area. Treat these as entry points rather than definitive answers.

Comparing and choosing AI tools

Prompt engineering

Critical evaluation and responsible use

AI tools for bioinformatics and data science