Closed Qile0317 closed 3 weeks ago
Also if my hypothesis that some recent PR accidentally changed some intended behaviour of certain functions is correct, then this may or may not be related to #433. Also a high chance that these are completely unrelated though as I am unsure which branch they even used.
There is only one place that the following phrase exists - which is in the internal function .expression2List()
subset.data.frame(subset, !is.na(cloneSize))
I think this means that the clones have not been added to the object scRep_example
. Especially because the following code does not have a discrete combineExpression()
call.
data("scRep_example")
scRep_example$Patient <- substr(scRep_example$orig.ident, 1,3)
scRep_example$Type <- substr(scRep_example$orig.ident, 4,4)
colorblind_vector <- hcl.colors(n=7, palette = "inferno", fixup = TRUE)
scRep_example <- clonalCluster(scRep_example,
chain = "TRA",
sequence = "aa",
threshold = 0.85,
group.by = "Patient")
@ncborcherding Ok - combined the contig list but now the TRA_clusters metadata column is almost all NAs which does not line up with the visualization showing many clusters:
data("contig_list")
combined <- combineTCR(contig_list,
samples = c("P17B", "P17L", "P18B", "P18L",
"P19B","P19L", "P20B", "P20L"),
removeNA = FALSE,
removeMulti = FALSE,
filterMulti = FALSE)
data("scRep_example")
scRep_example <- combineExpression(combined, scRep_example)
scRep_example$Patient <- substr(scRep_example$orig.ident, 1,3)
#Adding type information
scRep_example$Type <- substr(scRep_example$orig.ident, 4,4)
#Define color palette
colorblind_vector <- hcl.colors(n=7, palette = "inferno", fixup = TRUE)
scRep_example <- clonalCluster(scRep_example,
chain = "TRA",
sequence = "aa",
threshold = 0.85,
group.by = "Patient")
mean(!is.na(scRep_example$TRA_cluster))
# outputs 0.008 (only 4 non-NA rows)
Perhaps I missed some prior step in the vignette where scRep example was further modified? Just trying to get to the bottom of this so I can ensure correct behaviour for #425
Probably also will add an internal assert checker that an object has been combined.
@Qile0317
The issue is you are using the small scRep_example Seurat object that has 500 randomly sampled cells (~350 have clones). The vignette on the website uses the full Seurat object.
If you just look at the output of combined.TCR(), you can get a better approximation:
combined <- addVariable(combined,
variable.name = "Patient",
variables = c("P17", "P17", "P18", "P18",
"P19","P19", "P20", "P20"))
combined <- clonalCluster(combined,
chain = "TRA",
sequence = "aa",
threshold = 0.85,
group.by = "Patient")
mean(!is.na(do.call(rbind, combined)))
[1] 0.9462471
I will work on troubleshooting #425 tomorrow/next week and see if I can help find the issue.
Nick
The clonalCluster example on the current 2.0.5 vignette page when ran on the current dev branch does not work. Here are the steps to reproduce it on my machine:
This produces the following error and traceback (from the second last):
Additionally, I am having issues with certain other tests but getting other related errors. I am unsure if this is linked to any recent PRs that unintentionally changed certain behaviour and will investigate. I have also yet to investigate whether this issue exists on a previous patch version. This is probably the best way to investigate this issue.
SessionInfo: