cole-trapnell-lab / monocle3

Other
333 stars 100 forks source link

Choose own k in learn_graph() #149

Open TobiTekath opened 5 years ago

TobiTekath commented 5 years ago

Dear monocle3-Team,

thanks for the very useful package, I see monocle3 as an huge improvement to monocle2.

When calling _learngraph() on my data, I get the warning message:

In louvain_clustering(data, pd[row.names(data), ], k = k, weight = weight, : RANN counts the point itself, k must be smaller than the total number of points - 1 (all other points) - 1 (itself)!

As far as I understand, that is because of some very small partitions with fewer cells than the parameter k (correct?). Therefore I think it would be useful to be able to alter the value for k when calling _learngraph() (at the moment it is hardcoded to 25 in _multi_componentRGE()).

As a second idea: wouldn't it be useful to automatically choose the value of k based on the number of cells in the partition?

Thanks in advance, Tobi

PS: I am using monocle3 v0.1.2 PPS: this should rather be an improvement than a "bug"

mikehdr commented 4 years ago

Hi! Any news on that front ?

ErinJF commented 4 years ago

@michaelhodara I am getting this error after updating R to 3.6.2. It was working fine today until I updated an hour ago.

brgew commented 4 years ago

Hi,

There is now a learn graph control parameter called rann.k in the Monocle3 develop branch.

You can install the develop version using

devtools::install_github( 'https://github.com/cole-trapnell-lab/monocle3', ref="develop")

Please let me know if this does not satisfy your needs.

Thank you.