Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all cells are filtered #124

Open
Duiduipeng opened this issue Jan 5, 2025 · 0 comments
Open

all cells are filtered #124

Duiduipeng opened this issue Jan 5, 2025 · 0 comments

Comments

@Duiduipeng
Copy link

While doing the coykat analysis, I found that by the second step of running, my cells were all filtered out
[1] "10503 genes past LOW.DR filtering"
[1] "step 2: annotations gene coordinates ..."
[1] "start annotation ..."
错误于copykat(rawmat = exp.rawdata, id.type = "S", cell.line = "no", :
all cells are filtered
The code to run is“copykat.test <- copykat(rawmat=exp.NBTHCA,
id.type="S",
cell.line="no",
ngene.chr=1,
win.size=25,
KS.cut=0.15,
sam.name="NBTHCA",
distance="euclidean",
n.cores=20)”
When debugging, it is found that the parameter changes to 0 when annotating the hg20 gene.
The corresponding code is as follows
“if (genome == "hg20") {
anno.mat <- annotateGenes.hg20(mat = rawmat, ID.type = id.type)
}
else if (genome == "mm10") {
anno.mat <- annotateGenes.mm10(mat = rawmat, ID.type = id.type)
dim(rawmat)
}
anno.mat <- anno.mat[order(as.numeric(anno.mat$abspos),
decreasing = FALSE), ]
if (genome == "hg20") {
HLAs <- anno.mat$hgnc_symbol[grep("^HLA-", anno.mat$hgnc_symbol)]
toRev <- which(anno.mat$hgnc_symbol %in% c(as.vector(cyclegenes[[1]]),
HLAs))
if (length(toRev) > 0) {
anno.mat <- anno.mat[-toRev, ]
}
}
ToRemov2 <- NULL
for (i in 8:ncol(anno.mat)) {
cell <- cbind(anno.mat$chromosome_name, anno.mat[, i])
cell <- cell[cell[, 2] != 0, ]
if (length(as.numeric(cell)) < 5) {
rm <- colnames(anno.mat)[i]
ToRemov2 <- c(ToRemov2, rm)
}
else if (length(rle(cell[, 1])$length) < length(unique((anno.mat$chromosome_name))) |
min(rle(cell[, 1])$length) < ngene.chr) {
rm <- colnames(anno.mat)[i]
ToRemov2 <- c(ToRemov2, rm)
}
i <- i + 1
}
if (length(ToRemov2) == (ncol(anno.mat) - 7))
stop("all cells are filtered")”
What is the cause of this? How do I deal with it

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

No branches or pull requests

1 participant