-
Notifications
You must be signed in to change notification settings - Fork 927
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
How to set n_genes in SCTransform #7998
Comments
Hi, Not member of dev team but hopefully can be helpful. Can you provide the output of Using Seurat 5.0.0, SeuratObject5.0.0, and sctransform 0.4.1 I cannot replicate your issue.
Best, |
Hey Sam: |
Hi! I tried the method you mentioned above but for some reason I still cannot change the n_genes. I am also using the same version of packages that you used. Here are my code and output `> SCTransform(pbmc, n_genes = 1000) Second step: Get residuals using fitted parameters for 12572 genes Would you please give me some suggestions about what could be wrong? |
Can you post the output of |
Thank you for your quick response! Here is the output:
Matrix products: default locale: attached base packages: other attached packages: loaded via a namespace (and not attached): |
hmm ok. What happens if you run this using reproducible object. If you haven't already install seurat-data package (https://github.com/satijalab/seurat-data) and the pbmc3k dataset. Then in fresh R session, run the following code and post output.
Best, |
Thanks! I ran the SCTransform on pbmc object and it worked!
But it is interesting that it still not working on my own dataset.
So I wonder if there are something wrong with my dataset? |
What happens if you recreate your object from scratch and then run SCTransform? |
Thank you for your help! It still doesn't work if I recreate the object. ;( |
Hmmmm not sure then. Hopefully someone from Seurat team might be able to figure this one out. I’ll keep thinking but not sure why it’s not working. |
Again! Thank you so much for your help! :D |
Hi Sam:
Then the SCTransform gives me correct result:
|
Thank you so much, Sam! |
Actually wait sorry my brain was playing tricks. It looks like from your output it worked in latest version:
|
Yeah you are right. When I create a object without 'options(Seurat.object.assay.version = "v3")', then the class will be 'Assay5' and the n_genes cannot be changed in SCTransform. |
Ok well we found issue now :). @saketkc hope you don't mind me tagging you here since I've seen you handle most sctransform related issues. There is seems to be failure to pass n_genes when using V5 structure.
Best, |
Thanks for flagging it both! This is because the extra arguments currently not being passed internally ( |
Awesome. Thanks as always!!! |
Hi @SihanLiUVa and @samuel-marsh , thanks once again for noticing this. It should be fixed by e2a956a (currently in the develop branch). Please let me know if you notice any other issues. Thanks! |
Hi! Sorry for double posting the issue in sctransform and here. According to the issue#124 in satijalab/sctransform (satijalab/sctransform#124), I am trying to increase the number of genes in the function SCTransform. Here are my codes:
group1 <- SCTransform(group1_data,vars.to.regress = "nCount_RNA", ncells = 5000, vst.flavor = "v2", return.only.var.genes = FALSE, n_genes = 5000)
I noticed that in the argument of this function, the n_genes is supposed to pass to sctransform::vst, where the n_genes is used. However, i still got this message from my console.
Get Negative Binomial regression parameters per gene
Using 2000 genes
It seems still using default 2000 genes as input. So I wonder how to pass n_genes to vst according to the scTransform document. Thank you so much in advance!
The text was updated successfully, but these errors were encountered: