nateosher / DIMPLE

MIT License
2 stars 1 forks source link

add_QuantileDist error if one or more of the images does not contain the mask_type #21

Closed mariamasotti1 closed 1 year ago

mariamasotti1 commented 1 year ago

see code below to duplicate the error. I think we would want the quantile_dist to return NA for the specific image that does not contain the mask type but still return the quantile_dist for other images.

creating fake data with slide A containing just 2 types and slide B containing all 3 types

x <- runif(100,-50,50) y <- runif(100,-50,50) sid<-c(rep("A",50),rep("B",50)) typesA<-sample(rep_len(sample(paste0("X",1:2)),50)) typesB<-sample(rep_len(sample(paste0("X",1:3)),50)) types<-c(typesA,typesB) exp <- new_MltplxExperiment(x,y,types,sid) exp <- update_intensity(exp,ps=2,bw=3) from<-c(0,50) to<-c(50,100) q_probs<-cbind.data.frame(from,to)

want quantile dist with X3 as mask type but X3 is not in image A

add_QuantileDist(exp,cor,mask_type = "X3",q_probs)

mariamasotti1 commented 1 year ago

I can work on a fix to this tomorrow - just ran out of time with other meetings today

nateosher commented 1 year ago

23

mariamasotti1 commented 1 year ago

ya'll are amazing. thank you!