RNA-seq Bioinformatics

Introduction to bioinformatics for RNA sequence analysis

Differential Expression AI Integration


Single Cell DE Analysis AI exercise

The purpose of this exercise is to become more comfortable using AI tools to accelerate bioinformatics analysis. More importantly, this exercise will demonstrate the need for critical review and expert guidance when working with AI generated code. Always keep in mind that a generative AI cannot think but simply strings words together to match reference data (a lot of which is riddled with errors). However, thinking deeply and employing the right skills will allow an analysis to reap the benefits of AI while still protecting scientific integrity.

The goals of this exercise:

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

In the previous tutorial, we used DE analysis to compare the T cells from our ICBdT with respect to ICB. We saw that Cd4 is downregulated in the ICBdT condition, matching our expectations that the treatment would specifically deplete CD4 T cells. Now we are interested in understanding how our CD8 T cells change with treatment.

Instead of relying on the previous tutorial, we will have an AI assistant guide our analysis.

Step 1. Prompt the AI

Choose your AI assitant and give it an initial prompt. See the previous DE AI exercise for more information on choosing an AI assistant and crafting a prompt.

Glance through the code that the AI generated and decide if it makes sense. Consider:

Step 2. Explore the Generated Code

Copy the code into your posit environment, execute it line by line and inspect the results. Try to understand what each line of code is doing. It might be helpful to prompt the AI to give you the code without any comments so that you can write them yourself.

You might also want to:

At this time you might also need to fix your prompt to be more specific or ask the AI assistant to incorporate certain changes.

Fill out the google form with the results from your analysis so that we can compare with one another.

Step 3. Interrogate

Are you convinced that the DE genes you got are correct or biologically relevant? A quick literature search might make you more or less convinced.

In the form, write a sentence or two convincing yourself that the genes you found are biologically relevant. After this we will come together as a group and discuss our results and demonstrate how we might approach the same problem.

Step 4. Code Review

Perhaps the most useful way to make sure your code is correct and readable is to have someone else review it. Share your code with someone else, preferably through something like github.

Github Demo

If you want to try out github, create an account and then a repository. Download your script from posit and upload it to github. Share the link to your repo with your reviewer!

Setting Up a GitHub Repository (Step-by-Step)

1. Create a GitHub account

2. Create a new repository

3. Upload your script

3a. Set up a git repo in your posit

# 1. Generate an SSH key
ssh-keygen -t ed25519 -C "[GITHUB EMAIL]"

# 2. Copy the public key
cat ~/.ssh/id_ed25519.pub

# 3. Add it to GitHub → Settings → SSH and GPG Keys → New SSH Key
# paste the public key

# 5. Set your user email
git config --global user.email "evelyn_schmidt@icloud.com"

# 6. Initialize your posit repo as a git repo
git init

# 4. Set the GitHub repo you want to point to
git remote add origin git@github.com:evelyn-schmidt/test2.git
# 1. Pull the current files in github and
# See all the files in your current repo you can add 
git pull
git status

# 2. Add the script you just made
git add [SCRIPT name]

# 3. Create a commit and label it with a specific message
git commit -m "my ai-assisted analysis"

# 4. Push your commit to github
git push

4. Share the link

5. Optional: Add a collaborator for private repos

Step 5. Finishing Up

Make changes after review if needed and make sure there are plenty of comments on your code so that you can remember what you did later. If you are using github upload a final copy.

See the first AI exercise for more resources. ***