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

Incorrect intensity threshold due to zero-inflated distribution #29

Open
lhollestein opened this issue Dec 7, 2023 · 0 comments
Open

Comments

@lhollestein
Copy link

Dear Yuzhou Feng and team members,

First of all, I would like to congratulate you on the development of this package. It is very user-friendly and has a lot of important functions.

I have a question about the threshold of the intensity.
Due to filtering the intensity of the the tumour marker has a zero-inflated distribution. This leads to problems, as the predict_phenoptype function sets the threshold at 0, making all cells positive for the tumor marker. How can I solve this problem? I would like to find a way to automatically set the threshold the right way, because we need to analyse hundreds of samples, so I would like to avoid setting the threshold manually for each sample.
I copied a few figures and code to explain what's happening:

Distribution of a marker, where threshold setting is ok:

CD68 intensity plot

Distribution of the tumor marker:

MelanA intensity plot

Amount of zero’s in the tumor marker variable:

table(data_004P1$MelanA==0)
FALSE TRUE
670 157406

Distribution of non-zero values:

MelanA intensity plot non-zero

Predict phenotype function to set the thresholds:

predict_phenotypes_panel_1<-function(spe_object_name) {
spe_object_name <- predict_phenotypes(spe_object = spe_object_name,
thresholds = NULL,
tumour_marker = "MelanA",
baseline_markers = c("CD8",
"CD79A",
"CD3",
"CD68"),
nuclear_marker = NULL,
reference_phenotypes = FALSE)
return(spe_object_name)
}
SPE_004P1<-predict_phenotypes_panel_1(SPE_004P1)
[1] "CD8 threshold intensity: 145.994177633498"
[1] "CD79A threshold intensity: 212.734985292817"
[1] "CD3 threshold intensity: 143.100134414287"
[1] "CD68 threshold intensity: 1311.24589104864"
[1] "MelanA threshold intensity: 0"

Unique phenotypes, due to incorrect threshold of the tumor marker:

unique(SPE_004P1$Phenotype)
[1] "MelanA" "CD8,MelanA" "CD3,MelanA"
[4] "CD8,CD3,MelanA" "CD79A,MelanA" "CD79A,CD3,MelanA"
[7] "CD8,CD79A,MelanA" "CD79A,CD68,MelanA" "CD68,MelanA"
[10] "CD8,CD68,MelanA" "CD8,CD79A,CD3,MelanA" "CD8,CD79A,CD3,CD68,MelanA"
[13] "CD8,CD3,CD68,MelanA" "CD8,CD79A,CD68,MelanA" "CD3,CD68,MelanA"
[16] "CD79A,CD3,CD68,MelanA"

Could you please advise me how to solve this issue in a way, that it is easy applicable to a large amount of samples?

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