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: Added actions that can partition annotation artifacts from reads and MAGs. #54

Merged
merged 42 commits into from
May 13, 2024

Conversation

VinzentRisch
Copy link
Collaborator

@VinzentRisch VinzentRisch commented Feb 28, 2024

This PR closes #53

  • Added partition-reads-gene-annotations, partition-reads-allele-annotations and partition-mags-annotations actions.
  • These actions can partition artifacts of type SampleData[CARDAnnotation], SampleData[CARDAlleleAnnotation] and SampleData[CARDAnnotation] into a collection of a specified number of partitions with the same type.
  • These actions are needed to enable parallelisation of the kmer query functions that will be added ENH: Add new action that predicts the origin of detected ARGs. #21.

Set up an environment for intel

mamba create -yn q2-amr \
  -c conda-forge -c bioconda -c qiime2 -c defaults \
  -c https://packages.qiime2.org/qiime2/2024.2/shotgun/released/ \
  qiime2 q2cli q2templates q2-types rgi

conda activate q2-amr

pip install --no-deps --force-reinstall \
  git+https://github.com/misialq/rgi.git@py38-fix \

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/54/head:pr-54
git checkout pr-54
pip install -e .
  1. Download test files
    PR-54.zip

  2. Test it out!

qiime amr partition-mags-annotations --i-annotations PR-54/amr_annotations.qza --p-num-partitions 13 --o-partitioned-annotations PR-54/partition_mags --verbose
qiime amr partition-reads-allele-annotations --i-annotations PR-54/amr_allele_annotation.qza --p-num-partitions 3 --o-partitioned-annotations PR-54/partition_reads-allele --verbose
qiime amr partition-reads-gene-annotations --i-annotations PR-54/amr_gene_annotation.qza --p-num-partitions 2 --o-partitioned-annotations PR-54/partition_reads-gene --verbose
  1. Check if partitioned artifacts from allele annotations and gene annotations are of type SampleData[CARDGeneAnnotation % Properties('kma')]

@VinzentRisch VinzentRisch requested a review from misialq February 28, 2024 14:03
@VinzentRisch
Copy link
Collaborator Author

Hi @misialq
Can you have a look at the partitioning actions for the annotation formats?
Its very similar to the function you wrote for the MAGs.

@VinzentRisch
Copy link
Collaborator Author

Hey @misialq
My CI is failing here
https://github.com/bokulich-lab/q2-amr/actions/runs/8081580912/job/22080505032?pr=54#step:8:116
is this something i have to resolve or is this a problem because there was a new release of qiime?

@misialq
Copy link
Contributor

misialq commented Feb 29, 2024

Hey @VinzentRisch, on the CI: it seems like the conda channel for the 2024.5 distro does not exist yet so I'd say it's related to the new release.

@VinzentRisch
Copy link
Collaborator Author

VinzentRisch commented Mar 20, 2024

Good Morning @misialq
Could you give this a look?

@codecov-commenter
Copy link

codecov-commenter commented Mar 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.29%. Comparing base (0ff2501) to head (75c8438).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #54      +/-   ##
==========================================
+ Coverage   93.89%   94.29%   +0.40%     
==========================================
  Files          20       20              
  Lines        1393     1491      +98     
==========================================
+ Hits         1308     1406      +98     
  Misses         85       85              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@VinzentRisch VinzentRisch removed the request for review from misialq April 11, 2024 08:23
@VinzentRisch VinzentRisch requested a review from misialq April 24, 2024 09:43
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, see some suggestions below.

q2_amr/card/partition.py Outdated Show resolved Hide resolved
q2_amr/card/partition.py Outdated Show resolved Hide resolved
q2_amr/card/partition.py Outdated Show resolved Hide resolved
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, some more suggestions floating your way - mostly about readability.

q2_amr/card/partition.py Outdated Show resolved Hide resolved
q2_amr/card/partition.py Outdated Show resolved Hide resolved
q2_amr/card/tests/test_partition.py Show resolved Hide resolved
q2_amr/plugin_setup.py Outdated Show resolved Hide resolved
q2_amr/plugin_setup.py Outdated Show resolved Hide resolved
@VinzentRisch VinzentRisch requested a review from misialq April 30, 2024 12:57
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, I think this looks pretty good now! I just had a little realization - see below. This is the last comment on this one, promise!

q2_amr/card/partition.py Outdated Show resolved Hide resolved
@VinzentRisch VinzentRisch requested a review from misialq May 3, 2024 09:49
@VinzentRisch VinzentRisch requested a review from misialq May 10, 2024 09:33
@VinzentRisch VinzentRisch requested a review from misialq May 10, 2024 13:22
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.

Great work, thanks @VinzentRisch! Merge away 🚀

@VinzentRisch
Copy link
Collaborator Author

Perfect!
But I cant merge because there is still this expected Ci check for macos latest
Can you merge it for me?

@misialq
Copy link
Contributor

misialq commented May 13, 2024

Oh, yeah, sure thing!

@misialq misialq merged commit 75d4efa into bokulich-lab:main May 13, 2024
8 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
3 participants