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

Possible bug in simData function #104

Open
simonemodolo opened this issue May 19, 2022 · 0 comments
Open

Possible bug in simData function #104

simonemodolo opened this issue May 19, 2022 · 0 comments

Comments

@simonemodolo
Copy link

Hi Muscat team,

looking at the simData function I found a possible bug in the selection of sample parameters (beta_s) from the reference dataset.
On line 347 of simData function, simulation parameters of the current cluster(k) and sample pair(s) are selected in the bs_ks object, but for both elements of the sample pair the parameters of the first sample are used (bs$sample_id[[s0[1]]]).
This implies that counts of the two samples of the current pair are both simulated using the beta_s parameter of the first sample, correct me if I'm wrong.

To overcome this limit I simply split the bs_ks object into 2 different objects, one for each element of the sample pair:
bs_ks1 <- cbind(b0, bs$cluster_id[[k0]], bs$sample_id[[s0[1]]])
bs_ks2 <- cbind(b0, bs$cluster_id[[k0]], bs$sample_id[[s0[2]]])
and then used these objects in the following code lines.

I attach the edited simData function (edited lines are marked with comments), let me know if this change make sense.
simData_debug.R.zip

Thanks,
Simone

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