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

Simulate sample groups #2

Open
Puumanamana opened this issue Oct 12, 2021 · 1 comment
Open

Simulate sample groups #2

Puumanamana opened this issue Oct 12, 2021 · 1 comment

Comments

@Puumanamana
Copy link

Hello,

I am trying to use SparseDOSSA2 to simulate a metagenome dataset with multiple sample groups (such as simple case/control). After looking at the tutorial, it seems I want to use the spike-in feature. However, it seems one step is missing from the tutorial (to generate the spike_in_setup dataframe). How would you recommend generating this one?
I also tried simply to do:

n_groups <- 3

metadata <- data.frame(
    Group=rep(1:n_groups, each=500))
)

sim <- SparseDOSSA2(
    template="Stool",
    n_sample=nrow(metadata),
    new_features=FALSE,
    metadata_matrix=as.matrix(metadata),
    verbose=FALSE)

But it doesn't seem the metadata does anything (when I do an NMDS plot of sim$simulated_data, I don't see any grouping). Is it because I need to add something for the spike-in feature_metadata_spike_df argument?

Thank you for your help!

@vstanislas
Copy link

Hello,
I think I ran into similar issues as yours and can share the solution that worked for me.
Looking at the code revision history, I found the corresponding part of the code that is removed in the current version:

spike_in_setup <- data.frame(metadata_datum = c(1, 1, 2, 3 ),
                             feature_spiked = c(feature_up, feature_down, feature_up, feature_down),
                             effect_size = c(3, -3, 1 , 1))

Also the feature_metadata_spike_df parameter no longer exists in the current version of SparseDOSSA2(). The df_metadata_spike object can however be read via the spike_metadata parameter.

sim <- SparseDOSSA2(
    template = "Stool",
    n_sample = nrow(mat_metadata), 
    new_features = FALSE,
    spike_metadata = df_metadata_spike,
    metadata_matrix = as.matrix(mat_metadata), 
    verbose = FALSE)

Hope this can help!

Best

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