Introduction to scRNA-seq data analysis
NOTE: New version of this lecture is available at βββ In this lecture you will β¦ source

seen from Maldives
seen from Germany

seen from United Kingdom

seen from Maldives
seen from United States

seen from Germany
seen from United States

seen from Maldives
seen from United Kingdom
seen from Switzerland
seen from United States
seen from United States

seen from United States
seen from United Kingdom
seen from China
seen from United Kingdom

seen from United Kingdom
seen from United States
seen from Maldives
seen from United States
Introduction to scRNA-seq data analysis
NOTE: New version of this lecture is available at βββ In this lecture you will β¦ source

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch β’ No registration required β’ HD streaming
Advanced Topics in scRNA-Seq (Module #5)
The accompanying materials are available here: 00:00β Recap of cluster β¦ source
Learning Scanpy...
[Citations under the read more]
Scanpy is one of the first packages I installed. It was mentioned by my Research Supervisor (RS) and some other reference material I have read that I haven't posted to this blog yet. But Scanpy is used extensively in the bioinfo/comp bio world to create graphs and organize data. My primary goal is to go through Scanpy's tutorials with their default dataset and then analyze the dataset from a paper that one of my colleagues presented to us two Thursdays ago (7/11) (I didn't realize it was 7/11 and I didn't get a free slurpee...). Below is the link to the official Scanpy website's tutorials page. I will post a reference post with this same link, but for convenience I will also post it here:
Basic workflows: Basics- Preprocessing and clustering, Preprocessing and clustering 3k PBMCs (legacy workflow), Integrating data using inges
Preprocessing and Clustering...
Copying and pasting the code included with this section of the tutorial and running it grants me these results, which match the tutorial:
I don't completely understand how it pulled the database it's using, but I'll figure it out once I complete the tutorial.
Quality Control...
Copying and pasting the code included with this section of the tutorial and running it grants me these results, which match the tutorial:
I wanted to play around with the values a bit and see what happened to how the data was displayed. If I change the jitter value in the block of code that creates the violin plots:
to 0.9, this is what my results were:
As expected, it spread out the values a little more. Cool! Ok changing it back.
Doublet Detection and Normalization...
This is where I encountered some problems. In order to detect doublets, scanpy uses the detection method scrublet, which is awesome sauce, but the command was not working for me.
I kept getting an error from the scanpy files in charge of scrublet. I thought maybe I was missing something from the package, since it said skimage is missing, so I reinstalled scanpy but nothing changed. On the tutorials page there's a note that talks about alternative methods for doublet detection, so if I don't find a solution I can resort to installing one of those. But, I'm going to see if anyone's posted about this issue.
Someone on stack overflow suggested to install scikit-image to fix it, so I did and it worked! skimage does sound like it comes from the scikit-image package. I thought it wouldn't work because the console was taking a while to process like it does when it's gonna give me an error, but nope!
No error and it even went ahead and did the normalization no problem. Awesome sauce!
Feature Selection...
Got the same graphs as the tutorial, which means I'm on track. The tutorial says that this function:
annotates the genes by reproducing implementations of the specific methods depending on a chosen flavor. I'm not really sure what that flavor is or how I can pick it. I see a number value though so I'm gonna change it. Here's the graphs when I run this command with n_top_genes set to 5000.
Hmm... It didn't change anything, which is a shame. The program takes a lot of time processing the doublets so each time I execute the script again it takes a few minutes, which is not good for me because I love getting distracted while it's processing.
I'm changing the value back to 2000 and moving on, but definitely something to come back to and investigate.
Dimensionality Reduction...
Also got the same results as the tutorial, though my first graph displayed a little wider than the tutorial's graph. The first graph "gives us information about how many PCs [Principal Components] we should consider in order to compute the neighborhood relations of cells, e.g. used in the clustering function leiden() or tsne()."[1] It's better to overestimate than underestimate how many PCs. The second graph plots these PCs to "see if there are any potentially undesired features (e.g. batch, QC metrics) driving signifigant variation in this dataset."[1] According to the tutorial, nothing stands out as "too alarming", but the check was a good idea just in case there is anything that skews the data.
Nearest Neighbor Graph Construction and Visualization...
The only way for me to see the legend on the left side was if I stretched it out a bunch like this.
On the left is the output from the tutorial website, on the right is my output if I don't stretch it out. It's upside down? Each individual clump is pretty intact, but they're rotated different ways and in different positions than the tutorial reference image. I'm not sure what I did wrong, since I am just copying and pasting the code from the tutorial right now. I'm going to play around with it and see if I can fix anything later.
Clustering...
At first my console gave me an error but when I ran it again it worked just fine, so I'm not exactly sure what happened. But it looks like the tutorial sample image, aside from the clusters being in their new spots as shown by my previous figure. I also figured out how to fix how the graph looks, but I have to manually fix it each time. I'm planning to try to find out what can fix this, or at least what can set my defaults.
Re-assess quality control and cell filtering...
Same thing as above, seems to work just fine other than the fact that the clusters are in a different place from the tutorial examples.
Preparing the GitHub Repository...
Last week I prepared my GitHub for the python code I will be preparing. I created a new repository and relearned how to push things into it using git. I had done it before for one of my computer engineering design courses but that was in May and it's been a little while. I thought I already wrote myself a .txt little guide but I didn't so I wrote a new one.
(I like to write myself little guides like this so I can easily refer back to them. I did the same thing with quickly creating React Native apps back when that was something I was doing frequently.)
I forgot how to pull repositories from GitHub but that's nothing a quick online search can't remedy when I get to it.
The repository is currently private, mostly because I assume I will be working with unreleased data that I shouldn't release online like that, but I might clone the repo with only my attempts using public datasets to release publicly.
I also learned how to create a virtual environment, which I haven't really needed to do before, but my Research Supervisor (RS) suggested I do it so that my analysis attempts won't conflict with each other.
Next step is to install and get familiar with the python packages I will be using.