scverse / scanpy

Single-cell analysis in Python. Scales to >1M cells.
https://scanpy.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.81k stars 584 forks source link

Why n_comps must be > 2? #675

Closed lsiraj closed 4 years ago

lsiraj commented 5 years ago

Hi,

I was wondering why n_comps had to be greater than 2?

Thank you,

Layla

ivirshup commented 5 years ago

I'm not sure what you're asking about here. Could you provide a little more context?

lsiraj commented 5 years ago

Hi Isaac,

When I try to set n_comps equal to 2 (trying to do a diffmap in 2 components), I get an error message saying that it must be greater than 2. I was wondering why?

On Sun, Jul 7, 2019 at 4:25 AM Isaac Virshup notifications@github.com wrote:

I'm not sure what you're asking about here. Could you provide a little more context?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/theislab/scanpy/issues/675?email_source=notifications&email_token=AKIOHVNZFKCE63C4KLO45KTP6GSAPA5CNFSM4HSIFHXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZLG7PQ#issuecomment-508981182, or mute the thread https://github.com/notifications/unsubscribe-auth/AKIOHVL7254C36JSP374JOTP6GSAPANCNFSM4HSIFHXA .

-- Harvard-MIT MD-PhD Student G1, Biophysics Lander Lab

ivirshup commented 5 years ago

I'm not sure. @flying-sheep, why do we insist that more than two components of a diffusion map are computed? I believe these are the relevant lines:

https://github.com/theislab/scanpy/blob/1ac97e83705322989fb0df8528fc0de31f323202/scanpy/tools/_diffmap.py#L41-L43

https://github.com/theislab/scanpy/blob/1ac97e83705322989fb0df8528fc0de31f323202/scanpy/plotting/_tools/scatterplots.py#L463

Something about the first eigenvalue? Possibly related to #170.

falexwolf commented 5 years ago

Yes, it's related to the first eigenvalue: "2 corresponds to 1 for diff maps" in that case. But, there is no restriction by computing the default 10 or 15 components anyway...