PoonLab / clustuneR

Implementing clustering algorithms on genetic data and finding optimal parameters through the performance of predictive growth models.
GNU General Public License v3.0
0 stars 0 forks source link

can you print the cutoff value? #15

Closed liamxg closed 1 year ago

liamxg commented 1 year ago
image
liamxg commented 1 year ago

@ArtPoon

ArtPoon commented 1 year ago

Hi @liamxg, you should be able to retrieve the minimum value from the data objects used in the R script. Which script are you using, specifically?

ArtPoon commented 1 year ago

Okay, it looks like you've just copied the example in the README document, so I'll assume you are running the following code:

cutoffs <- sapply(param.list, function(x) x$branch.thresh)
par(mar=c(5,5,1,1))
plot(cutoffs, delta.AIC, type='l', col='cadetblue', lwd=2)
abline(h=0, lty=2)

In which case, you should be able to retrieve and display the minimum as follows:

cutoffs <- sapply(param.list, function(x) x$branch.thresh)
min.cutoff <- cutoffs[which.min(delta.AIC)]
par(mar=c(5,5,1,1))
plot(cutoffs, delta.AIC, type='l', col='cadetblue', lwd=2)
abline(h=0, lty=2)
text(x=min.cutoff, y=min(delta.AIC), label=min.cutoff, cex=0.8, adj=0)
liamxg commented 1 year ago

@ArtPoon thanks, I will try that.