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

Fix weight.by.var for approx=FALSE #2330

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

jan-glx
Copy link
Contributor

@jan-glx jan-glx commented Nov 17, 2019

Currently, the weight.by.var parameter of RunPCA has different effects, depending on the value of the approx parameter. See also #2237 .
For approx=TRUE, weight.by.var=TRUE yields the desirable scaling (variance of PC == eigenvalue) while for approx=FALSE this output is obtained only for weight.by.var=FALSE.
This PR gradually adjusts the behavior of approx=FALSE to that of approx=TRUE (which was implemented first and is thus preferred). The current approach does not modify the behavior of existing code but only warns about the current behavior and introduces an option to use the new one (Seurat.RunPCA.use.correct.scaling). This should be gradually changed as described in comments to eliminate the wrong behavior without breaking things.
This PR furthermore simplifies the implementation of RunPCA to facilitate further changes.
This also makes the approx=FALSE parameter functional for rev.pca=TRUE.

  • 1f81a35 implements tests for the desired behavior of the weight.by.var parameter, demonstrating the current issue.
  • 852e2d1 adds test to ensure the changes will not break existing code
  • 0730374 implements the actual changes

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

Successfully merging this pull request may close these issues.

1 participant