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

The gene number simulated by powsimR is not equal to the custom setting #61

Open
duohongrui opened this issue Dec 31, 2021 · 1 comment

Comments

@duohongrui
Copy link

Hi,
PowsimR is an ideal tool to simulate single-cell RNA-seq data where DEGs can be set previously between two groups and it is useful for my project. I set the gene number(e.g. 43718) according to the real data and ran the simulation. However, the output count matrix only involves 43366 genes, showing a little difference.

Codes are shown here:

params <- estimateParam(countData = counts(ref_data),
                        RNAseq = 'singlecell',
                        Protocol = 'UMI',
                        Distribution = 'ZINB',
                        Normalisation = "scran",
                        verbose = TRUE)

# set up simulations
setupres <- Setup(ngenes = dim(ref_data)[1],
                  nsims = 1,
                  n1 = 30,
                  n2 = 30,
                  estParamRes = params,
                  setup.seed = seed,
                  verbose = TRUE)

## Running differential expression simulations
sim_data <- simulateDE(SetupRes = setupres,
                       Normalisation = 'scran',
                       DEmethod = "MAST",
                       verbose = TRUE,
                       Counts = TRUE))

sim_data <- sim_data[["Counts"]][[1]][[1]]

dim(ref_data)[1]
## 43718

dim(sim_data)[1]
## 43366

How can I solve this problem? Thanks very much!

@bvieth
Copy link
Owner

bvieth commented Aug 1, 2023

Hey,

this is a result of drawing from the count distribution with very small mean expression values, some of them will randomly have zero counts across all samples, which are removed from the final output object.

HTH
Beate

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

2 participants