GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community. Already on GitHub? Sign in to your account. Hi, Background: We developed an RShiny web interface SeuratWizard for seurat v2 guided clustering workflow and I am currently trying to migrate it to v3.
For the subset function, is there a way to use a variable containing the subset name. Much like R's subset function, subset. Seurat is designed for interactive use only. While we currently don't offer a programmatic way to subset Seurat objects based on feature expression, this can be accomplished relatively easily using which and FetchData.
Skip to content. Dismiss Join GitHub today GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. Sign up. New issue. Jump to bottom. Copy link Quote reply. Appreciate the help. This comment has been minimized. Sign in to view. Yes this works well. Thanks for the explanation. This was referenced May 17, Subset within function not using local variable Whats the difference between "SubsetData" and "subset" function in Seurat v3 Subset Seurat object programmatic way GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community. Already on GitHub? Sign in to your account.
I am comparing two datasets, each of which contains data from about 5, cells. Every time I get to the IntegrateData stage, my R studio crashes.
I am working on a server with access to GB of memory.
This is the code, up to the point when the computer crashes. Seurat was run on our server with GB of memory. Thanks for writing - and we will look into this. This is certainly not an issue of memory, as we've integrated datasets of hundreds of thousands of cells with significantly less RAM. Would you be able to send the matrices or Seurat objects you are working with, so that we can debug on our end? This is very puzzling, I am having issues reproducing this error.
Thanks so much, I will try the datasets in your online vignette. Thank you again for your help. I'm getting the same error. Strange enough, I've integrated the same datasets before and it worked fine. The only thing that I changed is that I now used ScaleData on all genes within each object before I integrated the data, instead of only the most variable genes default.
Not sure if this could give a clue or if the issue has been resolved in the mean time. If so, it would be great to know how. Thanks in advance!
Seurat v3.0 Command List
I have the same problem. It will be really appreciated if you could help me out here! I also stumbled across this issue. It seemed to occur during the re-clustering of subsetted data that was already integrated using default params.
The error noting RowMergeMatrices seems to be memory related to me. Removing the integrated assay of each object prior to integration seemed to fix this issue. FindIntegrationAnchors did not complain anymore. Skip to content. Dismiss Join GitHub today GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. Sign up.T cells exhibit heterogeneous functional states in the tumor microenvironment.
Immune checkpoint inhibitors ICIs can reinvigorate only the stem cell-like progenitor exhausted T cells, which suggests that inhibiting the exhaustion progress will improve the efficacy of immunotherapy.
Thus, regulatory factors promoting T cell exhaustion could serve as potential targets for delaying the process and improving ICI efficacy.
Additionally, we identified differentially expressed genes as candidate factors regulating intra-tumoral T cell exhaustion. The loss-of-function effect of the candidate regulator was examined by a cell-based knockdown assay. The clinical effect of the candidate regulator was evaluated based on the overall survival and anti-PD-1 responses. TOX was the only transcription factor TF predicted in both tumor types.
Flow cytometry analysis revealed a correlation between TOX expression and severity of intra-tumoral T cell exhaustion. We predicted the regulatory factors involved in T cell exhaustion using single-cell transcriptome profiles of human TI lymphocytes.
T cell dysfunction has been reported to be a hallmark of cancers [ 1 ]. T cell exhaustion develops progressively during chronic antigen stimulation, which results in a heterogeneous population of exhausted T cells [ 2 ]. PD-1 expression is closely correlated with the severity of T cell exhaustion.
However, the role of these regulators in the direct regulation of the exhaustion program remains unclear. In this study, we demonstrate a strategy for predicting the genes involved in cellular differentiation based on single-cell transcriptome data analysis.
The single-cell transcriptome data of human melanoma and non-small cell lung cancer NSCLC samples were analyzed to systematically predict the regulatory factors involved in T cell exhaustion. This analysis identified that several genes such as thymocyte selection-associated high mobility group box gene TOX and immune checkpoint IC genes can regulate T cell exhaustion. These results suggest that TOX levels can be used for patient stratification during anti-cancer treatment, including immunotherapy, and that TOX can be targeted in the background of immune checkpoint inhibitor ICI therapy.
Cells with fewer than detected genes defined by at least 1 mapped read or exhibiting an average housekeeping expression level as defined above of less than 3 were excluded.
The read count data from NSCLC samples were normalized by scran [ 8 ] method and centered by patient. We used the normalized expression data as provided by the original studies for both scRNA-seq datasets. The difference was considered statistically significant when the P value was less than 0. We further filtered out candidate genes with the mean of normalized expression value lower than a threshold 1 for melanoma and 2 for NSCLC in both subsets.
To visualize the relationship among individual cells based on high-dimensional gene expression data, we used t-stochastic neighbor embedding tSNE [ 9 ], which is one of the most popular methods for dimension reduction. We conducted the tSNE analysis using the Seurat v3 R package with the following parameters: perplexity, 30; number of iterations, We projected the individual cells on the first two tSNE dimensions.
Additionally, we used the violin plots to present the density distribution of cells with specific gene expression levels in the PDCD1 -low and PDCD1 -high subsets. We defined the three T cell states of stable endpoint based on the expression of three marker genes [ 11 — 13 ]. The expression dynamics along the trajectories were visualized using the BEAM analysis tools in the Monocle 2 software.
The significance of upregulated expression in the exhausted T cells or memory T cells relative to the effector T cells was tested by one-tailed Mann-Whitney U test.
For the flow cytometric analysis of immune cells, fresh tumor specimens were provided by the Department of Internal Medicine at the Severance Hospital, along with permission to conduct the following study. The patients were administered nivolumab or pembrolizumab. The tumor samples were obtained from patients before immunotherapy. Of the 16 tumor samples, 11 were fresh samples and 5 were formalin-fixed paraffin-embedded FFPE samples.
The transcripts were quantified using featureCounts [ 17 ].GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community. Already on GitHub?Learning Structural Node Embeddings via Diffusion Wavelets
Sign in to your account. Dear Seurat team, Thanks for the last version of Seurat, I started using Seurat v3 two weeks ago and I'm having some problems with the subsetting and reclustering. For the first clustering, that works pretty well, I'm using the tutorial of "Integrating stimulated vs.
But my problem start with the subsetting and reclustering, I don't know how to properly calculate the genes to be use in the reclustering. Score", "G2M.
After run that scrip, I have the following error, but the code continue running. Error: Cannot add a different number of cells than already present. After run normalization and findvariablefeatures, I have the following error and warning. We do not support the identification of variable features on integrated data. If you want to subset and recluster using a new set of variable genes, you need to switch the assay of the subsetted to the 'RNA' assay.
Thanks, can you give an example how properly do it? I have a sample that have multiples cell types, such as, epithelial cells, immune cells and endothelial cells. What I want to do, is subset and re-cluster just the immune cells. So is it not recommended to subset off of an integrated object and then re-run FindVariableFeatures?
Instead, is it recommended to run clustering, subset the cells of interest, and then run integration off the subsetted object? Just want to be sure I understand what was stated above. Yes, although is still matter of debate, after integration you can subset and re-cluster, alternatively, you can merge your samples and run default clustering, then subset a group of cells of interest and run integration, I prefer the second strategy, it works better.Seurat was originally developed as a clustering tool for scRNA-seq data, however in the last few years the focus of the package has become less specific and at the moment Seurat is a popular R package that can perform QC, analysis, and exploration of scRNA-seq data, i.
For smaller dataset a good alternative will be SC3. Note In this chapter we use an exact copy of this tutorial. There are 2, single cells that were sequenced on the Illumina NextSeq The raw data can be found here. We start by reading in the data. The steps below encompass the standard pre-processing workflow for scRNA-seq data in Seurat. These represent the creation of a Seurat object, the selection and filtration of cells based on QC metrics, data normalization and scaling, and the detection of highly variable genes.
While the CreateSeuratObject imposes a basic minimum gene-cutoff, you may want to filter out cells at this stage based on technical or biological parameters. Seurat allows you to easily explore QC metrics and filter cells based on any user-defined criteria.
In the example below, we visualize gene and molecule counts, plot their relationship, and exclude cells with a clear outlier number of genes detected as potential multiplets. Of course this is not a guaranteed method to exclude cell doublets, but we include this as an example of filtering user-defined outlier cells. We also filter cells based on the percentage of mitochondrial genes present. After removing unwanted cells from the dataset, the next step is to normalize the data.
Seurat calculates highly variable genes and focuses on these for downstream analysis. FindVariableGenes calculates the average expression and dispersion for each gene, places these genes into bins, and then calculates a z-score for dispersion within each bin. This helps control for the relationship between variability and average expression.
This function is unchanged from Macosko et al. We suggest that users set these parameters to mark visual outliers on the dispersion plot, but the exact parameter settings may vary based on the data type, heterogeneity in the sample, and normalization strategy. To view the output of the FindVariableFeatures output we use this function. The genes appear not to be stored in the object, but can be accessed this way. This could include not only technical noise, but batch effects, or even biological sources of variation cell cycle stage.
As suggested in Buettner et al, NBT,regressing these signals out of the analysis can improve downstream dimensionality reduction and clustering. To mitigate the effect of these signals, Seurat constructs linear models to predict gene expression based on user-defined variables. The scaled z-scored residuals of these models are stored in the scale.In this case, you would not run ScaleData after integration, as the corrected residuals would already be placed in the scale.
This is not currently implemented in the public version of v3, but will be soon.
Set up ctrl object
Update: there is now a SCTransform Integration vignette available. I don't fully understand why one couldn't do the integration on the Pearson residuals; with the recent release they're being returned as "corrected counts", I believeso I'd assume one could use them in the recommended way?
R LL I had the same concern, but haven't had time to look into it in more depth to see what I am missing.
At this point, I am assuming the "official" protocol will be posted at any moment. Just to clarify, my samples are all from the same batch, but the vignettes you point to are still applicable, particularly the one you provided here Igor. It seems to me that whilst it's possible to use SCTransform in this context, it's not currently obvious or intuitive how to do it - for example the question of whether or not to run ScaleData following integration.
I think I'll just use the three functions individually for now, until the developers have completed their vignette on combining sctransform with Seurat v3 integration. Why do you think you need the integration step? If there's no obvious batch effect, I would just run SCTransform and call it a day. What I'm really interested in is being able produce various plots which are either grouped or split by sample, and I was following the steps in that tutorial because it seemed to show how to do that.
However in their case their two samples are from different batches, hence the separation of the NormalizeData, FindVariableFeatures and ScaleData steps. In my case, I think all I need to do is use the AddMetaData function to label cells differently on the whole dataset, then I can as you say just apply SCTransform to the whole thing.
Only top voted, non community-wiki answers of a minimum length are eligible. Home Questions Tags Users Unanswered. Tag Info users hot new synonyms. Hot answers tagged seurat day week month year all. Using Seurat to compare mutant vs.
Single-cell analysis to compare samples is a long a difficult process. These tools all have GitHub repositories and the authors are very responsive if you encounter issues. Depending on the technology used to generate the data, you'll need to use Tom Kelly 4 4 silver badges 18 18 bronze badges. Mapping a list of cells in seurat featureplot.
Then use pt. To show binary expression based on expression you first have to define the list of cells that are below or over your threshold. Once you have those lists you can use SetIdent in Seurat to color Mack 2 2 silver badges 5 5 bronze badges. 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 data and found considerable differences in the number and characteristics of the genes that are called differentially expressed.
Prefiltering of lowly expressed 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 FindClusters as described in the other answer, then choose a level which overclusters the dataset for example, clusters that are visibly separate on a t-SNE or other dimensionality reduction plot should Peter 2, 4 4 silver badges 23 23 bronze badges.
Subset on multiple genes in Seurat. I was able to achieve this in the following way: require data. Nikita Vlasenko 2, 8 8 silver badges 25 25 bronze badges. How to set the position of groups in a Seurat object on a FeatureHeatmap plot. TimStuart 1 1 silver badge 4 4 bronze badges. Seurat with normalized count matrix?