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: Add three new parameters to run_amrfinderplus_n #97

Merged
merged 66 commits into from
Jul 26, 2024

Conversation

VinzentRisch
Copy link
Collaborator

@VinzentRisch VinzentRisch commented Jul 23, 2024

solves #96

Adds three new parameters to run_amrfinderplus_n. Two of those can be used with the action annotate_sample_data_amrfinderplus.

Set up an environment

https://github.com/bokulich-lab/q2-amr?tab=readme-ov-file#installation

Run it locally

  1. First, clone the repo and checkout the PR branch:
git clone https://github.com/bokulich-lab/q2-amr.git
cd q2-amr
git fetch origin pull/97/head:pr-97
git checkout pr-97
pip install -e .
  1. Download test files
    PR-88.zip

  2. Test it out!

qiime amr fetch-amrfinderplus-db --o-amrfinderplus-db amrfinderplus_db.qza 
qiime amr annotate-sample-data-amrfinderplus --i-sequences test_mags.qza --output-dir output_mags --i-amrfinderplus-db amrfinderplus_db.qza --p-plus --p-curated-ident --p-organism "Escherichia_coli_Shigella" --p-report-all-equal --p-coverage-min 0.4 --p-translation-table "11" --p-gpipe-org True --p-report-common
qiime amr annotate-sample-data-amrfinderplus --i-sequences test_contigs.qza --output-dir output_contigs --i-amrfinderplus-db amrfinderplus_db.qza --p-plus --p-curated-ident --p-organism "Escherichia_coli_Shigella" --p-report-all-equal --p-coverage-min 0.4 --p-translation-table "11" --p-gpipe-org True --p-report-common

@VinzentRisch VinzentRisch marked this pull request as ready for review July 24, 2024 10:00
@VinzentRisch
Copy link
Collaborator Author

@misialq could you have a look at the added typemap in this PR.
so i want to have different choices for one parameter depending if one parameter is true or false
And i have this. I saw that placeholder type with _ and Int in moshpit, but there it also says it is using Int because visualizations dont have types so Im not sure if i should be doing it like this.

P_gpipe_org, P_organism, _ = TypeMap(
    {
        (Bool % Choices(True), Str % Choices(organisms_gpipe)): Int,
        (Bool % Choices(False), Str % Choices(organisms)): Int,
    }
)

Also this leads to the parameter gpipe_org not behaving like a bool parameter anymore. So it is not possible to just put --p-gpipe-org but you have to give it a value of eighter True or False. Is this the normal behaviour because I use Bool % Choices(True)? Or is there a better solution?

@misialq
Copy link
Contributor

misialq commented Jul 24, 2024

Hey @VinzentRisch, I think it's fine for the Int as a placeholder - you are not using it after all. For the boolean, though, I'm not sure if there is a better way - we have it like this somewhere in MOSHPIT and Santiago spent some time exploring this (ending up with a solution like yours) but maybe we could ask tomorrow just to be sure?

Copy link
Contributor

@ChristosMatzoros ChristosMatzoros left a comment

Choose a reason for hiding this comment

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

Hi @VinzentRisch,

Runs as expected with no errors and code looks good. See a minor change to make and after that we are set to merge.

q2_amr/plugin_setup.py Outdated Show resolved Hide resolved
@VinzentRisch
Copy link
Collaborator Author

Thanks for the review, added the full stop :)

@VinzentRisch VinzentRisch merged commit a895429 into bokulich-lab:main Jul 26, 2024
2 checks passed
VinzentRisch added a commit to VinzentRisch/q2-amr that referenced this pull request Sep 27, 2024
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

Successfully merging this pull request may close these issues.

3 participants