Hot answers tagged

7 votes
Accepted

Using Seurat to compare mutant vs.wt

Single-cell analysis to compare samples is a long a difficult process. There is very good documentation for 10x Genomics cellranger, the DropSeq Pipeline and the Seurat R package. These tools all have ...
user avatar
  • 873
6 votes
Accepted

Resolution parameter in Seurat's FindClusters function for larger cell numbers

Assuming you have an informative selection of variable genes from which you have constructed a number of useful PCs, I'd run a number of iterations with ...
user avatar
  • 2,564
6 votes
Accepted

Subset on multiple genes in Seurat

I was able to achieve this in the following way: ...
user avatar
5 votes
Accepted

Which are the use cases for the methods for DE in Seurat

You can take a look at the recently published article: Bias, robustness and scalability in single-cell differential expression analysis. We evaluated 36 approaches using experimental and synthetic ...
user avatar
  • 1,002
5 votes
Accepted

Mapping a list of cells in seurat featureplot

To color the TSNEPlot, you can generate a new column in metadata with the expression levels (High, low, etc). Then use pt.shape to set a shape for each identity. To show binary expression based on ...
user avatar
5 votes

How to set the position of groups in a Seurat object on a FeatureHeatmap plot

I don't think this is possible in Seurat v2, but in v3 you can change the factor levels of the grouping variable to change the plot order: ...
user avatar
  • 674
5 votes
Accepted

How can I obtain the percentage gene expression per identity class in Seurat as further processible numbers (e.g. matrix)?

This can be solved like this: ...
user avatar
  • 487
5 votes
Accepted

The biological meaning of the random variables and the responses in Seurat analysis

In the linked article the authors formalize microarray analysis as the study of the joint distributions of $\overrightarrow{X}_i$ and $Y_i$, where $\overrightarrow{X}_i$ is a vector of random ...
user avatar
  • 3,201
5 votes

Merging two dataframes in R

For merging dataframes, I find it easiest to use the tidyverse / dplyr functions inner/full/left/right_join. See the "Data Transformation Cheatsheet" on this page. For the merge that @...
user avatar
  • 11.5k
4 votes

Is it possible to identify cells that are expressing two or more genes in Seurat?

The counts stored in the Seurat object are: raw counts (seuratobject@raw.data), the log + normalized counts (seuratobject@data), and the scaled counts (seuratobject@scale.data). ...
user avatar
  • 2,564
4 votes
Accepted

Violinplot of gene expression

You want to (1) see the mean for each gene, and also to (2) calculate a ratio of expression levels of two genes, then compare it between clusters. (1) First, notice that ...
user avatar
  • 2,564
4 votes
Accepted

Seurat with normalized count matrix?

This was addressed by the Seurat developers here: if you have TPM counts, I suggest you don't use Seurat::NormalizeData(), since TPM counts are already normalized for sequencing depth and ...
user avatar
  • 2,099
4 votes
Accepted

Percentage distribution of cells in all clusters based on their treatment condition?

Here is a solution using dplyr and ggplot2: ...
user avatar
  • 674
4 votes

Is it important to filter out poor quality cells before performing an integration analysis on single cell RNA sequencing data?

It is absolutely necessary to remove low quality cells: In the case of CCA (and this applies to other "integration" or "data alignment" methods as well), one would ...
user avatar
  • 3,472
4 votes

Violin plots appear as vertical lines

I believe the reason is simply LTA and LTB not being expressed (or their expression not being detected due to technical limitations). If you would set the pt.size ...
user avatar
  • 3,472
3 votes

Seurat Merged objects tSNE - How to paint on original IDs?

Below a few lines of code that accompany BC Wang's answer. After using MergeSeurat the sample name will be added to meta data under orig.ident. this can then be used to color the tSNE either using ...
user avatar
3 votes

How I can test my hypothesises computationally

This is what packages like FateID and Monocle are for, namely taking single-cell RNAseq data and inferring differentiation trajectories from it. Don't try to reinvent the wheel on this, there are a ...
user avatar
  • 19.3k
3 votes
Accepted

How I can reproduce this heat map

In case it is still helpful as the post is rather old, the code below would generate a heatmap with annotations thanks to the ComplexHeatmap package. But before ...
user avatar
  • 3,472
3 votes
Accepted

FeaturePlot from Seurat: change its title

I tried with some data that I have and this is working for me: ...
user avatar
  • 1,002
3 votes
Accepted

Output of Seurat FindAllMarkers parameters

pct.1– The percentage of cells where the gene is detected in the first group p_val_adj– Adjusted p-value, based on bonferroni ...
user avatar
  • 1,119
3 votes

Resolution parameter in Seurat's FindClusters function for larger cell numbers

That is a very general recommendation. Depending on your experiment, you can get a very different number of clusters with the same number of cells at the same resolution. You can actually use a ...
user avatar
  • 2,099
3 votes
Accepted

Manually define clusters in Seurat and determine marker genes

I think you are looking to FindAllMarkers function from Seurat. As you said, you just have to define your ...
user avatar
  • 1,002
3 votes
Accepted

about dotplot legend meaning

The expression values for each gene are scaled / standardized by subtracting the genes mean expression and dividing by its standard deviation. A value of -1 would imply it's one standard deviation ...
user avatar
  • 727
3 votes
Accepted

Using external list of PCs for clustering

There is a way to do this, and even better--there is documentation for how to do it! No surprise coming from the Satija Lab. In the vignette they perform multidimensional scaling, but the idea is the ...
user avatar
  • 1,119
3 votes

Changing a wide range of colours to a limited gradient

TSNEPlot() TSNEPlot() will always treat your variables as discrete. My approach is to manually generate a gradient with unique colors for each factor level and ...
user avatar
  • 1,119
3 votes
Accepted

Changing a wide range of colours to a limited gradient

If you would like to color discrete intervals on a gradient as opposed to having a continuous gradient (like your second plot), use this approach. It is similar to the approach in the answer I ...
user avatar
  • 1,119
3 votes

How can I obtain the percentage gene expression per identity class in Seurat as further processible numbers (e.g. matrix)?

You can get the table that is used to make the dot plot if you modify the DotPlot function to return it instead of the ggplot, and use the argument do.return=T. To edit the function, the command is: ...
user avatar
3 votes
Accepted

Understanding PCHeatmap outputs

The PCHeatmap function (renamed DimHeatmap in Seurat v3) can be used to help determine the number of principal components to use ...
user avatar
  • 674
3 votes
Accepted

Storing FindAllMarkers results in Seurat object

You can stash anything you like in the misc slot (present in both v2 and v3 Seurat objects). I often use it for storing marker information to help with organization....
user avatar
  • 674
3 votes
Accepted

Why is 42 the seed used in RunPCA() in Seurat?

Given that it is virtually impossible for a human to predict what random numbers will be generated given a certain seed, and what effects they will have for a given application, the choice of the seed ...
user avatar
  • 2,930

Only top scored, non community-wiki answers of a minimum length are eligible