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 new transformer for AMRFinderPlusAnnotationsDirFmt to qiime2.Metadata #6

Merged
merged 11 commits into from
Oct 11, 2024

Conversation

VinzentRisch
Copy link
Contributor

@VinzentRisch VinzentRisch commented Sep 26, 2024

closes #5
depends on #7

  • Adds new transformer from AMRFinderPlusAnnotationsDirFmt to qiime2.Metadata.
  • Now all output files by amrfinderplus actions can be used with metadata tabulate

Set up an environment

mamba create -y -n q2-amrfinderplus -c https://packages.qiime2.org/qiime2/2024.10/metagenome/staged/ -c conda-forge -c bioconda --strict-channel-priority qiime2 q2-types q2-feature-table q2cli q2-metadata ncbi-amrfinderplus

Run it locally

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

  2. Test it out!

qiime metadata tabulate --m-input-file amr_all_mutations_contigs.qza --o-visualization amr_all_mutations_contigs.qzv
qiime metadata tabulate --m-input-file amr_all_mutations_feature.qza --o-visualization amr_all_mutations_feature.qzv
qiime metadata tabulate --m-input-file amr_all_mutations_sample_mags.qza --o-visualization amr_all_mutations_sample_mags.qzv
qiime metadata tabulate --m-input-file amr_annotations_contigs.qza --o-visualization amr_annotations_contigs.qzv
qiime metadata tabulate --m-input-file amr_annotations_feature.qza --o-visualization amr_annotations_feature.qzv
qiime metadata tabulate --m-input-file amr_annotations_sample_mags.qza --o-visualization amr_annotations_sample_mags.qzv
  1. open them with
qiime tools view amr_annotations_sample_mags.qzv

Copy link
Contributor

@misialq misialq left a comment

Choose a reason for hiding this comment

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

Hey @VinzentRisch, this has all the changes from your other PR as well, right? Can you please rebase it on top of that other branch so that we only see the changes relevant to this PR here? Thanks! 🙏

@VinzentRisch VinzentRisch force-pushed the 5_transformer_metadata branch 2 times, most recently from 4f76e2e to 9a5889f Compare October 4, 2024 13:02
@VinzentRisch
Copy link
Contributor Author

Hmm I do not understand how that works.
I rebased it onto the commit ee66471 becuase thats the last one that the both branches share. I thought that was the way to go but that does not work.
should I rebase it on the newest commit on the other branch?

@misialq
Copy link
Contributor

misialq commented Oct 4, 2024

Ah, sorry, my comment was incorrect - you should rebase on top of main as we want to see the diff between this branch here and the main branch, without taking into account the other changes. If you think, though, that this branch and the one you started it from are too entangled, it may not work - in this case it will be easier to first merge the other PR and then rebase this one on top of main. Which do you think is easier?

@VinzentRisch
Copy link
Contributor Author

Yeah lets merge the other one first. I cant get it to work with the rebase.

@VinzentRisch VinzentRisch force-pushed the 5_transformer_metadata branch from 9a5889f to f3865cf Compare October 9, 2024 11:41
@VinzentRisch VinzentRisch requested a review from misialq October 9, 2024 11:43
@VinzentRisch
Copy link
Contributor Author

Hi @misialq
I tried to use the genome_dict that I created also here but realized that that doesnt work because in the AMRFinderPlusAnnotationsDirFmt there are suffixes in the filenames so the ids are not correct anymore.
Should i just create a separate genome_dict for AMRFinderPlusAnnotationsDirFmt or leave it like this?

@misialq
Copy link
Contributor

misialq commented Oct 10, 2024

Hey @VinzentRisch, could you please include some example of what the genome_dict returns now and what you want to get? I'm not sure I quite see what you mean 😞

@VinzentRisch
Copy link
Contributor Author

Im sorry
So Amrfinderplusannotationdirfmt does not have a genome_dict function i just wanted to ask if you think it makes sense to add one that i can use it here for the transformer
But I mean for now maybe its okay without because I am not using the format as an input anywhere else.
Could you have a look at this today? then Liz can add the plugin to the distro tomorrow hopefully

@VinzentRisch
Copy link
Contributor Author

No I'm gonna do the genome_dict anyway for the Amrfinderplusannotationdirfmt so I can use it here for the transformer.

Copy link
Contributor

@misialq misialq left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

@VinzentRisch VinzentRisch merged commit eb8f7a6 into bokulich-lab:main Oct 11, 2024
3 checks passed
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.

ENH: Transformer from AMRFinderPlusAnnotationsDirFmt to immutable.Metadata.
2 participants