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

ENH: Adds seed parameter to rarefy #321

Merged
merged 11 commits into from
Jan 24, 2025
Merged

Conversation

VinzentRisch
Copy link
Contributor

@VinzentRisch VinzentRisch commented Dec 5, 2024

closes #55

  • Adds seed parameter to subsample-ids function.
  • Seed is per default set to 1. It can be set to "random" what creates a random 32 bit int as the seed.
  • Setting the seed to default 1 was done to ensure that the seed is logged in provenance.
  • At this point it is not possible to have a random seed that is created in the function that will be recorded in provenance.

@gregcaporaso
Copy link
Member

@VinzentRisch, I completely understand the motivation for this, but I don't think this solution will work out as-is. The vast majority of users wouldn't change this setting from the default, which would have the effect of there being no randomization of the seed, and repeat runs would use the same seed.

At the moment, we don't have a way to store the seed in provenance, but we know that this is something that should be addressed. What I would recommend is that you make the default "random", and if you want to make sure your seed is stored in provenance, you can generate a random in outside of QIIME 2 and pass that in. Do you want to make that change, and then ping me for re-review? Or let me know if you'd like to discuss more.

Copy link
Member

@gregcaporaso gregcaporaso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments on this PR and on #317

@VinzentRisch
Copy link
Contributor Author

Okay that makes sense. I'll make the changes.

@gregcaporaso gregcaporaso removed their assignment Dec 17, 2024
@VinzentRisch
Copy link
Contributor Author

Hi @gregcaporaso
I made the changes.

Copy link
Member

@gregcaporaso gregcaporaso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@VinzentRisch, thanks for the edits. I have additional specific suggestions on this implementation.

q2_feature_table/_normalize.py Outdated Show resolved Hide resolved
q2_feature_table/_normalize.py Outdated Show resolved Hide resolved
q2_feature_table/tests/test_normalize.py Outdated Show resolved Hide resolved
q2_feature_table/tests/test_normalize.py Outdated Show resolved Hide resolved
@VinzentRisch
Copy link
Contributor Author

Hi @gregcaporaso
I'm sorry about the last changes. But now it should be correct. You can just set the seed parameter of subsample to None, that creates a random seed internally in the function. I also implemented your tests with the iteration.
There are some tests for the heat maps failing in the CI, I don't really know what the problem is.

@gregcaporaso
Copy link
Member

Thanks @VinzentRisch - I will review this week.

Copy link
Member

@gregcaporaso gregcaporaso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates @VinzentRisch. I tested this locally and it's working for me. This is ready for merge, pending the failing heatmap tests.

I'm not sure what's going on with the failing heatmap tests, but I don't think it's anything that you're doing. I'll discuss with the folks on my end to figure out what's going on and then get this merged.

@gregcaporaso
Copy link
Member

@VinzentRisch, do you have an option to "Update branch" on this pull request, as described here. If so, could you do that? I want to see if it addresses the test failures.

@VinzentRisch
Copy link
Contributor Author

I updated the branch, but the tests are still failing.

@gregcaporaso
Copy link
Member

Thanks @VinzentRisch, we'll look into it from here. I don't think it's anything that you're doing wrong.

@gregcaporaso gregcaporaso merged commit de36ea3 into qiime2:dev Jan 24, 2025
4 checks passed
@gregcaporaso
Copy link
Member

Alright, we got it sorted out @VinzentRisch - merged. Thanks again for the work on this one, and for your patience with the back-and-forth!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Changelog Needed
Development

Successfully merging this pull request may close these issues.

add option for seeding rarefaction?
2 participants