Danko-Lab / BayesPrism

A Fully Bayesian Inference of Tumor Microenvironment composition and gene expression
153 stars 46 forks source link

Error: if (any(which.row)) { : missing value where TRUE/FALSE needed #60

Open pcr08 opened 1 year ago

pcr08 commented 1 year ago

Hej! I am trying to run BayesPrism following the tutorial. I am using the same reference, cell state and cell type, but with my own mixture. Instead of running all the matrix, I am taking a small subset to need less time for this testing:

ref2 <- sc.dat[1:200, 1:400] mixture2 <- m2[1:100,20500:30000] cell_st2 <- cell.state.labels[1:200] cell_t2 <- cell.type.labels[1:200] myPrism2 <- new.prism(reference=ref2, mixture = mixture2, input.type = "count.matrix", cell.state.labels = cell_st2,cell.type.labels = cell_t2, key = "tumor", outlier.cut = 0.01, outlier.fraction = 0.1) by <- run.prism(prism = myPrism2)

When I get to run this, I get this error on the run.prism function:

image

What could it be? How should I fix it? I already checked if any of the objects have NA values, but none has. Thank you!

Paula

tinyi commented 1 year ago

Hi Paula,

Thank you for your interest in our methods.

Do you mind sending me the input data that can reproduce the error to @.*** ? You can dump everything into a rdata file by doing save.image (file="input.rdata"). Thanks.

Best,

Tinyi

On Wed, Oct 18, 2023 at 7:26 AM pcr08 @.***> wrote:

Hej! I am trying to run BayesPrism following the tutorial. I am using the same reference, cell state and cell type, but with my own mixture. Instead of running all the matrix, I am taking a small subset to need less time for this testing:

ref2 <- sc.dat[1:200, 1:400] mixture2 <- m2[1:100,20500:30000] cell_st2 <- cell.state.labels[1:200] cell_t2 <- cell.type.labels[1:200] myPrism2 <- new.prism(reference=ref2, mixture = mixture2, input.type = "count.matrix", cell.state.labels = cell_st2,cell.type.labels = cell_t2, key = "tumor", outlier.cut = 0.01, outlier.fraction = 0.1) by <- run.prism(prism = myPrism2)

When I get to run this, I get this error on the run.prism function: [image: image] https://user-images.githubusercontent.com/52033249/276229107-d3a42381-624d-46b8-8c9d-5d085ab2c955.png

What could it be? How should I fix it? I already checked if any of the objects have NA values, but none has. Thank you!

Paula

— Reply to this email directly, view it on GitHub https://github.com/Danko-Lab/BayesPrism/issues/60, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4NHS72FWSSZJ6M6ZXWKM3X764E5AVCNFSM6AAAAAA6FLE7W2VHI2DSMVQWIX3LMV43ASLTON2WKOZRHE2DSNJRGIZDENA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

pcr08 commented 1 year ago

Hi, I tried to attach it, let me know if you need something else or how I can solve this. Thank you,

Paula

input2.zip

tinyi commented 1 year ago

Hi Paula,

You only have one cell type. This will cause errors. The number of cell types should also be greater than 1, otherwise there is no need for deconvolution. Please refer to the vignette for the definition of cell types.

Best,

Tinyi

On Wed, Oct 18, 2023 at 4:52 PM pcr08 @.***> wrote:

Hi, I tried to attach it, let me know if you need something else or how I can solve this. Thank you,

Paula

input2.zip https://github.com/Danko-Lab/BayesPrism/files/13033854/input2.zip

— Reply to this email directly, view it on GitHub https://github.com/Danko-Lab/BayesPrism/issues/60#issuecomment-1769301053, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4NHS3B4KP57ZI43PU5SJ3YAA6MDAVCNFSM6AAAAAA6FLE7W2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRZGMYDCMBVGM . You are receiving this because you commented.Message ID: @.***>

pcr08 commented 1 year ago

Hi, it is true, now I realised, sorry! Thank you so much!