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

Meaning and function of the n_components parameter #13

Open
Marius1311 opened this issue May 25, 2020 · 1 comment
Open

Meaning and function of the n_components parameter #13

Marius1311 opened this issue May 25, 2020 · 1 comment

Comments

@Marius1311
Copy link

Harmony has a n_components parameter, which, according to the docstring:

:param pc_components: Minimum number of principal components to use. Specify `None` to use pre-computed components

That value is used for utils.run_pca, but it's not passed over to scanpy's neighboor computation, see

sc.pp.neighbors(temp, n_pcs=0, n_neighbors=n_neighbors)

So I wonder what the significance of that parameter actually is?

Also, I find the default value of 1000 a bit high, as scanpy's default here is much smaller, 50 I believe

@Marius1311 Marius1311 changed the title Function of the n_components parameter Meaning and function of the n_components parameter May 25, 2020
@ManuSetty
Copy link
Member

The n_components parameter is used below

pca_projections, _ = utils.run_pca(data_df, n_components=pc_components)

to compute the principal components.

In line 67, temp is already pre-computed principal components and thus the parameter is not passed for nearest neighbor computation.

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