-
Notifications
You must be signed in to change notification settings - Fork 915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Seurat3 and subsetting features with dashes (-) in the name #1212
Comments
Hi, To use test3 <- subset(x = test, subset = `MT-CO3` > 0) This is consistent with how base R subsets data.frames based on column names. As far as the missing variable problem, when you put the name in quotes, R will treat it as a string rather than a variable so it will evaluate the expression |
Ah, thanks so much for the help! |
Hi there, I am having this exact warning coming up when I am running my shiny app. The app works but I can't get rid of this warning message. If I change input$single_cell_gene to a "genename" then there is no problem. I have tried changing as.character(input$single_cell_gene)
This has been bugging me for ages - any help much approeciated! |
This fix, to have the gene name surrounded by backticks, no longer works in Seurat 4.0. Any ideas for how to get around this? Trying to subset genes with "-" in the name and getting the below error. I get the same error if I put any other gene name in ticks, even those that subset just fine without them. Error in FetchData(object = object, vars = unique(x = expr.char[vars.use]), : |
Hi @wgk51, can you provide an example? |
I got the same problem as @wgk51. |
Putting a gene name in back ticks works fine for me. But how does one put a gene name into a variable? |
I have the same problem: So this works:length(WhichCells(data, slot = 'data', expression = Pitx2 > 0)) #[1] 379 But this does not work:a=c('Pitx2') #This would be needed to loop many gene names at one go. E.g. via: My workaround for this gene variables issue is to make another function 'tasta' and loop that:tasta=function(data,vars,rangi) { for(i in 1:rangi) { #Test variables for the function: #Testing the function: #Making the result as a datamatrix which has clusters in rows and gene names in columns (this solution should be defaulted): |
hi please i encountered a problem which keeps giving me an error. Here is the code i wrote: Here is the error i keep having please can anyone help me out. I am trying to convert the ENSEMBL gene ids to gene symbols and add a metadata. |
Hello,
I've found that I'm unable to use the subset() function to subset based on features that have dashes in their name.
`Aggreg.data <- Read10X(data.dir = "./filtered_feature_bc_matrix/")
test <- CreateSeuratObject(counts = Aggreg.data, min.cells = 50, min.features = 0)
This works fine:
However, this does not work:
What I find more troubling is that if a single requested variable is found, Seurat will not warn you that the "missing" variables were not used in the subset:
This is kind of strange to me because Seurat will specifically convert underscores to dashes in feature names, so I assume this is not intended. Does anyone know if there is a workaround for this, or should I replace all underscores and dashes in the features tsv file before reading in the data?
Thanks!
The text was updated successfully, but these errors were encountered: