Seurat: FilterCells in Seurat3

Created on 9 Nov 2018  路  9Comments  路  Source: satijalab/seurat

Hello,

As was suggested in a previous question #920 , I'm running the Integration method using Seurat v3. I ran as described in the vignette. However, after looking more closely, there is no filter of cells that have high percentage of mitochondrial genes in the method.
I decided to go back and add that parameter so I could filter those cells. However, there is no FilterCells function anymore

KLF4WTeYFPpos <- FilterCells(object = KLF4WTeYFPpos, subset.names=c("percent.KLF4WTeYFPpos.mito","percent.KLF4WTeYFPpos.hemo"), low.thresholds = c(-Inf, -Inf), high.thresholds = c(0.10, 0.05))
Error in FilterCells(object = KLF4WTeYFPpos, subset.names = c("nFeature_RNA",  : 
  could not find function "FilterCells"

Is that by design? Or is there a new function to filter. Looking at the command list, it doesn't appear to have one. Should I use FetchData? If so, how can I set the low/high thresholds?

Thanks!

Gabe

Most helpful comment

I would like to put my vote in for their being only a single way for performing common tasks such as subsetting, e.g. a subset function OR FilterCells, not both. Having multiple ways of doing the same thing adds extra overhead for developers and confuses users who see the same thing done different ways in different places or who might not realise that functions with different names are effectively doing the same thing. In addition I think it is better to stick to standard R names/conventions for doing things when possible to make the transition easier for new users (although Seurat is probably in the fairly unique position of having more Seurat users than general R users). Moving from Seurat2 to Seurat3 is a major update and this is the right time to introduce breaking changes like this and I think users will expect to have to learn new functions. Providing documentation that makes it clear how tasks can be performed in Seurat2 vs Seurat3 would help the transition and I think the Seurat team are planning on doing that.

In short I think things will be easier and better in the long run if there is only one of subset and FilterCells (unless they are actually doing different things).

All 9 comments

Hi Gabe, FilterCells has been replaced by new subsetting functions in Seurat v3. Use the subset method to remove cells from the Seurat object.

For example:
subset(object, subset = percent.mito < 0.1 & percent.mito > 0.05)

You can see more examples at the command list, on the Seurat object interaction tab (https://satijalab.org/seurat/essential_commands.html).

Hi Gabe,

Hope that helps - let us know if that is a good solution, or if you think it would still be valuable to have a FilterCells command in v3 (we'd appreciate the feedback). While it would be redundant in some ways, if its helpful to users I'm not against including.

best,
Rahul

Hi Rahul and Tim,

Thank you for your answer. I think the subset command works just fine. I was running here and looks pretty easy and straight forward.

My suggestion would be to add that information in the current Vignette and paper. I didn't see anywhere mentioned that you removed cells that had high mito genes, and that might be the case that it was already previously checked/subset the data.

Thanks!

Gabe

Sorry, not my thing to decide, but my personal opinion on these (and other version changes and for other software packages) is that updates should be as painless as possible for the end users. It may take 10 minutes of engineering time to bring over the FilterCells function, but I'm sure that many users will appreciate efforts towards a seamless seurat2 -> seurat3 transition. There is no drawback to having a few functions too many, these only take up a few bytes but any seurat2 function missing in the new version will probably cost hundreds of (wo)man-hours if you add them up across the continents...

I'm with @maximilianh in this @satijalab. As I go through, I saw that there are actually several functions gone. I think there is two possible "solutions": 1- keep all the previous functions from seurat2 so it is very easy transition for people who are used to it by now (I'm a user since April and was pretty accustomed and familiar with the functions and would prefer this); or 2-make it extremely explicit on your tutorial/vignette. The current vignette is very bare bones regarding the whole process and getting the data analyzed on seurat v3. If you would like to remove those functions, I would suggest to make a comprehensive tutorial and make notes regarding the changes as you go along.

I'm super nervous about any update going on. I'm embarassed to admit it,
but my hands are sweaty when my mac updates the day before a presentation
or a grant deadline. We're all at the mercy of engineers somewhere in a
cube on some other continent. The change from Seurat2 to Seurat3 is making
a lot of people I know very nervous. It's often the little things where
updates fail and a tiny and easy function like this should not be gone
entirely, I think, if possible. There are probably many other things where
compatibility is harder, I imagine. Breaking changes should be reserved for
cases where it's absolutely unavoidable.

Thanks for your feedback. This is precisely why we released the software early as an alpha version outside of CRAN - we wanted to make sure that people had the ability to test out the new integration methods that we introduced in the preprint, but were not ready to do a full release yet.

Of course when we do a full release it will be accompanied with extensive documentation, updated vignettes, and the goal of making the transition as seamless as possible. We went through a similar transition when moving to V2. I believe that was successful and helpful to our users, and I believe the same will be true with the V3 update.

I would like to put my vote in for their being only a single way for performing common tasks such as subsetting, e.g. a subset function OR FilterCells, not both. Having multiple ways of doing the same thing adds extra overhead for developers and confuses users who see the same thing done different ways in different places or who might not realise that functions with different names are effectively doing the same thing. In addition I think it is better to stick to standard R names/conventions for doing things when possible to make the transition easier for new users (although Seurat is probably in the fairly unique position of having more Seurat users than general R users). Moving from Seurat2 to Seurat3 is a major update and this is the right time to introduce breaking changes like this and I think users will expect to have to learn new functions. Providing documentation that makes it clear how tasks can be performed in Seurat2 vs Seurat3 would help the transition and I think the Seurat team are planning on doing that.

In short I think things will be easier and better in the long run if there is only one of subset and FilterCells (unless they are actually doing different things).

It may be that the advantages of pragmatism over elegant design become more
obvious with years of software engineering experience...

Was this page helpful?
0 / 5 - 0 ratings