barcodeRanks unusual warning "In smooth.spline(x[new.keep], y[new.keep], df = df, ...)"
1
0
Entering edit mode
@rohitsatyam102-24390
Last seen 9 weeks ago
India

Hi Everyone!!

I was using the DropletUtils barcodeRanks function as usual. However, it throws the following warning on my sce object. I don't quite understand what it means!!

bcrank_sce <- barcodeRanks(counts(sce))
Warning message:
In smooth.spline(x[new.keep], y[new.keep], df = df, ...) :
not using invalid df; must have 1 < df <= n := #{unique x} = 14


I am not sure what it means because traceback won't return anything either. Also the kneeplot looks quite unusual:

DropletUtils • 200 views
2
Entering edit mode
Aaron Lun ★ 27k
@alun
Last seen 17 hours ago
The city by the bay

The warning is just indicating that spline fit doesn't know what to do, and it's not hard to see why from your plot.

barcodeRanks() will first take all barcodes with total counts greater than lower; then it will try to identify the inflection point, based on the largest negative gradient; and then it will try to fit a spline to find the knee point. However - and I'm assuming that the truncated y-axis is showing powers of 10 - there's nothing going on above the default lower=100. There's no knee point or inflection point above the 10^2 mark, so it's little wonder that the function is confused.

You might be tempted to just set a lower value for lower=, but the knee point is occurring at a total count of ~50 or less. I would question whether the experiment worked at all - it looks nothing like a droplet-based dataset to me.