Skip to content
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

variable.features.n didn't change the number of genes used #124

Closed
Evenlyeven opened this issue Jan 13, 2022 · 1 comment
Closed

variable.features.n didn't change the number of genes used #124

Evenlyeven opened this issue Jan 13, 2022 · 1 comment

Comments

@Evenlyeven
Copy link

Hi,

Firstly, thanks for this amazing package!

I just noticed that regardless of variable.features.n I set, it is always "2000 genes" used. Or do I have misunderstanding of the number of genes used in the process?

Thank you very much in advance!

c(Er_treated.sct, control.sct) %<-%
lapply(X = c(Er_treated.sub, control.sub), FUN = function(x){
SCTransform(x, variable.features.n = 4000)
})

Calculating cell attributes from input UMI matrix: log_umi
Variance stabilizing transformation of count matrix of size 17373 by 5045
Model formula is y ~ log_umi
Get Negative Binomial regression parameters per gene
Using 2000 genes, 5000 cells
|===============================================================================================================================| 100%
Found 130 outliers - those will be ignored in fitting/regularization step

Second step: Get residuals using fitted parameters for 17373 genes
|===============================================================================================================================| 100%
Computing corrected count matrix for 17373 genes
|===============================================================================================================================| 100%
Calculating gene attributes
Wall clock passed: Time difference of 2.110177 mins
Determine variable features
Place corrected count matrix in counts slot
Centering data matrix
|===============================================================================================================================| 100%
Set default assay to SCT
Calculating cell attributes from input UMI matrix: log_umi
Variance stabilizing transformation of count matrix of size 19138 by 7567
Model formula is y ~ log_umi
Get Negative Binomial regression parameters per gene
Using 2000 genes, 5000 cells
|===============================================================================================================================| 100%
Found 107 outliers - those will be ignored in fitting/regularization step

Second step: Get residuals using fitted parameters for 19138 genes
|===============================================================================================================================| 100%
Computing corrected count matrix for 19138 genes
|===============================================================================================================================| 100%
Calculating gene attributes
Wall clock passed: Time difference of 2.398781 mins
Determine variable features
Place corrected count matrix in counts slot
Centering data matrix
|===============================================================================================================================| 100%
Set default assay to SCT
There were 50 or more warnings (use warnings() to see the first 50)

@saketkc
Copy link
Contributor

saketkc commented Jan 13, 2022

The 2000 you see here is the default number of genes for estimating the Negative Binomial parameters (you can change this by using n_genes parameter to SCTransform. The variable features are set to 3000 by default which can be confirmed by length(VariableFeatures(object))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants