Skip to content

Switch to a curve-tracing algorithm for knee detection. - #125

Merged
LTLA merged 4 commits into
develfrom
knee23
Aug 19, 2025
Merged

Switch to a curve-tracing algorithm for knee detection.#125
LTLA merged 4 commits into
develfrom
knee23

Conversation

@LTLA

@LTLA LTLA commented Aug 14, 2025

Copy link
Copy Markdown
Member

I gotta say, now that I don't have to deal with the daily grind of full time employment, the ideas just keep on coming.

library(DropletTestFiles)
X <- listTestFiles()
keep <- grep("Raw HDF5", X$description)

png("results.png", width=6, height=10, units="in", res=120)
library(DropletUtils)
par(mfrow=c(3,2))
for (i in keep) {
    path <- getTestFile(X$rdatapath[i], prefix=FALSE)
    se <- read10xCounts(path, type="HDF5")
    mat <- as(assay(se), "SVT_SparseMatrix")
    current <- DropletUtils:::.barcode_ranks(mat)
    o <- order(current$rank)
    plot(current$rank[o], current$total[o], log="xy", type="l", main=X$file.dataset[i])
    abline(h=metadata(current)$knee, lty=2)
    abline(h=metadata(current)$inflection, lty=3)
}
dev.off()
results

And for Pete's data here:

X <- readRDS("pete_data.rds")
mat <- rbind(X$total) # pretend it's a matrix, only the colSums matter anyway
current <- DropletUtils:::.barcode_ranks(mat)
o <- order(current$rank)

png("pete_results.png", width=6, height=6, units="in", res=120)
plot(current$rank[o], current$total[o], log="xy", type="l")
abline(h=metadata(current)$knee, lty=2)
abline(h=metadata(current)$inflection, lty=3)
dev.off()
pete_results

@LTLA
LTLA merged commit 8f18cce into devel Aug 19, 2025
1 check passed
@LTLA
LTLA deleted the knee23 branch August 19, 2025 21:48
PeteHaitch added a commit to OSCA-source/OSCA.advanced that referenced this pull request Oct 7, 2025
- Address #21.
- Reducing `lower` from its default value of 100 to 90 does enable it to run. It gives qualitatively similar barcode rank plots, although the knee/inflection points (not used here) will likely be different to the old results due the other changes in knee/inflection point identification (e.g., MarioniLab/DropletUtils#124 and MarioniLab/DropletUtils#125)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant