ocbe-uio / DIscBIO

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

Some functions implicitly require clustering #1

Closed wleoncio closed 4 years ago

wleoncio commented 4 years ago

Some functions are very explicit about their dependency on other functions, for example running

comptSNE(DISCBIO(valuesG1ms))

Returns

Error in comptSNE(DISCBIO(valuesG1ms)) : run clustexp before comptsne

However, there are several other functions such as KmeanOrder which have the same requirement, but are not explicit about it. Running

KmeanOrder(DISCBIO(valuesG1ms), export = FALSE)

Returns

Error in [<-(*tmp*, cid, , value = colMeans(pcareduceres[names(clusterid[clusterid == : indeksen ligg utanfor grensene

(apologies for the error in Nynorsk, the point is that the first argument is out of bounds).

The function is clearly expecting some other clustering function such as clustexp to be run beforehand.

There are a few functions like this, and I can fix this by adding a similar validation algorithm to them as I go through the demo script, but I was wondering what this validation algo contains. Is it enough to check if length(object@cpart) == 0 or should I be checking other slots? Is clustexp the only clustering function that needs to be run before or are there alternatives?

SystemsBiologist commented 4 years ago

The first error is telling that the user should run clustexp before comptsne because the comptsne() uses the output of clustexp().

wleoncio commented 4 years ago

I see. So I'll make the changes to KmeanOrder (and other k-mean dependent functions) assuming there are no alternatives to Clustexp as a pre-requisite for them.

wleoncio commented 4 years ago

Issue resolved on dev (commit 19d06dfba8b27d722b165612ee0cdd1aa713949f).