dyngen icon indicating copy to clipboard operation
dyngen copied to clipboard

x or y has vectors with zero standard deviation; consider setting use_nan = TRUE

Open Pinolinoo opened this issue 2 years ago • 5 comments

Why do I get this error message when running generate_gold_standart?

Pinolinoo avatar Aug 29 '22 09:08 Pinolinoo

Can you provide me with a small reproducible example? Which version of dyngen is this ?

rcannood avatar Aug 29 '22 11:08 rcannood

Thank you very much for replying! It's version 1.0.3

I ran this script:

`set.seed(1)

backbone <- backbone_bifurcating() config <- initialise_model( backbone = backbone, num_tfs = nrow(backbone$module_info), num_targets = 500, num_hks = 500, verbose = FALSE )

model <- generate_tf_network(config) plot_feature_network(model, show_targets = FALSE) model <- generate_feature_network(model) plot_feature_network(model) model <- generate_kinetics(model) model <- generate_gold_standard(model)

model <- generate_cells(model) plot_simulations(model)

write_rds(model, "mode_circle.rds", compress = "gz") `

Pinolinoo avatar Aug 29 '22 11:08 Pinolinoo

Can you update to 1.0.4 ? It was caused by an update to an underlying package.

rcannood avatar Aug 29 '22 11:08 rcannood

Ok so I updated to 1.0.4 and now when I run the same script it gives me the error:

Error in x$.self$finalize() : attempt to apply non-function Error in x$.self$finalize() : attempt to apply non-function Error in x$.self$finalize() : attempt to apply non-function Error in (function (x) : attempt to apply non-function

After running generate_gold_standart()

However if I run the function again afterwards it doesn't give me an error!

Pinolinoo avatar Sep 05 '22 09:09 Pinolinoo

Also when continuing then and wanting to export the data I get the following errors:

when trying with seurat as in:

library(Seurat) seurat <- as_seurat(model) write_rds(seurat, "dataset_seurat.rds")

I get Error in UseMethod("mutate") : no applicable method for 'mutate' applied to an object of class "NULL"

also with anndata: library(anndata) ad <- as_anndata(model) ad$write_h5ad("dataset.h5ad")

I get

ad <- as_anndata(model) Error in as(log2(counts + 1), "dgCMatrix") : no method or default for coercing "numeric" to "dgCMatrix"

I suppose there is still something going wrong during the simulation!

Pinolinoo avatar Sep 05 '22 10:09 Pinolinoo