ocbe-uio / DIscBIO

A user-friendly R pipeline for biomarker discovery in single-cell transcriptomics
Other
12 stars 5 forks source link

Aggregate K/MB selection into one function #32

Closed wleoncio closed 4 years ago

wleoncio commented 4 years ago

Several funcitons detect whether k-means or model-based clustering was performed. The code to do so is individualized on each function, even though the procedure is almost identical and should be aggregated into one internal function.

Here are some examples of code chunks containing such redundancy:

https://github.com/ocbe-uio/DIscBIO/blob/0c908992a28bf91efaf1079bb910cb877a00ff99/R/DIscBIO-generic-pseudoTimeOrdering.R#L28-L45

https://github.com/ocbe-uio/DIscBIO/blob/0c908992a28bf91efaf1079bb910cb877a00ff99/R/DIscBIO-generic-plotSilhouette.R#L25-L44

https://github.com/ocbe-uio/DIscBIO/blob/0c908992a28bf91efaf1079bb910cb877a00ff99/R/DIscBIO-generic-plottSNE.R#L15-L28

Also, the code makes it so that the functions will prefer k-means over MB, so if both are ran, than k-means is preferred. This should be documented. Ideally, the user should be made aware of this, though, and perhaps be prompted to choose or warned of the choice made by the function.

wleoncio commented 4 years ago

Upon closer inspection, it seems like gathering the code would not recude much the foorprint, because the expressions to be ran on each case (ran_k or ran_m) are too varied and would need to be passed to the function, together with an indicator of which is the function that should be ran afterwards. Closing until further development.