From 7f5f964d22d77493b88a417b6d0b5ab3401696d7 Mon Sep 17 00:00:00 2001 From: VinzentRisch <100149044+VinzentRisch@users.noreply.github.com> Date: Wed, 2 Oct 2024 09:40:46 +0200 Subject: [PATCH 1/2] CI: Pin mamba version in ci.yaml to prevent failures in setup_miniconda step (#108) --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f182b83..3509aa4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -51,7 +51,7 @@ jobs: uses: conda-incubator/setup-miniconda@v3 with: python-version: 3.8 - mamba-version: "*" + mamba-version: 1.5.10 channels: conda-forge,defaults channel-priority: true activate-environment: conda-env From 6d140d94f3811bc863bed13b89c1864438285e92 Mon Sep 17 00:00:00 2001 From: VinzentRisch <100149044+VinzentRisch@users.noreply.github.com> Date: Fri, 4 Oct 2024 15:49:32 +0200 Subject: [PATCH 2/2] MAINT: Remove all functionality for AMRFinderPlus (#106) --- README.md | 27 +- ci/recipe/meta.yaml | 1 - q2_amr/amrfinderplus/database.py | 50 ---- q2_amr/amrfinderplus/sample_data.py | 130 ---------- q2_amr/amrfinderplus/tests/__init__.py | 7 - q2_amr/amrfinderplus/tests/test_database.py | 52 ---- .../amrfinderplus/tests/test_sample_data.py | 104 -------- q2_amr/amrfinderplus/tests/test_utils.py | 151 ----------- q2_amr/amrfinderplus/types/__init__.py | 22 -- q2_amr/amrfinderplus/types/_format.py | 120 --------- q2_amr/amrfinderplus/types/_type.py | 16 -- q2_amr/amrfinderplus/types/tests/__init__.py | 7 - ...4de3-a957-7e8bf837f30d_amr_annotations.tsv | 3 - ...4c4a-a53b-4df6999815dd_amr_annotations.tsv | 3 - .../data/annotation_wrong/amr_annotation.tsv | 1 - .../types/tests/data/database/AMR.LIB | 0 .../types/tests/data/database/AMR.LIB.h3f | 0 .../types/tests/data/database/AMR.LIB.h3i | 0 .../types/tests/data/database/AMR.LIB.h3m | 0 .../types/tests/data/database/AMR.LIB.h3p | 0 .../types/tests/data/database/AMRProt | 0 .../tests/data/database/AMRProt-mutation.tab | 0 .../tests/data/database/AMRProt-suppress | 0 .../data/database/AMRProt-susceptible.tab | 0 .../types/tests/data/database/AMRProt.pdb | 0 .../types/tests/data/database/AMRProt.phr | 0 .../types/tests/data/database/AMRProt.pin | 0 .../types/tests/data/database/AMRProt.pjs | 0 .../types/tests/data/database/AMRProt.pot | 0 .../types/tests/data/database/AMRProt.psq | 0 .../types/tests/data/database/AMRProt.ptf | 0 .../types/tests/data/database/AMRProt.pto | 0 .../database/AMR_DNA-Acinetobacter_baumannii | 0 .../AMR_DNA-Acinetobacter_baumannii.ndb | 0 .../AMR_DNA-Acinetobacter_baumannii.nhr | 0 .../AMR_DNA-Acinetobacter_baumannii.nin | 0 .../AMR_DNA-Acinetobacter_baumannii.njs | 0 .../AMR_DNA-Acinetobacter_baumannii.not | 0 .../AMR_DNA-Acinetobacter_baumannii.nsq | 0 .../AMR_DNA-Acinetobacter_baumannii.ntf | 0 .../AMR_DNA-Acinetobacter_baumannii.nto | 0 .../AMR_DNA-Acinetobacter_baumannii.tab | 0 .../tests/data/database/AMR_DNA-Campylobacter | 0 .../data/database/AMR_DNA-Campylobacter.ndb | 0 .../data/database/AMR_DNA-Campylobacter.nhr | 0 .../data/database/AMR_DNA-Campylobacter.nin | 0 .../data/database/AMR_DNA-Campylobacter.njs | 0 .../data/database/AMR_DNA-Campylobacter.not | 0 .../data/database/AMR_DNA-Campylobacter.nsq | 0 .../data/database/AMR_DNA-Campylobacter.ntf | 0 .../data/database/AMR_DNA-Campylobacter.nto | 0 .../data/database/AMR_DNA-Campylobacter.tab | 0 .../database/AMR_DNA-Clostridioides_difficile | 0 .../AMR_DNA-Clostridioides_difficile.ndb | 0 .../AMR_DNA-Clostridioides_difficile.nhr | 0 .../AMR_DNA-Clostridioides_difficile.nin | 0 .../AMR_DNA-Clostridioides_difficile.njs | 0 .../AMR_DNA-Clostridioides_difficile.not | 0 .../AMR_DNA-Clostridioides_difficile.nsq | 0 .../AMR_DNA-Clostridioides_difficile.ntf | 0 .../AMR_DNA-Clostridioides_difficile.nto | 0 .../AMR_DNA-Clostridioides_difficile.tab | 0 .../database/AMR_DNA-Enterococcus_faecalis | 0 .../AMR_DNA-Enterococcus_faecalis.ndb | 0 .../AMR_DNA-Enterococcus_faecalis.nhr | 0 .../AMR_DNA-Enterococcus_faecalis.nin | 0 .../AMR_DNA-Enterococcus_faecalis.njs | 0 .../AMR_DNA-Enterococcus_faecalis.not | 0 .../AMR_DNA-Enterococcus_faecalis.nsq | 0 .../AMR_DNA-Enterococcus_faecalis.ntf | 0 .../AMR_DNA-Enterococcus_faecalis.nto | 0 .../AMR_DNA-Enterococcus_faecalis.tab | 0 .../database/AMR_DNA-Enterococcus_faecium | 0 .../database/AMR_DNA-Enterococcus_faecium.ndb | 0 .../database/AMR_DNA-Enterococcus_faecium.nhr | 0 .../database/AMR_DNA-Enterococcus_faecium.nin | 0 .../database/AMR_DNA-Enterococcus_faecium.njs | 0 .../database/AMR_DNA-Enterococcus_faecium.not | 0 .../database/AMR_DNA-Enterococcus_faecium.nsq | 0 .../database/AMR_DNA-Enterococcus_faecium.ntf | 0 .../database/AMR_DNA-Enterococcus_faecium.nto | 0 .../database/AMR_DNA-Enterococcus_faecium.tab | 0 .../tests/data/database/AMR_DNA-Escherichia | 0 .../data/database/AMR_DNA-Escherichia.ndb | 0 .../data/database/AMR_DNA-Escherichia.nhr | 0 .../data/database/AMR_DNA-Escherichia.nin | 0 .../data/database/AMR_DNA-Escherichia.njs | 0 .../data/database/AMR_DNA-Escherichia.not | 0 .../data/database/AMR_DNA-Escherichia.nsq | 0 .../data/database/AMR_DNA-Escherichia.ntf | 0 .../data/database/AMR_DNA-Escherichia.nto | 0 .../data/database/AMR_DNA-Escherichia.tab | 0 .../data/database/AMR_DNA-Klebsiella_oxytoca | 0 .../database/AMR_DNA-Klebsiella_oxytoca.ndb | 0 .../database/AMR_DNA-Klebsiella_oxytoca.nhr | 0 .../database/AMR_DNA-Klebsiella_oxytoca.nin | 0 .../database/AMR_DNA-Klebsiella_oxytoca.njs | 0 .../database/AMR_DNA-Klebsiella_oxytoca.not | 0 .../database/AMR_DNA-Klebsiella_oxytoca.nsq | 0 .../database/AMR_DNA-Klebsiella_oxytoca.ntf | 0 .../database/AMR_DNA-Klebsiella_oxytoca.nto | 0 .../database/AMR_DNA-Klebsiella_oxytoca.tab | 0 .../database/AMR_DNA-Neisseria_gonorrhoeae | 0 .../AMR_DNA-Neisseria_gonorrhoeae.ndb | 0 .../AMR_DNA-Neisseria_gonorrhoeae.nhr | 0 .../AMR_DNA-Neisseria_gonorrhoeae.nin | 0 .../AMR_DNA-Neisseria_gonorrhoeae.njs | 0 .../AMR_DNA-Neisseria_gonorrhoeae.not | 0 .../AMR_DNA-Neisseria_gonorrhoeae.nsq | 0 .../AMR_DNA-Neisseria_gonorrhoeae.ntf | 0 .../AMR_DNA-Neisseria_gonorrhoeae.nto | 0 .../AMR_DNA-Neisseria_gonorrhoeae.tab | 0 .../tests/data/database/AMR_DNA-Salmonella | 0 .../data/database/AMR_DNA-Salmonella.ndb | 0 .../data/database/AMR_DNA-Salmonella.nhr | 0 .../data/database/AMR_DNA-Salmonella.nin | 0 .../data/database/AMR_DNA-Salmonella.njs | 0 .../data/database/AMR_DNA-Salmonella.not | 0 .../data/database/AMR_DNA-Salmonella.nsq | 0 .../data/database/AMR_DNA-Salmonella.ntf | 0 .../data/database/AMR_DNA-Salmonella.nto | 0 .../data/database/AMR_DNA-Salmonella.tab | 0 .../database/AMR_DNA-Staphylococcus_aureus | 0 .../AMR_DNA-Staphylococcus_aureus.ndb | 0 .../AMR_DNA-Staphylococcus_aureus.nhr | 0 .../AMR_DNA-Staphylococcus_aureus.nin | 0 .../AMR_DNA-Staphylococcus_aureus.njs | 0 .../AMR_DNA-Staphylococcus_aureus.not | 0 .../AMR_DNA-Staphylococcus_aureus.nsq | 0 .../AMR_DNA-Staphylococcus_aureus.ntf | 0 .../AMR_DNA-Staphylococcus_aureus.nto | 0 .../AMR_DNA-Staphylococcus_aureus.tab | 0 .../database/AMR_DNA-Streptococcus_pneumoniae | 0 .../AMR_DNA-Streptococcus_pneumoniae.ndb | 0 .../AMR_DNA-Streptococcus_pneumoniae.nhr | 0 .../AMR_DNA-Streptococcus_pneumoniae.nin | 0 .../AMR_DNA-Streptococcus_pneumoniae.njs | 0 .../AMR_DNA-Streptococcus_pneumoniae.not | 0 .../AMR_DNA-Streptococcus_pneumoniae.nsq | 0 .../AMR_DNA-Streptococcus_pneumoniae.ntf | 0 .../AMR_DNA-Streptococcus_pneumoniae.nto | 0 .../AMR_DNA-Streptococcus_pneumoniae.tab | 0 .../data/database/database_format_version.txt | 0 .../types/tests/data/database/fam.tab | 0 .../types/tests/data/database/taxgroup.tab | 0 .../types/tests/data/database/version.txt | 0 .../tests/test_types_formats_transformers.py | 118 --------- q2_amr/amrfinderplus/utils.py | 99 -------- q2_amr/card/database.py | 4 +- q2_amr/card/heatmap.py | 2 +- q2_amr/card/kmer.py | 4 +- q2_amr/card/mags.py | 7 +- q2_amr/card/partition.py | 4 +- q2_amr/card/reads.py | 7 +- q2_amr/card/tests/test_database.py | 5 +- q2_amr/card/tests/test_heatmap.py | 2 +- q2_amr/card/tests/test_kmer.py | 2 +- q2_amr/card/tests/test_mags.py | 2 +- q2_amr/card/tests/test_partition.py | 2 +- q2_amr/card/tests/test_reads.py | 8 +- q2_amr/card/tests/test_utils.py | 16 +- q2_amr/card/types/tests/__init__.py | 7 - q2_amr/card/utils.py | 15 +- q2_amr/citations.bib | 11 - q2_amr/plugin_setup.py | 236 +----------------- q2_amr/{card => }/types/__init__.py | 0 q2_amr/{card => }/types/_format.py | 0 q2_amr/{card => }/types/_transformer.py | 4 +- q2_amr/{card => }/types/_type.py | 0 .../tests}/__init__.py | 0 .../tests/data/61mer_analysis.allele.txt | 0 .../types/tests/data/61mer_analysis.gene.txt | 0 .../tests/data/61mer_analysis_rgi_summary.txt | 0 .../types/tests/data/DNA_fasta.fasta | 0 .../types/tests/data/DNA_fasta_-.fasta | 0 .../sample1/allele_mapping_data.txt | 0 .../sample1/overall_mapping_stats.txt | 0 .../sample1/sorted.length_100.bam | Bin .../sample2/allele_mapping_data.txt | 0 .../sample2/overall_mapping_stats.txt | 0 .../sample2/sorted.length_100.bam | Bin .../amr_annotation.json | 0 .../amr_annotation.txt | 0 .../amr_annotation.json | 0 .../amr_annotation.txt | 0 .../amr_annotation.json | 0 .../amr_annotation.txt | 0 .../sample1/gene_mapping_data.txt | 0 .../sample2/gene_mapping_data.txt | 0 .../bin1/61mer_analysis_rgi_summary.txt | 0 .../61mer_analysis.json | 0 .../61mer_analysis_rgi_summary.txt | 0 .../61mer_analysis.json | 0 .../61mer_analysis_rgi_summary.txt | 0 .../61mer_analysis.json | 0 .../61mer_analysis_rgi_summary.txt | 0 .../sample1/61mer_analysis.allele.txt | 0 .../sample1/61mer_analysis.json | 0 .../sample2/61mer_analysis.allele.txt | 0 .../sample2/61mer_analysis.json | 0 .../sample1/61mer_analysis.gene.txt | 0 .../sample2/61mer_analysis.gene.txt | 0 .../types/tests/data/card_test.json | 0 .../types/tests/data/card_test_dna.fasta | 0 .../types/tests/data/card_test_protein.fasta | 0 .../types/tests/data/empty_dict.json | 0 .../data/index-for-model-sequences-test.txt | 0 .../types/tests/data/kmer_json_test.json | 0 .../types/tests/data/kmer_txt_test.txt | 0 .../types/tests/data/mags_61mer_analysis.json | 0 .../tests/data/reads_61mer_analysis.json | 0 .../types/tests/data/rgi_output.json | 0 .../types/tests/data/rgi_output.txt | 0 .../types/tests/data/rgi_output_dna.fna | 0 .../types/tests/data/rgi_output_protein.fna | 0 .../types/tests/data/tabulated_df_allele.txt | 0 .../types/tests/data/tabulated_df_mags.txt | 0 .../tests/test_types_formats_transformers.py | 8 +- setup.py | 5 +- 219 files changed, 60 insertions(+), 1202 deletions(-) delete mode 100644 q2_amr/amrfinderplus/database.py delete mode 100644 q2_amr/amrfinderplus/sample_data.py delete mode 100644 q2_amr/amrfinderplus/tests/__init__.py delete mode 100644 q2_amr/amrfinderplus/tests/test_database.py delete mode 100644 q2_amr/amrfinderplus/tests/test_sample_data.py delete mode 100644 q2_amr/amrfinderplus/tests/test_utils.py delete mode 100644 q2_amr/amrfinderplus/types/__init__.py delete mode 100644 q2_amr/amrfinderplus/types/_format.py delete mode 100644 q2_amr/amrfinderplus/types/_type.py delete mode 100644 q2_amr/amrfinderplus/types/tests/__init__.py delete mode 100644 q2_amr/amrfinderplus/types/tests/data/annotation/coordinates/e026af61-d911-4de3-a957-7e8bf837f30d_amr_annotations.tsv delete mode 100644 q2_amr/amrfinderplus/types/tests/data/annotation/no_coordinates/aa447c99-ecd9-4c4a-a53b-4df6999815dd_amr_annotations.tsv delete mode 100644 q2_amr/amrfinderplus/types/tests/data/annotation_wrong/amr_annotation.tsv delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR.LIB delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR.LIB.h3f delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR.LIB.h3i delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR.LIB.h3m delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR.LIB.h3p delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMRProt delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMRProt-mutation.tab delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMRProt-suppress delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMRProt-susceptible.tab delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMRProt.pdb delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMRProt.phr delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMRProt.pin delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMRProt.pjs delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMRProt.pot delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMRProt.psq delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMRProt.ptf delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMRProt.pto delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii.ndb delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii.nhr delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii.nin delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii.njs delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii.not delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii.nsq delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii.ntf delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii.nto delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii.tab delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter.ndb delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter.nhr delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter.nin delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter.njs delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter.not delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter.nsq delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter.ntf delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter.nto delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter.tab delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile.ndb delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile.nhr delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile.nin delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile.njs delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile.not delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile.nsq delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile.ntf delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile.nto delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile.tab delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis.ndb delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis.nhr delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis.nin delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis.njs delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis.not delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis.nsq delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis.ntf delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis.nto delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis.tab delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium.ndb delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium.nhr delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium.nin delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium.njs delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium.not delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium.nsq delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium.ntf delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium.nto delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium.tab delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia.ndb delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia.nhr delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia.nin delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia.njs delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia.not delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia.nsq delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia.ntf delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia.nto delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia.tab delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca.ndb delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca.nhr delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca.nin delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca.njs delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca.not delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca.nsq delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca.ntf delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca.nto delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca.tab delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae.ndb delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae.nhr delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae.nin delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae.njs delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae.not delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae.nsq delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae.ntf delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae.nto delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae.tab delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella.ndb delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella.nhr delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella.nin delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella.njs delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella.not delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella.nsq delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella.ntf delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella.nto delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella.tab delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus.ndb delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus.nhr delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus.nin delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus.njs delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus.not delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus.nsq delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus.ntf delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus.nto delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus.tab delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae.ndb delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae.nhr delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae.nin delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae.njs delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae.not delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae.nsq delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae.ntf delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae.nto delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae.tab delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/database_format_version.txt delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/fam.tab delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/taxgroup.tab delete mode 100644 q2_amr/amrfinderplus/types/tests/data/database/version.txt delete mode 100644 q2_amr/amrfinderplus/types/tests/test_types_formats_transformers.py delete mode 100644 q2_amr/amrfinderplus/utils.py delete mode 100644 q2_amr/card/types/tests/__init__.py rename q2_amr/{card => }/types/__init__.py (100%) rename q2_amr/{card => }/types/_format.py (100%) rename q2_amr/{card => }/types/_transformer.py (98%) rename q2_amr/{card => }/types/_type.py (100%) rename q2_amr/{amrfinderplus => types/tests}/__init__.py (100%) rename q2_amr/{card => }/types/tests/data/61mer_analysis.allele.txt (100%) rename q2_amr/{card => }/types/tests/data/61mer_analysis.gene.txt (100%) rename q2_amr/{card => }/types/tests/data/61mer_analysis_rgi_summary.txt (100%) rename q2_amr/{card => }/types/tests/data/DNA_fasta.fasta (100%) rename q2_amr/{card => }/types/tests/data/DNA_fasta_-.fasta (100%) rename q2_amr/{card => }/types/tests/data/card_allele_annotation/sample1/allele_mapping_data.txt (100%) rename q2_amr/{card => }/types/tests/data/card_allele_annotation/sample1/overall_mapping_stats.txt (100%) rename q2_amr/{card => }/types/tests/data/card_allele_annotation/sample1/sorted.length_100.bam (100%) rename q2_amr/{card => }/types/tests/data/card_allele_annotation/sample2/allele_mapping_data.txt (100%) rename q2_amr/{card => }/types/tests/data/card_allele_annotation/sample2/overall_mapping_stats.txt (100%) rename q2_amr/{card => }/types/tests/data/card_allele_annotation/sample2/sorted.length_100.bam (100%) rename q2_amr/{card => }/types/tests/data/card_annotation/sample1/e026af61-d911-4de3-a957-7e8bf837f30d/amr_annotation.json (100%) rename q2_amr/{card => }/types/tests/data/card_annotation/sample1/e026af61-d911-4de3-a957-7e8bf837f30d/amr_annotation.txt (100%) rename q2_amr/{card => }/types/tests/data/card_annotation/sample2/aa447c99-ecd9-4c4a-a53b-4df6999815dd/amr_annotation.json (100%) rename q2_amr/{card => }/types/tests/data/card_annotation/sample2/aa447c99-ecd9-4c4a-a53b-4df6999815dd/amr_annotation.txt (100%) rename q2_amr/{card => }/types/tests/data/card_annotation/sample2/f5a16381-ea80-49f9-875e-620f333a9293/amr_annotation.json (100%) rename q2_amr/{card => }/types/tests/data/card_annotation/sample2/f5a16381-ea80-49f9-875e-620f333a9293/amr_annotation.txt (100%) rename q2_amr/{card => }/types/tests/data/card_gene_annotation/sample1/gene_mapping_data.txt (100%) rename q2_amr/{card => }/types/tests/data/card_gene_annotation/sample2/gene_mapping_data.txt (100%) rename q2_amr/{card => }/types/tests/data/card_kmer_analysis_mags/sample1/bin1/61mer_analysis_rgi_summary.txt (100%) rename q2_amr/{card => }/types/tests/data/card_kmer_analysis_mags/sample1/e026af61-d911-4de3-a957-7e8bf837f30d/61mer_analysis.json (100%) rename q2_amr/{card => }/types/tests/data/card_kmer_analysis_mags/sample1/e026af61-d911-4de3-a957-7e8bf837f30d/61mer_analysis_rgi_summary.txt (100%) rename q2_amr/{card => }/types/tests/data/card_kmer_analysis_mags/sample2/aa447c99-ecd9-4c4a-a53b-4df6999815dd/61mer_analysis.json (100%) rename q2_amr/{card => }/types/tests/data/card_kmer_analysis_mags/sample2/aa447c99-ecd9-4c4a-a53b-4df6999815dd/61mer_analysis_rgi_summary.txt (100%) rename q2_amr/{card => }/types/tests/data/card_kmer_analysis_mags/sample2/f5a16381-ea80-49f9-875e-620f333a9293/61mer_analysis.json (100%) rename q2_amr/{card => }/types/tests/data/card_kmer_analysis_mags/sample2/f5a16381-ea80-49f9-875e-620f333a9293/61mer_analysis_rgi_summary.txt (100%) rename q2_amr/{card => }/types/tests/data/card_reads_allele_kmer_analysis/sample1/61mer_analysis.allele.txt (100%) rename q2_amr/{card => }/types/tests/data/card_reads_allele_kmer_analysis/sample1/61mer_analysis.json (100%) rename q2_amr/{card => }/types/tests/data/card_reads_allele_kmer_analysis/sample2/61mer_analysis.allele.txt (100%) rename q2_amr/{card => }/types/tests/data/card_reads_allele_kmer_analysis/sample2/61mer_analysis.json (100%) rename q2_amr/{card => }/types/tests/data/card_reads_gene_kmer_analysis/sample1/61mer_analysis.gene.txt (100%) rename q2_amr/{card => }/types/tests/data/card_reads_gene_kmer_analysis/sample2/61mer_analysis.gene.txt (100%) rename q2_amr/{card => }/types/tests/data/card_test.json (100%) rename q2_amr/{card => }/types/tests/data/card_test_dna.fasta (100%) rename q2_amr/{card => }/types/tests/data/card_test_protein.fasta (100%) rename q2_amr/{card => }/types/tests/data/empty_dict.json (100%) rename q2_amr/{card => }/types/tests/data/index-for-model-sequences-test.txt (100%) rename q2_amr/{card => }/types/tests/data/kmer_json_test.json (100%) rename q2_amr/{card => }/types/tests/data/kmer_txt_test.txt (100%) rename q2_amr/{card => }/types/tests/data/mags_61mer_analysis.json (100%) rename q2_amr/{card => }/types/tests/data/reads_61mer_analysis.json (100%) rename q2_amr/{card => }/types/tests/data/rgi_output.json (100%) rename q2_amr/{card => }/types/tests/data/rgi_output.txt (100%) rename q2_amr/{card => }/types/tests/data/rgi_output_dna.fna (100%) rename q2_amr/{card => }/types/tests/data/rgi_output_protein.fna (100%) rename q2_amr/{card => }/types/tests/data/tabulated_df_allele.txt (100%) rename q2_amr/{card => }/types/tests/data/tabulated_df_mags.txt (100%) rename q2_amr/{card => }/types/tests/test_types_formats_transformers.py (99%) diff --git a/README.md b/README.md index 6e11d85..ca81dbd 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ To install _q2-amr_, follow the steps described below. mamba create -yn q2-amr \ -c https://packages.qiime2.org/qiime2/2024.2/shotgun/released/ \ -c qiime2 -c conda-forge -c bioconda -c defaults \ - qiime2 q2cli q2templates q2-types q2-feature-table q2-demux rgi tqdm ncbi-amrfinderplus + qiime2 q2cli q2templates q2-types q2-feature-table q2-demux rgi tqdm conda activate q2-amr @@ -38,7 +38,7 @@ qiime info CONDA_SUBDIR=osx-64 mamba create -yn q2-amr \ -c https://packages.qiime2.org/qiime2/2024.2/shotgun/released/ \ -c qiime2 -c conda-forge -c bioconda -c defaults \ - qiime2 q2cli q2templates q2-types q2-feature-table q2-demux rgi tqdm ncbi-amrfinderplus + qiime2 q2cli q2templates q2-types q2-feature-table q2-demux rgi tqdm conda activate q2-amr conda config --env --set subdir osx-64 @@ -57,20 +57,19 @@ qiime info ## Functionality This QIIME 2 plugin contains actions used to annotate short single/paired-end -sequencing reads and MAGs with antimicrobial resistance genes. Currently, the tools [RGI](https://github.com/arpcard/rgi) and [AMRFinderPlus](https://github.com/ncbi/amr) are supported (for details on -the implementation and usage, please refer to the documentation of the tools). Below you will +sequencing reads and MAGs with antimicrobial resistance genes. Currently, the [CARD](https://card.mcmaster.ca) database is supported (for details on +the implementation and usage, please refer to the [RGI](https://github.com/arpcard/rgi) documentation). Below you will find an overview of actions available in the plugin. -| Action | Description | Underlying tool | Used function | -|-------------------------|--------------------------------------------------------------------------------------|----------------------------------------------|--------------------------------------| -| fetch-card-db | Download and preprocess CARD and WildCARD data. | [rgi](https://github.com/arpcard/rgi) | card_annotation, wildcard_annotation | -| annotate-mags-card | Annotate MAGs with antimicrobial resistance gene information from CARD. | [rgi](https://github.com/arpcard/rgi) | main, load | -| annotate-reads-card | Annotate metagenomic reads with antimicrobial resistance gene information from CARD. | [rgi](https://github.com/arpcard/rgi) | bwt, load | -| heatmap | Create a heatmap from annotate-mags-card output files. | [rgi](https://github.com/arpcard/rgi) | heatmap | -| kmer-query-mags-card | Pathogen-of-origin prediction for ARGs in MAGs. | [rgi](https://github.com/arpcard/rgi) | kmer-query, load | -| kmer-query-reads-card | Pathogen-of-origin prediction for ARGs in reads. | [rgi](https://github.com/arpcard/rgi) | kmer-query, load | -| kmer-build-card | Build a kmer database with a custom kmer length. | [rgi](https://github.com/arpcard/rgi) | kmer-build | -| fetch-amrfinderplus-db | Download AMRFinderPlus database. | [AMRFinderPlus](https://github.com/ncbi/amr) | -u | +| Action | Description | Underlying tool | Used function | +|-----------------------|--------------------------------------------------------------------------------------|---------------------------------------|--------------------------------------| +| fetch-card-db | Download and preprocess CARD and WildCARD data. | [RGI](https://github.com/arpcard/rgi) | card_annotation, wildcard_annotation | +| annotate-mags-card | Annotate MAGs with antimicrobial resistance gene information from CARD. | [RGI](https://github.com/arpcard/rgi) | main, load | +| annotate-reads-card | Annotate metagenomic reads with antimicrobial resistance gene information from CARD. | [RGI](https://github.com/arpcard/rgi) | bwt, load | +| heatmap | Create a heatmap from annotate-mags-card output files. | [RGI](https://github.com/arpcard/rgi) | heatmap | +| kmer-query-mags-card | Pathogen-of-origin prediction for ARGs in MAGs. | [RGI](https://github.com/arpcard/rgi) | kmer-query, load | +| kmer-query-reads-card | Pathogen-of-origin prediction for ARGs in reads. | [RGI](https://github.com/arpcard/rgi) | kmer-query, load | +| kmer-build-card | Build a kmer database with a custom kmer length. | [RGI](https://github.com/arpcard/rgi) | kmer-build | ## Dev environment This repository follows the _black_ code style. To make the development slightly easier diff --git a/ci/recipe/meta.yaml b/ci/recipe/meta.yaml index d5cb647..97fc1bd 100644 --- a/ci/recipe/meta.yaml +++ b/ci/recipe/meta.yaml @@ -17,7 +17,6 @@ requirements: - setuptools run: - - ncbi-amrfinderplus - python=3.8.* - qiime2 {{ qiime2_epoch }}.* - q2-demux {{ qiime2_epoch }}.* diff --git a/q2_amr/amrfinderplus/database.py b/q2_amr/amrfinderplus/database.py deleted file mode 100644 index 01bb599..0000000 --- a/q2_amr/amrfinderplus/database.py +++ /dev/null @@ -1,50 +0,0 @@ -import os -import re -import subprocess - -from qiime2.util import duplicate - -from q2_amr.amrfinderplus.types import AMRFinderPlusDatabaseDirFmt -from q2_amr.card.utils import run_command - - -def fetch_amrfinderplus_db() -> AMRFinderPlusDatabaseDirFmt: - amrfinderplus_db = AMRFinderPlusDatabaseDirFmt() - - # Run "amrfinder -u" command that downloads the database - run_amrfinder_u() - - # Define path where the database will be downloaded to - conda_prefix = os.getenv("CONDA_PREFIX") - amrfinder_db_path = os.path.join( - conda_prefix, "share", "amrfinderplus", "data", "latest" - ) - - # Copy all files from amrfinder_db_path to database directory format - _copy_all(amrfinder_db_path, amrfinderplus_db.path) - - return amrfinderplus_db - - -def _copy_all(src_dir, des_dir): - regex = re.compile(r".*(?:AMR_CDS|changes).*") - # Loop over all files in the source directory - for file in os.listdir(src_dir): - # Check if the filename does not match the regex pattern and copy the file - # from src to des. Files matching the pattern are not needed for the database. - if not regex.match(file): - duplicate(os.path.join(src_dir, file), os.path.join(des_dir, file)) - - -def run_amrfinder_u(): - # The command "amrfinder -u" downloads the latest amrfinderplus database or - # updates it - cmd = ["amrfinder", "-u"] - try: - run_command(cmd, verbose=True) - except subprocess.CalledProcessError as e: - raise Exception( - "An error was encountered while running AMRFinderPlus, " - f"(return code {e.returncode}), please inspect " - "stdout and stderr to learn more." - ) diff --git a/q2_amr/amrfinderplus/sample_data.py b/q2_amr/amrfinderplus/sample_data.py deleted file mode 100644 index 06de759..0000000 --- a/q2_amr/amrfinderplus/sample_data.py +++ /dev/null @@ -1,130 +0,0 @@ -import os -import shutil -import tempfile -from typing import Union - -import pandas as pd -from q2_types.genome_data import GenesDirectoryFormat -from q2_types.per_sample_sequences import ContigSequencesDirFmt, MultiMAGSequencesDirFmt - -from q2_amr.amrfinderplus.types import ( - AMRFinderPlusAnnotationsDirFmt, - AMRFinderPlusDatabaseDirFmt, -) -from q2_amr.amrfinderplus.utils import run_amrfinderplus_n -from q2_amr.card.utils import create_count_table, read_in_txt - - -def annotate_sample_data_amrfinderplus( - sequences: Union[MultiMAGSequencesDirFmt, ContigSequencesDirFmt], - amrfinderplus_db: AMRFinderPlusDatabaseDirFmt, - organism: str = None, - plus: bool = False, - report_all_equal: bool = False, - ident_min: float = None, - curated_ident: bool = False, - coverage_min: float = 0.5, - translation_table: str = "11", - report_common: bool = False, - gpipe_org: bool = False, - threads: int = None, -) -> ( - AMRFinderPlusAnnotationsDirFmt, - AMRFinderPlusAnnotationsDirFmt, - GenesDirectoryFormat, - pd.DataFrame, -): - amr_annotations = AMRFinderPlusAnnotationsDirFmt() - amr_all_mutations = AMRFinderPlusAnnotationsDirFmt() - amr_genes = GenesDirectoryFormat() - frequency_list = [] - - # Create list of paths to all mags or contigs - if isinstance(sequences, MultiMAGSequencesDirFmt): - manifest = sequences.manifest.view(pd.DataFrame) - files = manifest["filename"] - else: - files = [ - os.path.join(str(sequences), file) for file in os.listdir(str(sequences)) - ] - - with tempfile.TemporaryDirectory() as tmp: - # Iterate over paths of MAGs or contigs - for file in files: - # Set sample and MAG IDs - if isinstance(sequences, MultiMAGSequencesDirFmt): - index_value = manifest.query("filename == @file").index[0] - sample_id = index_value[0] - mag_id = index_value[1] - else: - sample_id = os.path.splitext(os.path.basename(file))[0][:-8] - mag_id = "" - - # Run amrfinderplus - run_amrfinderplus_n( - working_dir=tmp, - amrfinderplus_db=amrfinderplus_db, - dna_sequences=file, - protein_sequences=None, - gff=None, - organism=organism, - plus=plus, - report_all_equal=report_all_equal, - ident_min=ident_min, - curated_ident=curated_ident, - coverage_min=coverage_min, - translation_table=translation_table, - annotation_format=None, - report_common=report_common, - gpipe_org=gpipe_org, - threads=threads, - ) - - # Create frequency dataframe and append it to list - frequency_df = read_in_txt( - path=os.path.join(tmp, "amr_annotations.tsv"), - samp_bin_name=str(os.path.join(sample_id, mag_id)), - data_type="mags", - colname="Gene symbol", - ) - frequency_list.append(frequency_df) - - # Move mutations file. If it is not created, create an empty mutations file - des_path_mutations = os.path.join( - str(amr_all_mutations), - sample_id, - f"{mag_id + '_' if mag_id else ''}amr_all_mutations.tsv", - ) - os.makedirs(os.path.dirname(des_path_mutations), exist_ok=True) - if organism: - shutil.move( - os.path.join(tmp, "amr_all_mutations.tsv"), des_path_mutations - ) - else: - with open(des_path_mutations, "w"): - pass - - # Move annotations file - des_path_annotations = os.path.join( - str(amr_annotations), - sample_id, - f"{mag_id + '_' if mag_id else ''}amr_annotations.tsv", - ) - os.makedirs(os.path.dirname(des_path_annotations), exist_ok=True) - shutil.move(os.path.join(tmp, "amr_annotations.tsv"), des_path_annotations) - - # Move genes file - shutil.move( - os.path.join(tmp, "amr_genes.fasta"), - os.path.join( - str(amr_genes), f"{mag_id if mag_id else sample_id}_amr_genes.fasta" - ), - ) - - feature_table = create_count_table(df_list=frequency_list) - return ( - amr_annotations, - amr_all_mutations, - amr_genes, - feature_table, - ) diff --git a/q2_amr/amrfinderplus/tests/__init__.py b/q2_amr/amrfinderplus/tests/__init__.py deleted file mode 100644 index bc9c3d2..0000000 --- a/q2_amr/amrfinderplus/tests/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# ---------------------------------------------------------------------------- -# Copyright (c) 2019-2023, QIIME 2 development team. -# -# Distributed under the terms of the Modified BSD License. -# -# The full license is in the file LICENSE, distributed with this software. -# ---------------------------------------------------------------------------- diff --git a/q2_amr/amrfinderplus/tests/test_database.py b/q2_amr/amrfinderplus/tests/test_database.py deleted file mode 100644 index b2de150..0000000 --- a/q2_amr/amrfinderplus/tests/test_database.py +++ /dev/null @@ -1,52 +0,0 @@ -import os -import subprocess -from unittest.mock import patch - -from qiime2.plugin.testing import TestPluginBase - -from q2_amr.amrfinderplus.database import ( - _copy_all, - fetch_amrfinderplus_db, - run_amrfinder_u, -) - - -class TestFetchAMRFinderPlusDB(TestPluginBase): - package = "q2_amr.amrfinderplus.tests" - - @patch("q2_amr.amrfinderplus.database.run_amrfinder_u") - @patch("q2_amr.amrfinderplus.database._copy_all") - def test_fetch_amrfinderplus_db(self, mock_run_amrfinder_u, mock__copy_all): - fetch_amrfinderplus_db() - - @patch("q2_amr.amrfinderplus.database.run_command") - def test_run_amrfinder_u(self, mock_run_command): - run_amrfinder_u() - mock_run_command.assert_called_once_with( - ["amrfinder", "-u"], - verbose=True, - ) - - @patch("q2_amr.amrfinderplus.database.run_command") - def test_run_amrfinder_u_error(self, mock_run_command): - expected_message = ( - "An error was encountered while running AMRFinderPlus, " - "(return code 1), please inspect stdout and stderr to learn more." - ) - mock_run_command.side_effect = subprocess.CalledProcessError(1, "cmd") - with self.assertRaises(Exception) as cm: - run_amrfinder_u() - self.assertEqual(str(cm.exception), expected_message) - - def test__copy_all(self): - tmp = self.temp_dir.name - os.mkdir(os.path.join(tmp, "src")) - os.mkdir(os.path.join(tmp, "des")) - - with open(os.path.join(tmp, "src", "a"), "w"), open( - os.path.join(tmp, "src", "AMR_CDS.nto"), "w" - ): - pass - - _copy_all(os.path.join(tmp, "src"), os.path.join(tmp, "des")) - self.assertTrue(os.path.exists(os.path.join(tmp, "des", "a"))) diff --git a/q2_amr/amrfinderplus/tests/test_sample_data.py b/q2_amr/amrfinderplus/tests/test_sample_data.py deleted file mode 100644 index 9d4557b..0000000 --- a/q2_amr/amrfinderplus/tests/test_sample_data.py +++ /dev/null @@ -1,104 +0,0 @@ -import os -from unittest.mock import MagicMock, patch - -from q2_types.per_sample_sequences import ContigSequencesDirFmt, MultiMAGSequencesDirFmt -from qiime2.plugin.testing import TestPluginBase - -from q2_amr.amrfinderplus.sample_data import annotate_sample_data_amrfinderplus -from q2_amr.amrfinderplus.types import AMRFinderPlusDatabaseDirFmt - - -class TestAnnotateSampleDataAMRFinderPlus(TestPluginBase): - package = "q2_amr.amrfinderplus.tests" - - def mock_run_amrfinderplus_n( - self, - working_dir, - amrfinderplus_db, - dna_sequences, - protein_sequences, - gff, - organism, - plus, - report_all_equal, - ident_min, - curated_ident, - coverage_min, - translation_table, - annotation_format, - report_common, - gpipe_org, - threads, - ): - with open(os.path.join(working_dir, "amr_annotations.tsv"), "w"): - pass - if organism: - with open(os.path.join(working_dir, "amr_all_mutations.tsv"), "w"): - pass - if dna_sequences: - with open(os.path.join(working_dir, "amr_genes.fasta"), "w"): - pass - - files_contigs = [ - "amr_annotations.tsv", - "amr_all_mutations.tsv", - "sample1_amr_genes.fasta", - ] - - files_mags = [ - "mag1_amr_annotations.tsv", - "mag1_amr_all_mutations.tsv", - "mag1_amr_genes.fasta", - ] - - def test_annotate_sample_data_amrfinderplus_mags(self): - sequences = MultiMAGSequencesDirFmt() - with open(os.path.join(str(sequences), "MANIFEST"), "w") as file: - file.write("sample-id,mag-id,filename\nsample1,mag1,sample1/mag1.fasta\n") - self._helper(sequences=sequences, organism=None, files=self.files_mags) - - def test_annotate_sample_data_amrfinderplus_mags_organism(self): - sequences = MultiMAGSequencesDirFmt() - with open(os.path.join(str(sequences), "MANIFEST"), "w") as file: - file.write("sample-id,mag-id,filename\nsample1,mag1,sample1/mag1.fasta\n") - self._helper(sequences, "Escherichia", files=self.files_mags) - - def test_annotate_sample_data_amrfinderplus_contigs(self): - sequences = ContigSequencesDirFmt() - with open(os.path.join(str(sequences), "sample1_contigs.fasta"), "w"): - pass - self._helper(sequences=sequences, organism=None, files=self.files_contigs) - - def test_annotate_sample_data_amrfinderplus_contigs_organism(self): - sequences = ContigSequencesDirFmt() - with open(os.path.join(str(sequences), "sample1_contigs.fasta"), "w"): - pass - self._helper( - sequences=sequences, organism="Escherichia", files=self.files_contigs - ) - - def _helper(self, sequences, organism, files): - amrfinderplus_db = AMRFinderPlusDatabaseDirFmt() - mock_create_count_table = MagicMock() - mock_read_in_txt = MagicMock() - with patch( - "q2_amr.amrfinderplus.sample_data.run_amrfinderplus_n", - side_effect=self.mock_run_amrfinderplus_n, - ), patch( - "q2_amr.amrfinderplus.sample_data.read_in_txt", mock_read_in_txt - ), patch( - "q2_amr.amrfinderplus.sample_data.create_count_table", - mock_create_count_table, - ): - result = annotate_sample_data_amrfinderplus( - sequences=sequences, - amrfinderplus_db=amrfinderplus_db, - organism=organism, - ) - self.assertTrue( - os.path.exists(os.path.join(str(result[0]), "sample1", files[0])) - ) - self.assertTrue( - os.path.exists(os.path.join(str(result[1]), "sample1", files[1])) - ) - self.assertTrue(os.path.exists(os.path.join(str(result[2]), files[2]))) diff --git a/q2_amr/amrfinderplus/tests/test_utils.py b/q2_amr/amrfinderplus/tests/test_utils.py deleted file mode 100644 index 0bd6b73..0000000 --- a/q2_amr/amrfinderplus/tests/test_utils.py +++ /dev/null @@ -1,151 +0,0 @@ -from unittest.mock import patch - -from qiime2.plugin.testing import TestPluginBase - -from q2_amr.amrfinderplus.utils import run_amrfinderplus_n - - -class TestAnnotateMagsCard(TestPluginBase): - package = "q2_amr.amrfinderplus.tests" - - @patch("q2_amr.amrfinderplus.utils.run_command") - def test_run_amrfinderplus_n(self, mock_run_command): - run_amrfinderplus_n( - working_dir="path_dir", - amrfinderplus_db="amrfinderplus_db", - dna_sequences="dna_sequences", - protein_sequences="protein_sequences", - gff="gff", - organism="Escherichia", - plus=True, - report_all_equal=True, - ident_min=1, - curated_ident=False, - coverage_min=1, - translation_table="11", - annotation_format="prodigal", - report_common=True, - gpipe_org=True, - threads=4, - ) - mock_run_command.assert_called_once_with( - [ - "amrfinder", - "--database", - "amrfinderplus_db", - "-o", - "path_dir/amr_annotations.tsv", - "--print_node", - "-n", - "dna_sequences", - "--nucleotide_output", - "path_dir/amr_genes.fasta", - "-p", - "protein_sequences", - "--protein_output", - "path_dir/amr_proteins.fasta", - "-g", - "gff", - "--threads", - "4", - "--organism", - "Escherichia", - "--mutation_all", - "path_dir/amr_all_mutations.tsv", - "--plus", - "--report_all_equal", - "--ident_min", - "1", - "--coverage_min", - "1", - "--translation_table", - "11", - "--annotation_format", - "prodigal", - "--report_common", - "--gpipe_org", - ], - "path_dir", - verbose=True, - ) - - @patch("q2_amr.amrfinderplus.utils.run_command") - def test_run_amrfinderplus_n_minimal(self, mock_run_command): - run_amrfinderplus_n( - working_dir="path_dir", - amrfinderplus_db="amrfinderplus_db", - dna_sequences=None, - protein_sequences=None, - gff=None, - organism=None, - plus=False, - report_all_equal=False, - ident_min=None, - curated_ident=True, - coverage_min=None, - translation_table=None, - annotation_format=None, - report_common=False, - gpipe_org=False, - threads=None, - ) - mock_run_command.assert_called_once_with( - [ - "amrfinder", - "--database", - "amrfinderplus_db", - "-o", - "path_dir/amr_annotations.tsv", - "--print_node", - "--ident_min", - "-1", - ], - "path_dir", - verbose=True, - ) - - @patch("q2_amr.amrfinderplus.utils.run_command") - def test_run_amrfinderplus_n_value_error_report_common(self, mock_run_command): - with self.assertRaisesRegex( - ValueError, "--p-report-common requires " "--p-plus and --p-organism" - ): - run_amrfinderplus_n( - working_dir="path_dir", - amrfinderplus_db="amrfinderplus_db", - dna_sequences=None, - protein_sequences=None, - gff=None, - organism=None, - plus=False, - report_all_equal=False, - ident_min=None, - curated_ident=True, - coverage_min=None, - translation_table=None, - annotation_format=None, - report_common=True, - gpipe_org=False, - threads=None, - ) - - @patch("q2_amr.amrfinderplus.utils.run_command") - def test_run_amrfinderplus_n_value_error_gpipe_org(self, mock_run_command): - with self.assertRaisesRegex(ValueError, "--p-gpipe_org requires --p-organism"): - run_amrfinderplus_n( - working_dir="path_dir", - amrfinderplus_db="amrfinderplus_db", - dna_sequences=None, - protein_sequences=None, - gff=None, - organism=None, - plus=False, - report_all_equal=False, - ident_min=None, - curated_ident=True, - coverage_min=None, - translation_table=None, - annotation_format=None, - report_common=False, - gpipe_org=True, - threads=None, - ) diff --git a/q2_amr/amrfinderplus/types/__init__.py b/q2_amr/amrfinderplus/types/__init__.py deleted file mode 100644 index 8dfb549..0000000 --- a/q2_amr/amrfinderplus/types/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# ---------------------------------------------------------------------------- -# Copyright (c) 2019-2023, QIIME 2 development team. -# -# Distributed under the terms of the Modified BSD License. -# -# The full license is in the file LICENSE, distributed with this software. -# ---------------------------------------------------------------------------- -from q2_amr.amrfinderplus.types._format import ( - AMRFinderPlusAnnotationFormat, - AMRFinderPlusAnnotationsDirFmt, - AMRFinderPlusDatabaseDirFmt, - BinaryFormat, - TextFormat, -) - -__all__ = [ - "AMRFinderPlusDatabaseDirFmt", - "AMRFinderPlusAnnotationFormat", - "AMRFinderPlusAnnotationsDirFmt", - "TextFormat", - "BinaryFormat", -] diff --git a/q2_amr/amrfinderplus/types/_format.py b/q2_amr/amrfinderplus/types/_format.py deleted file mode 100644 index bcda9e8..0000000 --- a/q2_amr/amrfinderplus/types/_format.py +++ /dev/null @@ -1,120 +0,0 @@ -# ---------------------------------------------------------------------------- -# Copyright (c) 2019-2023, QIIME 2 development team. -# -# Distributed under the terms of the Modified BSD License. -# -# The full license is in the file LICENSE, distributed with this software. -# ---------------------------------------------------------------------------- -import os - -import pandas as pd -from q2_types.feature_data import MixedCaseDNAFASTAFormat, ProteinFASTAFormat -from qiime2.core.exceptions import ValidationError -from qiime2.plugin import model - - -class TextFormat(model.TextFileFormat): - def _validate_(self, level): - pass - - -class BinaryFormat(model.BinaryFileFormat): - def _validate_(self, level): - pass - - -class AMRFinderPlusDatabaseDirFmt(model.DirectoryFormat): - amr_lib = model.File("AMR.LIB", format=TextFormat) - amr_lib_comp = model.FileCollection(r"^AMR\.LIB\.h3.$", format=BinaryFormat) - amrprot = model.File("AMRProt", format=ProteinFASTAFormat) - amrprot_blast = model.FileCollection(r"^AMRProt\.p..$", format=BinaryFormat) - amrprot_mutation = model.File("AMRProt-mutation.tab", format=TextFormat) - amrprot_suppress = model.File("AMRProt-suppress", format=TextFormat) - amrprot_susceptible = model.File("AMRProt-susceptible.tab", format=TextFormat) - fam = model.File("fam.tab", format=TextFormat) - taxgroup = model.File("taxgroup.tab", format=TextFormat) - version = model.File("version.txt", format=TextFormat) - db_fmt_version = model.File("database_format_version.txt", format=TextFormat) - amr_dna = model.FileCollection( - r"^AMR_DNA-[a-zA-Z_]+$", format=MixedCaseDNAFASTAFormat - ) - amr_dna_comp = model.FileCollection( - r"^AMR_DNA-[a-zA-Z_]+\.n..$", format=BinaryFormat - ) - amr_dna_tab = model.FileCollection(r"^AMR_DNA-[a-zA-Z_]+\.tab$", format=TextFormat) - - @amr_lib_comp.set_path_maker - def amr_lib_comp_path_maker(self, extension): - return "AMR.LIB.%s" % extension - - @amrprot_blast.set_path_maker - def amrprot_blast_path_maker(self, extension): - return "AMRProt.%s" % extension - - @amr_dna.set_path_maker - def amr_dna_path_maker(self, species): - return "AMR_DNA-%s" % species - - @amr_dna_comp.set_path_maker - def amr_dna_comp_path_maker(self, species, extension): - return "AMR_DNA-%s.%s" % species, extension - - @amr_dna_tab.set_path_maker - def amr_dna_tab_path_maker(self, species): - return "AMR_DNA-%s.tab" % species - - -class AMRFinderPlusAnnotationFormat(model.TextFileFormat): - def _validate(self): - header_coordinates = [ - "Protein identifier", - "Contig id", - "Start", - "Stop", - "Strand", - "Gene symbol", - "Sequence name", - "Scope", - "Element type", - "Element subtype", - "Class", - "Subclass", - "Method", - "Target length", - "Reference sequence length", - "% Coverage of reference sequence", - "% Identity to reference sequence", - "Alignment length", - "Accession of closest sequence", - "Name of closest sequence", - "HMM id", - "HMM description", - "Hierarchy node", - ] - header = header_coordinates[:1] + header_coordinates[5:] - try: - header_obs = pd.read_csv(str(self), sep="\t", nrows=0).columns.tolist() - if header != header_obs and header_coordinates != header_obs: - raise ValidationError( - "Header line does not match AMRFinderPlusAnnotationFormat. Must " - "consist of the following values: " - + ", ".join(header_coordinates) - + ".\n\nWhile Contig id, Start, Stop and Strand are optional." - + "\n\nFound instead: " - + ", ".join(header_obs) - ) - except pd.errors.EmptyDataError: - pass - - def _validate_(self, level): - self._validate() - - -class AMRFinderPlusAnnotationsDirFmt(model.DirectoryFormat): - annotations = model.FileCollection( - r".*amr_(annotations|all_mutations)\.tsv$", format=AMRFinderPlusAnnotationFormat - ) - - @annotations.set_path_maker - def annotations_path_maker(self, name, id, dir_name=""): - return os.path.join(dir_name, f"{id}_amr_{name}.tsv") diff --git a/q2_amr/amrfinderplus/types/_type.py b/q2_amr/amrfinderplus/types/_type.py deleted file mode 100644 index 5cc2f5e..0000000 --- a/q2_amr/amrfinderplus/types/_type.py +++ /dev/null @@ -1,16 +0,0 @@ -# ---------------------------------------------------------------------------- -# Copyright (c) 2019-2023, QIIME 2 development team. -# -# Distributed under the terms of the Modified BSD License. -# -# The full license is in the file LICENSE, distributed with this software. -# ---------------------------------------------------------------------------- -from q2_types.feature_data import FeatureData -from q2_types.sample_data import SampleData -from qiime2.core.type import SemanticType - -AMRFinderPlusDatabase = SemanticType("AMRFinderPlusDatabase") -AMRFinderPlusAnnotations = SemanticType( - "AMRFinderPlusAnnotations", - variant_of=[SampleData.field["type"], FeatureData.field["type"]], -) diff --git a/q2_amr/amrfinderplus/types/tests/__init__.py b/q2_amr/amrfinderplus/types/tests/__init__.py deleted file mode 100644 index bc9c3d2..0000000 --- a/q2_amr/amrfinderplus/types/tests/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# ---------------------------------------------------------------------------- -# Copyright (c) 2019-2023, QIIME 2 development team. -# -# Distributed under the terms of the Modified BSD License. -# -# The full license is in the file LICENSE, distributed with this software. -# ---------------------------------------------------------------------------- diff --git a/q2_amr/amrfinderplus/types/tests/data/annotation/coordinates/e026af61-d911-4de3-a957-7e8bf837f30d_amr_annotations.tsv b/q2_amr/amrfinderplus/types/tests/data/annotation/coordinates/e026af61-d911-4de3-a957-7e8bf837f30d_amr_annotations.tsv deleted file mode 100644 index 20e52d1..0000000 --- a/q2_amr/amrfinderplus/types/tests/data/annotation/coordinates/e026af61-d911-4de3-a957-7e8bf837f30d_amr_annotations.tsv +++ /dev/null @@ -1,3 +0,0 @@ -Protein identifier Gene symbol Sequence name Scope Element type Element subtype Class Subclass Method Target length Reference sequence length % Coverage of reference sequence % Identity to reference sequence Alignment length Accession of closest sequence Name of closest sequence HMM id HMM description Hierarchy node -aph3pp-Ib_partial_5p_neg aph(3'')-Ib aminoglycoside O-phosphotransferase APH(3'')-Ib core AMR AMR AMINOGLYCOSIDE STREPTOMYCIN PARTIALP 225 267 81.27 100.00 217 WP_001082319.1 aminoglycoside O-phosphotransferase APH(3'')-Ib NF032896.1 APH(3'') family aminoglycoside O-phosphotransferase aph(3'')-Ib -blaOXA-436_partial blaOXA OXA-48 family class D beta-lactamase core AMR AMR BETA-LACTAM BETA-LACTAM PARTIALP 233 265 87.92 100.00 233 WP_058842180.1 OXA-48 family carbapenem-hydrolyzing class D beta-lactamase OXA-436 NF012161.0 class D beta-lactamase blaOXA-48_fam diff --git a/q2_amr/amrfinderplus/types/tests/data/annotation/no_coordinates/aa447c99-ecd9-4c4a-a53b-4df6999815dd_amr_annotations.tsv b/q2_amr/amrfinderplus/types/tests/data/annotation/no_coordinates/aa447c99-ecd9-4c4a-a53b-4df6999815dd_amr_annotations.tsv deleted file mode 100644 index 20e52d1..0000000 --- a/q2_amr/amrfinderplus/types/tests/data/annotation/no_coordinates/aa447c99-ecd9-4c4a-a53b-4df6999815dd_amr_annotations.tsv +++ /dev/null @@ -1,3 +0,0 @@ -Protein identifier Gene symbol Sequence name Scope Element type Element subtype Class Subclass Method Target length Reference sequence length % Coverage of reference sequence % Identity to reference sequence Alignment length Accession of closest sequence Name of closest sequence HMM id HMM description Hierarchy node -aph3pp-Ib_partial_5p_neg aph(3'')-Ib aminoglycoside O-phosphotransferase APH(3'')-Ib core AMR AMR AMINOGLYCOSIDE STREPTOMYCIN PARTIALP 225 267 81.27 100.00 217 WP_001082319.1 aminoglycoside O-phosphotransferase APH(3'')-Ib NF032896.1 APH(3'') family aminoglycoside O-phosphotransferase aph(3'')-Ib -blaOXA-436_partial blaOXA OXA-48 family class D beta-lactamase core AMR AMR BETA-LACTAM BETA-LACTAM PARTIALP 233 265 87.92 100.00 233 WP_058842180.1 OXA-48 family carbapenem-hydrolyzing class D beta-lactamase OXA-436 NF012161.0 class D beta-lactamase blaOXA-48_fam diff --git a/q2_amr/amrfinderplus/types/tests/data/annotation_wrong/amr_annotation.tsv b/q2_amr/amrfinderplus/types/tests/data/annotation_wrong/amr_annotation.tsv deleted file mode 100644 index 1f1fa8b..0000000 --- a/q2_amr/amrfinderplus/types/tests/data/annotation_wrong/amr_annotation.tsv +++ /dev/null @@ -1 +0,0 @@ -Incorrect Header 1 Incorrect Header 2 Incorrect Header 3 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR.LIB b/q2_amr/amrfinderplus/types/tests/data/database/AMR.LIB deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR.LIB.h3f b/q2_amr/amrfinderplus/types/tests/data/database/AMR.LIB.h3f deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR.LIB.h3i b/q2_amr/amrfinderplus/types/tests/data/database/AMR.LIB.h3i deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR.LIB.h3m b/q2_amr/amrfinderplus/types/tests/data/database/AMR.LIB.h3m deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR.LIB.h3p b/q2_amr/amrfinderplus/types/tests/data/database/AMR.LIB.h3p deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMRProt b/q2_amr/amrfinderplus/types/tests/data/database/AMRProt deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMRProt-mutation.tab b/q2_amr/amrfinderplus/types/tests/data/database/AMRProt-mutation.tab deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMRProt-suppress b/q2_amr/amrfinderplus/types/tests/data/database/AMRProt-suppress deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMRProt-susceptible.tab b/q2_amr/amrfinderplus/types/tests/data/database/AMRProt-susceptible.tab deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMRProt.pdb b/q2_amr/amrfinderplus/types/tests/data/database/AMRProt.pdb deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMRProt.phr b/q2_amr/amrfinderplus/types/tests/data/database/AMRProt.phr deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMRProt.pin b/q2_amr/amrfinderplus/types/tests/data/database/AMRProt.pin deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMRProt.pjs b/q2_amr/amrfinderplus/types/tests/data/database/AMRProt.pjs deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMRProt.pot b/q2_amr/amrfinderplus/types/tests/data/database/AMRProt.pot deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMRProt.psq b/q2_amr/amrfinderplus/types/tests/data/database/AMRProt.psq deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMRProt.ptf b/q2_amr/amrfinderplus/types/tests/data/database/AMRProt.ptf deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMRProt.pto b/q2_amr/amrfinderplus/types/tests/data/database/AMRProt.pto deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii.ndb b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii.ndb deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii.nhr b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii.nhr deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii.nin b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii.nin deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii.njs b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii.njs deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii.not b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii.not deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii.nsq b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii.nsq deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii.ntf b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii.ntf deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii.nto b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii.nto deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii.tab b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Acinetobacter_baumannii.tab deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter.ndb b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter.ndb deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter.nhr b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter.nhr deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter.nin b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter.nin deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter.njs b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter.njs deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter.not b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter.not deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter.nsq b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter.nsq deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter.ntf b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter.ntf deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter.nto b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter.nto deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter.tab b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Campylobacter.tab deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile.ndb b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile.ndb deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile.nhr b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile.nhr deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile.nin b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile.nin deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile.njs b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile.njs deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile.not b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile.not deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile.nsq b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile.nsq deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile.ntf b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile.ntf deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile.nto b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile.nto deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile.tab b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Clostridioides_difficile.tab deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis.ndb b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis.ndb deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis.nhr b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis.nhr deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis.nin b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis.nin deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis.njs b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis.njs deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis.not b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis.not deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis.nsq b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis.nsq deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis.ntf b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis.ntf deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis.nto b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis.nto deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis.tab b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecalis.tab deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium.ndb b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium.ndb deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium.nhr b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium.nhr deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium.nin b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium.nin deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium.njs b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium.njs deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium.not b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium.not deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium.nsq b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium.nsq deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium.ntf b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium.ntf deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium.nto b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium.nto deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium.tab b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Enterococcus_faecium.tab deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia.ndb b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia.ndb deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia.nhr b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia.nhr deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia.nin b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia.nin deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia.njs b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia.njs deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia.not b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia.not deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia.nsq b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia.nsq deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia.ntf b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia.ntf deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia.nto b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia.nto deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia.tab b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Escherichia.tab deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca.ndb b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca.ndb deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca.nhr b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca.nhr deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca.nin b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca.nin deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca.njs b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca.njs deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca.not b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca.not deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca.nsq b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca.nsq deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca.ntf b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca.ntf deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca.nto b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca.nto deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca.tab b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Klebsiella_oxytoca.tab deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae.ndb b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae.ndb deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae.nhr b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae.nhr deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae.nin b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae.nin deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae.njs b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae.njs deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae.not b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae.not deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae.nsq b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae.nsq deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae.ntf b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae.ntf deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae.nto b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae.nto deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae.tab b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Neisseria_gonorrhoeae.tab deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella.ndb b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella.ndb deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella.nhr b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella.nhr deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella.nin b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella.nin deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella.njs b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella.njs deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella.not b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella.not deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella.nsq b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella.nsq deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella.ntf b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella.ntf deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella.nto b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella.nto deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella.tab b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Salmonella.tab deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus.ndb b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus.ndb deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus.nhr b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus.nhr deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus.nin b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus.nin deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus.njs b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus.njs deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus.not b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus.not deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus.nsq b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus.nsq deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus.ntf b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus.ntf deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus.nto b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus.nto deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus.tab b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Staphylococcus_aureus.tab deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae.ndb b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae.ndb deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae.nhr b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae.nhr deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae.nin b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae.nin deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae.njs b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae.njs deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae.not b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae.not deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae.nsq b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae.nsq deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae.ntf b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae.ntf deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae.nto b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae.nto deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae.tab b/q2_amr/amrfinderplus/types/tests/data/database/AMR_DNA-Streptococcus_pneumoniae.tab deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/database_format_version.txt b/q2_amr/amrfinderplus/types/tests/data/database/database_format_version.txt deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/fam.tab b/q2_amr/amrfinderplus/types/tests/data/database/fam.tab deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/taxgroup.tab b/q2_amr/amrfinderplus/types/tests/data/database/taxgroup.tab deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/data/database/version.txt b/q2_amr/amrfinderplus/types/tests/data/database/version.txt deleted file mode 100644 index e69de29..0000000 diff --git a/q2_amr/amrfinderplus/types/tests/test_types_formats_transformers.py b/q2_amr/amrfinderplus/types/tests/test_types_formats_transformers.py deleted file mode 100644 index d905785..0000000 --- a/q2_amr/amrfinderplus/types/tests/test_types_formats_transformers.py +++ /dev/null @@ -1,118 +0,0 @@ -# ---------------------------------------------------------------------------- -# Copyright (c) 2019-2023, QIIME 2 development team. -# -# Distributed under the terms of the Modified BSD License. -# -# The full license is in the file LICENSE, distributed with this software. -# ---------------------------------------------------------------------------- -import os -import tempfile - -from qiime2.core.exceptions import ValidationError -from qiime2.plugin.testing import TestPluginBase - -from q2_amr.amrfinderplus.types._format import ( - AMRFinderPlusAnnotationFormat, - AMRFinderPlusAnnotationsDirFmt, - AMRFinderPlusDatabaseDirFmt, -) - - -class TestAMRFinderPlusTypesAndFormats(TestPluginBase): - package = "q2_amr.amrfinderplus.types.tests" - - def test_amrfinderplus_database_directory_format_validate_positive(self): - format = AMRFinderPlusDatabaseDirFmt(self.get_data_path("database"), mode="r") - format.validate() - - def test_amrfinderplus_annotation_format_validate_positive(self): - filepath = self.get_data_path( - "annotation/no_coordinates/" - "aa447c99-ecd9-4c4a-a53b-4df6999815dd_amr_annotations.tsv" - ) - - format = AMRFinderPlusAnnotationFormat(filepath, mode="r") - format.validate() - - def test_amrfinderplus_annotation_format_validate_positive_coordinates(self): - filepath = self.get_data_path( - "annotation/coordinates/e026af61-d911-4de3-a957-7e8bf837f30d" - "_amr_annotations.tsv" - ) - format = AMRFinderPlusAnnotationFormat(filepath, mode="r") - format.validate() - - def test_amrfinderplus_annotation_format_validate_positive_empty(self): - with tempfile.TemporaryDirectory() as temp_dir: - temp_file_path = os.path.join(temp_dir, "amr_annotations.tsv") - with open(temp_file_path, "w"): - pass - format = AMRFinderPlusAnnotationFormat(temp_file_path, mode="r") - format.validate() - - def test_amrfinderplus_annotation_format_validation_error(self): - with self.assertRaises(ValidationError) as context: - path = self.get_data_path("annotation_wrong/amr_annotation.tsv") - format = AMRFinderPlusAnnotationFormat(path, mode="r") - format.validate() - - header_coordinates = [ - "Protein identifier", - "Contig id", - "Start", - "Stop", - "Strand", - "Gene symbol", - "Sequence name", - "Scope", - "Element type", - "Element subtype", - "Class", - "Subclass", - "Method", - "Target length", - "Reference sequence length", - "% Coverage of reference sequence", - "% Identity to reference sequence", - "Alignment length", - "Accession of closest sequence", - "Name of closest sequence", - "HMM id", - "HMM description", - ] - expected_message = ( - "Header line does not match AMRFinderPlusAnnotation format. Must " - "consist of the following values: " - + ", ".join(header_coordinates) - + ".\nWhile Contig id, Start, Stop and Strand are optional." - + "\n\nFound instead: " - + "Incorrect Header 1, Incorrect Header 2, Incorrect Header 3" - ) - - self.assertEqual(str(context.exception), expected_message) - - def test_amrfinderplus_annotations_dir_fmt_feature(self): - dirpath = self.get_data_path( - "annotation/coordinates/e026af61-d911-4de3-a957-7e8bf837f30d" - ) - annotations = AMRFinderPlusAnnotationsDirFmt(dirpath, mode="r") - assert isinstance(annotations, AMRFinderPlusAnnotationsDirFmt) - - def test_amrfinderplus_annotations_dir_fmt_sample(self): - dirpath = self.get_data_path("annotation") - annotations = AMRFinderPlusAnnotationsDirFmt(dirpath, mode="r") - assert isinstance(annotations, AMRFinderPlusAnnotationsDirFmt) - - def test_amrfinderplus_annotations_dir_fmt_path_maker_dir_name(self): - fmt = AMRFinderPlusAnnotationsDirFmt() - path = fmt.annotations_path_maker( - name="annotations", id="id", dir_name="dir_name" - ) - self.assertEqual( - str(path), os.path.join(str(fmt), "dir_name/id_amr_annotations.tsv") - ) - - def test_amrfinderplus_annotations_dir_fmt_path_maker(self): - fmt = AMRFinderPlusAnnotationsDirFmt() - path = fmt.annotations_path_maker(name="annotations", id="id") - self.assertEqual(str(path), os.path.join(str(fmt), "id_amr_annotations.tsv")) diff --git a/q2_amr/amrfinderplus/utils.py b/q2_amr/amrfinderplus/utils.py deleted file mode 100644 index 51dfcb3..0000000 --- a/q2_amr/amrfinderplus/utils.py +++ /dev/null @@ -1,99 +0,0 @@ -import subprocess - -from q2_amr.card.utils import run_command - - -def run_amrfinderplus_n( - working_dir, - amrfinderplus_db, - dna_sequences, - protein_sequences, - gff, - organism, - plus, - report_all_equal, - ident_min, - curated_ident, - coverage_min, - translation_table, - annotation_format, - report_common, - gpipe_org, - threads, -): - # Check for unallowed parameter combinations - if report_common and (not plus or not organism): - raise ValueError("--p-report-common requires --p-plus and --p-organism") - if gpipe_org and not organism: - raise ValueError("--p-gpipe_org requires --p-organism") - - cmd = [ - "amrfinder", - "--database", - str(amrfinderplus_db), - "-o", - f"{working_dir}/amr_annotations.tsv", - "--print_node", - ] - # Creates nucleotide fasta output if DNA sequences are given as input - if dna_sequences: - cmd.extend( - [ - "-n", - dna_sequences, - "--nucleotide_output", - f"{working_dir}/amr_genes.fasta", - ] - ) - # Creates protein fasta output if protein sequences are given as input - if protein_sequences: - cmd.extend( - [ - "-p", - protein_sequences, - "--protein_output", - f"{working_dir}/amr_proteins.fasta", - ] - ) - if gff: - cmd.extend(["-g", gff]) - if threads: - cmd.extend(["--threads", str(threads)]) - # Creates all mutations output if an organism is specified - if organism: - cmd.extend( - [ - "--organism", - organism, - "--mutation_all", - f"{working_dir}/amr_all_mutations.tsv", - ] - ) - if plus: - cmd.append("--plus") - if report_all_equal: - cmd.append("--report_all_equal") - # If curated_ident is True, it will overwrite the value specified with ident_min - if ident_min and not curated_ident: - cmd.extend(["--ident_min", str(ident_min)]) - if curated_ident: - cmd.extend(["--ident_min", "-1"]) - if coverage_min: - cmd.extend(["--coverage_min", str(coverage_min)]) - if translation_table: - cmd.extend(["--translation_table", str(translation_table)]) - if annotation_format: - cmd.extend(["--annotation_format", str(annotation_format)]) - if report_common: - cmd.append("--report_common") - if gpipe_org: - cmd.append("--gpipe_org") - - try: - run_command(cmd, working_dir, verbose=True) - except subprocess.CalledProcessError as e: - raise Exception( - "An error was encountered while running AMRFinderPlus, " - f"(return code {e.returncode}), please inspect " - "stdout and stderr to learn more." - ) diff --git a/q2_amr/card/database.py b/q2_amr/card/database.py index a761db8..766f9df 100644 --- a/q2_amr/card/database.py +++ b/q2_amr/card/database.py @@ -9,11 +9,11 @@ import requests from tqdm import tqdm -from q2_amr.card.types._format import ( +from q2_amr.card.utils import colorify, run_command +from q2_amr.types._format import ( CARDDatabaseDirectoryFormat, CARDKmerDatabaseDirectoryFormat, ) -from q2_amr.card.utils import colorify, run_command def fetch_card_db() -> (CARDDatabaseDirectoryFormat, CARDKmerDatabaseDirectoryFormat): diff --git a/q2_amr/card/heatmap.py b/q2_amr/card/heatmap.py index 000e9de..b6c93ed 100644 --- a/q2_amr/card/heatmap.py +++ b/q2_amr/card/heatmap.py @@ -8,8 +8,8 @@ import pkg_resources import q2templates -from q2_amr.card.types import CARDAnnotationDirectoryFormat from q2_amr.card.utils import run_command +from q2_amr.types import CARDAnnotationDirectoryFormat def heatmap( diff --git a/q2_amr/card/kmer.py b/q2_amr/card/kmer.py index bec2362..cb33d4f 100644 --- a/q2_amr/card/kmer.py +++ b/q2_amr/card/kmer.py @@ -7,7 +7,8 @@ import warnings from pathlib import Path -from q2_amr.card.types import ( +from q2_amr.card.utils import load_card_db, run_command +from q2_amr.types import ( CARDAlleleAnnotationDirectoryFormat, CARDAnnotationDirectoryFormat, CARDDatabaseDirectoryFormat, @@ -16,7 +17,6 @@ CARDReadsAlleleKmerAnalysisDirectoryFormat, CARDReadsGeneKmerAnalysisDirectoryFormat, ) -from q2_amr.card.utils import load_card_db, run_command def kmer_query_mags_card( diff --git a/q2_amr/card/mags.py b/q2_amr/card/mags.py index 8ba020c..7c0dbcf 100644 --- a/q2_amr/card/mags.py +++ b/q2_amr/card/mags.py @@ -6,8 +6,8 @@ import pandas as pd from q2_types.per_sample_sequences import MultiMAGSequencesDirFmt -from q2_amr.card.types import CARDAnnotationDirectoryFormat, CARDDatabaseDirectoryFormat from q2_amr.card.utils import create_count_table, load_card_db, read_in_txt, run_command +from q2_amr.types import CARDAnnotationDirectoryFormat, CARDDatabaseDirectoryFormat def annotate_mags_card( @@ -46,10 +46,7 @@ def annotate_mags_card( shutil.move(f"{tmp}/output.json", json_path) samp_bin_name = os.path.join(samp_bin[0], samp_bin[1]) frequency_df = read_in_txt( - path=txt_path, - samp_bin_name=samp_bin_name, - data_type="mags", - colname="Best_Hit_ARO", + path=txt_path, samp_bin_name=samp_bin_name, data_type="mags" ) frequency_list.append(frequency_df) feature_table = create_count_table(df_list=frequency_list) diff --git a/q2_amr/card/partition.py b/q2_amr/card/partition.py index d52c98b..50e4479 100644 --- a/q2_amr/card/partition.py +++ b/q2_amr/card/partition.py @@ -5,7 +5,8 @@ import numpy as np from qiime2.util import duplicate -from q2_amr.card.types import ( +from q2_amr.card.utils import copy_files +from q2_amr.types import ( CARDAlleleAnnotationDirectoryFormat, CARDAnnotationDirectoryFormat, CARDGeneAnnotationDirectoryFormat, @@ -13,7 +14,6 @@ CARDReadsAlleleKmerAnalysisDirectoryFormat, CARDReadsGeneKmerAnalysisDirectoryFormat, ) -from q2_amr.card.utils import copy_files def collate_mags_annotations( diff --git a/q2_amr/card/reads.py b/q2_amr/card/reads.py index 0d85d69..f99c0c9 100644 --- a/q2_amr/card/reads.py +++ b/q2_amr/card/reads.py @@ -13,12 +13,12 @@ ) from q2_types.sample_data import SampleData -from q2_amr.card.types import ( +from q2_amr.card.utils import create_count_table, load_card_db, read_in_txt, run_command +from q2_amr.types import ( CARDAlleleAnnotationDirectoryFormat, CARDDatabaseDirectoryFormat, CARDGeneAnnotationDirectoryFormat, ) -from q2_amr.card.utils import create_count_table, load_card_db, read_in_txt, run_command def annotate_reads_card( @@ -144,12 +144,11 @@ def _annotate_reads_card( path_txt = os.path.join( samp_tmp_dir, f"output.{map_type}_mapping_data.txt" ) - colname = "Reference Sequence" if map_type == "allele" else "ARO Term" frequency_table = read_in_txt( path=path_txt, samp_bin_name=samp, data_type="reads", - colname=colname, + map_type=map_type, ) table_list.append(frequency_table) diff --git a/q2_amr/card/tests/test_database.py b/q2_amr/card/tests/test_database.py index 21d2067..0f5ac2e 100644 --- a/q2_amr/card/tests/test_database.py +++ b/q2_amr/card/tests/test_database.py @@ -8,10 +8,7 @@ from qiime2.plugin.testing import TestPluginBase from q2_amr.card.database import download_with_progress_bar, fetch_card_db, preprocess -from q2_amr.card.types import ( - CARDDatabaseDirectoryFormat, - CARDKmerDatabaseDirectoryFormat, -) +from q2_amr.types import CARDDatabaseDirectoryFormat, CARDKmerDatabaseDirectoryFormat class TestAnnotateMagsCard(TestPluginBase): diff --git a/q2_amr/card/tests/test_heatmap.py b/q2_amr/card/tests/test_heatmap.py index 7e82f5f..d7664b4 100644 --- a/q2_amr/card/tests/test_heatmap.py +++ b/q2_amr/card/tests/test_heatmap.py @@ -10,7 +10,7 @@ heatmap, run_rgi_heatmap, ) -from q2_amr.card.types import CARDAnnotationDirectoryFormat +from q2_amr.types import CARDAnnotationDirectoryFormat class TestHeatmap(TestPluginBase): diff --git a/q2_amr/card/tests/test_kmer.py b/q2_amr/card/tests/test_kmer.py index bf74860..2d40546 100644 --- a/q2_amr/card/tests/test_kmer.py +++ b/q2_amr/card/tests/test_kmer.py @@ -15,7 +15,7 @@ kmer_query_reads_card, run_rgi_kmer_build, ) -from q2_amr.card.types import ( +from q2_amr.types import ( CARDAlleleAnnotationDirectoryFormat, CARDAnnotationDirectoryFormat, CARDDatabaseDirectoryFormat, diff --git a/q2_amr/card/tests/test_mags.py b/q2_amr/card/tests/test_mags.py index 53697cd..11a286e 100644 --- a/q2_amr/card/tests/test_mags.py +++ b/q2_amr/card/tests/test_mags.py @@ -7,7 +7,7 @@ from qiime2.plugin.testing import TestPluginBase from q2_amr.card.mags import annotate_mags_card, run_rgi_main -from q2_amr.card.types import CARDAnnotationDirectoryFormat, CARDDatabaseDirectoryFormat +from q2_amr.types import CARDAnnotationDirectoryFormat, CARDDatabaseDirectoryFormat class TestAnnotateMagsCard(TestPluginBase): diff --git a/q2_amr/card/tests/test_partition.py b/q2_amr/card/tests/test_partition.py index 3854ab6..b6e9b7d 100644 --- a/q2_amr/card/tests/test_partition.py +++ b/q2_amr/card/tests/test_partition.py @@ -13,7 +13,7 @@ partition_reads_allele_annotations, partition_reads_gene_annotations, ) -from q2_amr.card.types import ( +from q2_amr.types import ( CARDAlleleAnnotationDirectoryFormat, CARDAnnotationDirectoryFormat, CARDGeneAnnotationDirectoryFormat, diff --git a/q2_amr/card/tests/test_reads.py b/q2_amr/card/tests/test_reads.py index 88a5de2..fa017bb 100644 --- a/q2_amr/card/tests/test_reads.py +++ b/q2_amr/card/tests/test_reads.py @@ -11,7 +11,7 @@ from qiime2.plugin.testing import TestPluginBase from q2_amr.card.reads import _annotate_reads_card, annotate_reads_card, run_rgi_bwt -from q2_amr.card.types import ( +from q2_amr.types import ( CARDAlleleAnnotationDirectoryFormat, CARDDatabaseDirectoryFormat, CARDGeneAnnotationDirectoryFormat, @@ -119,12 +119,10 @@ def annotate_reads_card_test_body(self, read_type): path=f"{tmp_dir}/{samp}/output.{map_type}_mapping_data.txt", samp_bin_name=samp, data_type="reads", - colname=colname, + map_type=map_type, ) for samp in ["sample1", "sample2"] - for map_type, colname in zip( - ["allele", "gene"], ["Reference Sequence", "ARO Term"] - ) + for map_type in ["allele", "gene"] ] # Expected call objects for mock_create_count_table diff --git a/q2_amr/card/tests/test_utils.py b/q2_amr/card/tests/test_utils.py index dc64094..d5eb6c1 100644 --- a/q2_amr/card/tests/test_utils.py +++ b/q2_amr/card/tests/test_utils.py @@ -6,10 +6,6 @@ import pandas as pd from qiime2.plugin.testing import TestPluginBase -from q2_amr.card.types import ( - CARDDatabaseDirectoryFormat, - CARDKmerDatabaseDirectoryFormat, -) from q2_amr.card.utils import ( colorify, copy_files, @@ -17,6 +13,7 @@ load_card_db, read_in_txt, ) +from q2_amr.types import CARDDatabaseDirectoryFormat, CARDKmerDatabaseDirectoryFormat class TestAnnotateReadsCARD(TestPluginBase): @@ -151,7 +148,6 @@ def test_read_in_txt_mags(self): samp_bin_name="sample1/bin1", exp=self.mag_count_df, data_type="mags", - colname="Best_Hit_ARO", ) def test_read_in_txt_reads_allele(self): @@ -161,7 +157,7 @@ def test_read_in_txt_reads_allele(self): samp_bin_name="sample1", exp=self.allele_count_df, data_type="reads", - colname="Reference Sequence", + map_type="allele", ) def test_read_in_txt_reads_gene(self): @@ -171,13 +167,15 @@ def test_read_in_txt_reads_gene(self): samp_bin_name="sample1", exp=self.gene_count_df, data_type="reads", - colname="ARO Term", + map_type="gene", ) - def read_in_txt_test_body(self, filename, samp_bin_name, exp, data_type, colname): + def read_in_txt_test_body( + self, filename, samp_bin_name, exp, data_type, map_type=None + ): # Create expected and observed count dataframes and compare them obs = read_in_txt( - self.get_data_path(filename), samp_bin_name, data_type, colname + self.get_data_path(filename), samp_bin_name, data_type, map_type ) pd.testing.assert_frame_equal(exp, obs) diff --git a/q2_amr/card/types/tests/__init__.py b/q2_amr/card/types/tests/__init__.py deleted file mode 100644 index bc9c3d2..0000000 --- a/q2_amr/card/types/tests/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# ---------------------------------------------------------------------------- -# Copyright (c) 2019-2023, QIIME 2 development team. -# -# Distributed under the terms of the Modified BSD License. -# -# The full license is in the file LICENSE, distributed with this software. -# ---------------------------------------------------------------------------- diff --git a/q2_amr/card/utils.py b/q2_amr/card/utils.py index 129bb7a..8ed0441 100644 --- a/q2_amr/card/utils.py +++ b/q2_amr/card/utils.py @@ -16,7 +16,7 @@ ) -def run_command(cmd, cwd=None, verbose=True): +def run_command(cmd, cwd, verbose=True): if verbose: print(EXTERNAL_CMD_WARNING) print("\nCommand:", end=" ") @@ -95,17 +95,20 @@ def load_card_db( return kmer_size -def read_in_txt(path: str, samp_bin_name: str, data_type: str, colname: str): +def read_in_txt(path: str, samp_bin_name: str, data_type: str, map_type=None): # Read in txt file to pd.Dataframe df = pd.read_csv(path, sep="\t") - # Process the df depending on the data type + # Process the df depending on the data type and mapping type if data_type == "reads": + colname = "Reference Sequence" if map_type == "allele" else "ARO Term" df = df[[colname, "All Mapped Reads"]] df.rename(columns={"All Mapped Reads": samp_bin_name}, inplace=True) - elif data_type == "mags": - df = df[colname].value_counts().reset_index() - df.columns = [colname, samp_bin_name] + else: + df = df["Best_Hit_ARO"].value_counts().reset_index() + + # Rename the columns + df.columns = ["Best_Hit_ARO", samp_bin_name] df = df.astype(str) return df diff --git a/q2_amr/citations.bib b/q2_amr/citations.bib index dbe6328..a748e7a 100644 --- a/q2_amr/citations.bib +++ b/q2_amr/citations.bib @@ -26,14 +26,3 @@ @article{alcock_card_2023 keywords = {*Data Curation, *Databases, Factual, *Drug Resistance, Microbial, *Machine Learning, Anti-Bacterial Agents/pharmacology, Genes, Bacterial, Likelihood Functions, Molecular Sequence Annotation, Software}, pages = {D690--D699}, } - -@article{feldgarden2021amrfinderplus, - title={AMRFinderPlus and the Reference Gene Catalog facilitate examination of the genomic links among antimicrobial resistance, stress response, and virulence}, - author={Feldgarden, Michael and Brover, Vyacheslav and Gonzalez-Escalona, Narjol and Frye, Jonathan G and Haendiges, Julie and Haft, Daniel H and Hoffmann, Maria and Pettengill, James B and Prasad, Arjun B and Tillman, Glenn E and others}, - journal={Scientific reports}, - volume={11}, - number={1}, - pages={12728}, - year={2021}, - publisher={Nature Publishing Group UK London} -} diff --git a/q2_amr/plugin_setup.py b/q2_amr/plugin_setup.py index b57aeb6..a508ff1 100644 --- a/q2_amr/plugin_setup.py +++ b/q2_amr/plugin_setup.py @@ -7,11 +7,8 @@ # ---------------------------------------------------------------------------- import importlib -from q2_types.feature_data import FeatureData from q2_types.feature_table import FeatureTable, Frequency -from q2_types.genome_data import Genes, GenomeData from q2_types.per_sample_sequences import ( - Contigs, MAGs, PairedEndSequencesWithQuality, SequencesWithQuality, @@ -21,7 +18,6 @@ Bool, Choices, Collection, - Float, Int, List, Properties, @@ -32,19 +28,6 @@ from qiime2.plugin import Citations, Plugin from q2_amr import __version__ -from q2_amr.amrfinderplus.database import fetch_amrfinderplus_db -from q2_amr.amrfinderplus.sample_data import annotate_sample_data_amrfinderplus -from q2_amr.amrfinderplus.types._format import ( - AMRFinderPlusAnnotationFormat, - AMRFinderPlusAnnotationsDirFmt, - AMRFinderPlusDatabaseDirFmt, - BinaryFormat, - TextFormat, -) -from q2_amr.amrfinderplus.types._type import ( - AMRFinderPlusAnnotations, - AMRFinderPlusDatabase, -) from q2_amr.card.database import fetch_card_db from q2_amr.card.heatmap import heatmap from q2_amr.card.kmer import ( @@ -67,14 +50,14 @@ partition_reads_gene_annotations, ) from q2_amr.card.reads import _annotate_reads_card, annotate_reads_card -from q2_amr.card.types import ( +from q2_amr.types import ( CARDAnnotationJSONFormat, CARDAnnotationTXTFormat, CARDDatabase, CARDDatabaseDirectoryFormat, CARDDatabaseFormat, ) -from q2_amr.card.types._format import ( +from q2_amr.types._format import ( CARDAlleleAnnotationDirectoryFormat, CARDAlleleAnnotationFormat, CARDAnnotationDirectoryFormat, @@ -95,7 +78,7 @@ CARDWildcardIndexFormat, GapDNAFASTAFormat, ) -from q2_amr.card.types._type import ( +from q2_amr.types._type import ( CARDAlleleAnnotation, CARDAnnotation, CARDGeneAnnotation, @@ -1083,198 +1066,6 @@ " size", citations=[citations["alcock_card_2023"]], ) -plugin.methods.register_function( - function=fetch_amrfinderplus_db, - inputs={}, - parameters={}, - outputs=[("amrfinderplus_db", AMRFinderPlusDatabase)], - input_descriptions={}, - parameter_descriptions={}, - output_descriptions={ - "amrfinderplus_db": "AMRFinderPlus database.", - }, - name="Download AMRFinderPlus database.", - description="Download the latest version of the AMRFinderPlus database.", - citations=[citations["feldgarden2021amrfinderplus"]], -) - -organisms = [ - "Acinetobacter_baumannii", - "Burkholderia_cepacia", - "Burkholderia_pseudomallei", - "Campylobacter", - "Citrobacter_freundii", - "Clostridioides_difficile", - "Enterobacter_asburiae", - "Enterobacter_cloacae", - "Enterococcus_faecalis", - "Enterococcus_faecium", - "Escherichia", - "Klebsiella_oxytoca", - "Klebsiella_pneumoniae", - "Neisseria_gonorrhoeae", - "Neisseria_meningitidis", - "Pseudomonas_aeruginosa", - "Salmonella", - "Serratia_marcescens", - "Staphylococcus_aureus", - "Staphylococcus_pseudintermedius", - "Streptococcus_agalactiae", - "Streptococcus_pneumoniae", - "Streptococcus_pyogenes", - "Vibrio_cholerae", - "Vibrio_parahaemolyticus", - "Vibrio_vulnificus", -] - -organisms_gpipe = [ - "Acinetobacter", - "Burkholderia_cepacia_complex", - "Burkholderia_pseudomallei", - "Campylobacter", - "Citrobacter_freundii", - "Clostridioides_difficile", - "Enterobacter_asburiae", - "Enterobacter_cloacae", - "Enterococcus_faecalis", - "Enterococcus_faecium", - "Escherichia_coli_Shigella", - "Klebsiella_oxytoca", - "Klebsiella", - "Neisseria_gonorrhoeae", - "Neisseria_meningitidis", - "Pseudomonas_aeruginosa", - "Salmonella", - "Serratia", - "Staphylococcus_aureus", - "Staphylococcus_pseudintermedius", - "Streptococcus_agalactiae", - "Streptococcus_pneumoniae", - "Streptococcus_pyogenes", - "Vibrio_cholerae", - "Vibrio_parahaemolyticus", - "Vibrio_vulnificus", -] - -translation_tables = [ - "1", - "2", - "3", - "4", - "5", - "6", - "9", - "10", - "11", - "12", - "13", - "14", - "15", - "16", - "21", - "22", - "23", - "24", - "25", - "26", - "27", - "28", - "29", - "30", - "31", - "33", -] - -P_gpipe_org, P_organism, _ = TypeMap( - { - (Bool % Choices(True), Str % Choices(organisms_gpipe)): Int, - (Bool % Choices(False), Str % Choices(organisms)): Int, - } -) - -plugin.methods.register_function( - function=annotate_sample_data_amrfinderplus, - inputs={ - "sequences": SampleData[MAGs | Contigs], - "amrfinderplus_db": AMRFinderPlusDatabase, - }, - parameters={ - "organism": P_organism, - "plus": Bool, - "report_all_equal": Bool, - "ident_min": Float % Range(0, 1, inclusive_start=True, inclusive_end=True), - "curated_ident": Bool, - "coverage_min": Float % Range(0, 1, inclusive_start=True, inclusive_end=True), - "translation_table": Str % Choices(translation_tables), - "report_common": Bool, - "gpipe_org": P_gpipe_org, - "threads": Int % Range(0, None, inclusive_start=False), - }, - outputs=[ - ("amr_annotations", SampleData[AMRFinderPlusAnnotations]), - ("amr_all_mutations", SampleData[AMRFinderPlusAnnotations]), - ("amr_genes", GenomeData[Genes]), - ("feature_table", FeatureTable[Frequency]), - ], - input_descriptions={ - "sequences": "MAGs or contigs to be annotated with AMRFinderPlus.", - "amrfinderplus_db": "AMRFinderPlus Database.", - }, - parameter_descriptions={ - "organism": "Taxon used for screening known resistance causing point mutations " - "and blacklisting of common, non-informative genes.", - "plus": "Provide results from 'Plus' genes such as virulence factors, " - "stress-response genes, etc.", - "report_all_equal": "Report all equally scoring BLAST and HMM matches. This " - "will report multiple lines for a single element if there " - "are multiple reference proteins that have the same score. " - "On those lines the fields Accession of closest sequence " - "and Name of closest sequence will be different showing " - "each of the database proteins that are equally close to " - "the query sequence.", - "ident_min": "Minimum identity for a blast-based hit (Methods BLAST or " - "PARTIAL). Setting this value to something other than -1 " - "will override curated similarity cutoffs. We only recommend " - "using this option if you have a specific reason.", - "curated_ident": "Use the curated threshold for a blast-based hit, if it " - "exists and 0.9 otherwise. This will overwrite the value specified with the " - "'ident_min' parameter", - "coverage_min": "Minimum proportion of reference gene covered for a " - "BLAST-based hit (Methods BLAST or PARTIAL).", - "translation_table": "Translation table used for BLASTX.", - "report_common": "Report proteins common to a taxonomy group.", - "gpipe_org": "Use Pathogen Detection taxgroup names as arguments to the " - "organism option.", - "threads": "The number of threads to use for processing. AMRFinderPlus " - "defaults to 4 on hosts with >= 4 cores. Setting this number higher" - " than the number of cores on the running host may cause blastp to " - "fail. Using more than 4 threads may speed up searches.", - }, - output_descriptions={ - "amr_annotations": "Annotated AMR genes and mutations.", - "amr_all_mutations": "Report of genotypes at all locations screened for point " - "mutations. These files allow you to distinguish between called " - "point mutations that were the sensitive variant and the point " - "mutations that could not be called because the sequence was not " - "found. This file will contain all detected variants from the " - "reference sequence, so it could be used as an initial screen for " - "novel variants. Note 'Gene symbols' for mutations not in the " - "database (identifiable by [UNKNOWN] in the Sequence name field) " - "have offsets that are relative to the start of the sequence " - "indicated in the field 'Accession of closest sequence' while " - "'Gene symbols' from known point-mutation sites have gene symbols " - "that match the Pathogen Detection Reference Gene Catalog " - "standardized nomenclature for point mutations.", - "amr_genes": "Sequences that were identified by AMRFinderPlus as AMR genes. " - "This will include the entire region that aligns to the references for " - "point mutations.", - "feature_table": "Presence/Absence table of ARGs in all samples.", - }, - name="Annotate MAGs or contigs with AMRFinderPlus.", - description="Annotate sample data MAGs or contigs with antimicrobial resistance " - "genes with AMRFinderPlus.", - citations=[], -) # Registrations plugin.register_semantic_types( @@ -1286,8 +1077,6 @@ CARDReadsGeneKmerAnalysis, CARDReadsAlleleKmerAnalysis, CARDMAGsKmerAnalysis, - AMRFinderPlusDatabase, - AMRFinderPlusAnnotations, ) plugin.register_semantic_type_to_format( @@ -1318,18 +1107,6 @@ SampleData[CARDMAGsKmerAnalysis], artifact_format=CARDMAGsKmerAnalysisDirectoryFormat, ) -plugin.register_semantic_type_to_format( - AMRFinderPlusDatabase, - artifact_format=AMRFinderPlusDatabaseDirFmt, -) -plugin.register_semantic_type_to_format( - SampleData[AMRFinderPlusAnnotations], - artifact_format=AMRFinderPlusAnnotationsDirFmt, -) -plugin.register_semantic_type_to_format( - FeatureData[AMRFinderPlusAnnotations], - artifact_format=AMRFinderPlusAnnotationsDirFmt, -) plugin.register_formats( CARDKmerDatabaseDirectoryFormat, CARDKmerJSONFormat, @@ -1354,11 +1131,6 @@ CARDReadsKmerAnalysisJSONFormat, CARDReadsGeneKmerAnalysisDirectoryFormat, CARDReadsAlleleKmerAnalysisDirectoryFormat, - AMRFinderPlusDatabaseDirFmt, - TextFormat, - BinaryFormat, - AMRFinderPlusAnnotationFormat, - AMRFinderPlusAnnotationsDirFmt, ) -importlib.import_module("q2_amr.card.types._transformer") +importlib.import_module("q2_amr.types._transformer") diff --git a/q2_amr/card/types/__init__.py b/q2_amr/types/__init__.py similarity index 100% rename from q2_amr/card/types/__init__.py rename to q2_amr/types/__init__.py diff --git a/q2_amr/card/types/_format.py b/q2_amr/types/_format.py similarity index 100% rename from q2_amr/card/types/_format.py rename to q2_amr/types/_format.py diff --git a/q2_amr/card/types/_transformer.py b/q2_amr/types/_transformer.py similarity index 98% rename from q2_amr/card/types/_transformer.py rename to q2_amr/types/_transformer.py index 4536df8..1139f7d 100644 --- a/q2_amr/card/types/_transformer.py +++ b/q2_amr/types/_transformer.py @@ -18,9 +18,9 @@ from q2_types.genome_data import GenesDirectoryFormat, ProteinsDirectoryFormat from skbio import DNA, Protein -from q2_amr.card.types import CARDAnnotationDirectoryFormat -from q2_amr.plugin_setup import plugin +from q2_amr.types import CARDAnnotationDirectoryFormat +from ..plugin_setup import plugin from ._format import ( CARDAlleleAnnotationDirectoryFormat, CARDAnnotationJSONFormat, diff --git a/q2_amr/card/types/_type.py b/q2_amr/types/_type.py similarity index 100% rename from q2_amr/card/types/_type.py rename to q2_amr/types/_type.py diff --git a/q2_amr/amrfinderplus/__init__.py b/q2_amr/types/tests/__init__.py similarity index 100% rename from q2_amr/amrfinderplus/__init__.py rename to q2_amr/types/tests/__init__.py diff --git a/q2_amr/card/types/tests/data/61mer_analysis.allele.txt b/q2_amr/types/tests/data/61mer_analysis.allele.txt similarity index 100% rename from q2_amr/card/types/tests/data/61mer_analysis.allele.txt rename to q2_amr/types/tests/data/61mer_analysis.allele.txt diff --git a/q2_amr/card/types/tests/data/61mer_analysis.gene.txt b/q2_amr/types/tests/data/61mer_analysis.gene.txt similarity index 100% rename from q2_amr/card/types/tests/data/61mer_analysis.gene.txt rename to q2_amr/types/tests/data/61mer_analysis.gene.txt diff --git a/q2_amr/card/types/tests/data/61mer_analysis_rgi_summary.txt b/q2_amr/types/tests/data/61mer_analysis_rgi_summary.txt similarity index 100% rename from q2_amr/card/types/tests/data/61mer_analysis_rgi_summary.txt rename to q2_amr/types/tests/data/61mer_analysis_rgi_summary.txt diff --git a/q2_amr/card/types/tests/data/DNA_fasta.fasta b/q2_amr/types/tests/data/DNA_fasta.fasta similarity index 100% rename from q2_amr/card/types/tests/data/DNA_fasta.fasta rename to q2_amr/types/tests/data/DNA_fasta.fasta diff --git a/q2_amr/card/types/tests/data/DNA_fasta_-.fasta b/q2_amr/types/tests/data/DNA_fasta_-.fasta similarity index 100% rename from q2_amr/card/types/tests/data/DNA_fasta_-.fasta rename to q2_amr/types/tests/data/DNA_fasta_-.fasta diff --git a/q2_amr/card/types/tests/data/card_allele_annotation/sample1/allele_mapping_data.txt b/q2_amr/types/tests/data/card_allele_annotation/sample1/allele_mapping_data.txt similarity index 100% rename from q2_amr/card/types/tests/data/card_allele_annotation/sample1/allele_mapping_data.txt rename to q2_amr/types/tests/data/card_allele_annotation/sample1/allele_mapping_data.txt diff --git a/q2_amr/card/types/tests/data/card_allele_annotation/sample1/overall_mapping_stats.txt b/q2_amr/types/tests/data/card_allele_annotation/sample1/overall_mapping_stats.txt similarity index 100% rename from q2_amr/card/types/tests/data/card_allele_annotation/sample1/overall_mapping_stats.txt rename to q2_amr/types/tests/data/card_allele_annotation/sample1/overall_mapping_stats.txt diff --git a/q2_amr/card/types/tests/data/card_allele_annotation/sample1/sorted.length_100.bam b/q2_amr/types/tests/data/card_allele_annotation/sample1/sorted.length_100.bam similarity index 100% rename from q2_amr/card/types/tests/data/card_allele_annotation/sample1/sorted.length_100.bam rename to q2_amr/types/tests/data/card_allele_annotation/sample1/sorted.length_100.bam diff --git a/q2_amr/card/types/tests/data/card_allele_annotation/sample2/allele_mapping_data.txt b/q2_amr/types/tests/data/card_allele_annotation/sample2/allele_mapping_data.txt similarity index 100% rename from q2_amr/card/types/tests/data/card_allele_annotation/sample2/allele_mapping_data.txt rename to q2_amr/types/tests/data/card_allele_annotation/sample2/allele_mapping_data.txt diff --git a/q2_amr/card/types/tests/data/card_allele_annotation/sample2/overall_mapping_stats.txt b/q2_amr/types/tests/data/card_allele_annotation/sample2/overall_mapping_stats.txt similarity index 100% rename from q2_amr/card/types/tests/data/card_allele_annotation/sample2/overall_mapping_stats.txt rename to q2_amr/types/tests/data/card_allele_annotation/sample2/overall_mapping_stats.txt diff --git a/q2_amr/card/types/tests/data/card_allele_annotation/sample2/sorted.length_100.bam b/q2_amr/types/tests/data/card_allele_annotation/sample2/sorted.length_100.bam similarity index 100% rename from q2_amr/card/types/tests/data/card_allele_annotation/sample2/sorted.length_100.bam rename to q2_amr/types/tests/data/card_allele_annotation/sample2/sorted.length_100.bam diff --git a/q2_amr/card/types/tests/data/card_annotation/sample1/e026af61-d911-4de3-a957-7e8bf837f30d/amr_annotation.json b/q2_amr/types/tests/data/card_annotation/sample1/e026af61-d911-4de3-a957-7e8bf837f30d/amr_annotation.json similarity index 100% rename from q2_amr/card/types/tests/data/card_annotation/sample1/e026af61-d911-4de3-a957-7e8bf837f30d/amr_annotation.json rename to q2_amr/types/tests/data/card_annotation/sample1/e026af61-d911-4de3-a957-7e8bf837f30d/amr_annotation.json diff --git a/q2_amr/card/types/tests/data/card_annotation/sample1/e026af61-d911-4de3-a957-7e8bf837f30d/amr_annotation.txt b/q2_amr/types/tests/data/card_annotation/sample1/e026af61-d911-4de3-a957-7e8bf837f30d/amr_annotation.txt similarity index 100% rename from q2_amr/card/types/tests/data/card_annotation/sample1/e026af61-d911-4de3-a957-7e8bf837f30d/amr_annotation.txt rename to q2_amr/types/tests/data/card_annotation/sample1/e026af61-d911-4de3-a957-7e8bf837f30d/amr_annotation.txt diff --git a/q2_amr/card/types/tests/data/card_annotation/sample2/aa447c99-ecd9-4c4a-a53b-4df6999815dd/amr_annotation.json b/q2_amr/types/tests/data/card_annotation/sample2/aa447c99-ecd9-4c4a-a53b-4df6999815dd/amr_annotation.json similarity index 100% rename from q2_amr/card/types/tests/data/card_annotation/sample2/aa447c99-ecd9-4c4a-a53b-4df6999815dd/amr_annotation.json rename to q2_amr/types/tests/data/card_annotation/sample2/aa447c99-ecd9-4c4a-a53b-4df6999815dd/amr_annotation.json diff --git a/q2_amr/card/types/tests/data/card_annotation/sample2/aa447c99-ecd9-4c4a-a53b-4df6999815dd/amr_annotation.txt b/q2_amr/types/tests/data/card_annotation/sample2/aa447c99-ecd9-4c4a-a53b-4df6999815dd/amr_annotation.txt similarity index 100% rename from q2_amr/card/types/tests/data/card_annotation/sample2/aa447c99-ecd9-4c4a-a53b-4df6999815dd/amr_annotation.txt rename to q2_amr/types/tests/data/card_annotation/sample2/aa447c99-ecd9-4c4a-a53b-4df6999815dd/amr_annotation.txt diff --git a/q2_amr/card/types/tests/data/card_annotation/sample2/f5a16381-ea80-49f9-875e-620f333a9293/amr_annotation.json b/q2_amr/types/tests/data/card_annotation/sample2/f5a16381-ea80-49f9-875e-620f333a9293/amr_annotation.json similarity index 100% rename from q2_amr/card/types/tests/data/card_annotation/sample2/f5a16381-ea80-49f9-875e-620f333a9293/amr_annotation.json rename to q2_amr/types/tests/data/card_annotation/sample2/f5a16381-ea80-49f9-875e-620f333a9293/amr_annotation.json diff --git a/q2_amr/card/types/tests/data/card_annotation/sample2/f5a16381-ea80-49f9-875e-620f333a9293/amr_annotation.txt b/q2_amr/types/tests/data/card_annotation/sample2/f5a16381-ea80-49f9-875e-620f333a9293/amr_annotation.txt similarity index 100% rename from q2_amr/card/types/tests/data/card_annotation/sample2/f5a16381-ea80-49f9-875e-620f333a9293/amr_annotation.txt rename to q2_amr/types/tests/data/card_annotation/sample2/f5a16381-ea80-49f9-875e-620f333a9293/amr_annotation.txt diff --git a/q2_amr/card/types/tests/data/card_gene_annotation/sample1/gene_mapping_data.txt b/q2_amr/types/tests/data/card_gene_annotation/sample1/gene_mapping_data.txt similarity index 100% rename from q2_amr/card/types/tests/data/card_gene_annotation/sample1/gene_mapping_data.txt rename to q2_amr/types/tests/data/card_gene_annotation/sample1/gene_mapping_data.txt diff --git a/q2_amr/card/types/tests/data/card_gene_annotation/sample2/gene_mapping_data.txt b/q2_amr/types/tests/data/card_gene_annotation/sample2/gene_mapping_data.txt similarity index 100% rename from q2_amr/card/types/tests/data/card_gene_annotation/sample2/gene_mapping_data.txt rename to q2_amr/types/tests/data/card_gene_annotation/sample2/gene_mapping_data.txt diff --git a/q2_amr/card/types/tests/data/card_kmer_analysis_mags/sample1/bin1/61mer_analysis_rgi_summary.txt b/q2_amr/types/tests/data/card_kmer_analysis_mags/sample1/bin1/61mer_analysis_rgi_summary.txt similarity index 100% rename from q2_amr/card/types/tests/data/card_kmer_analysis_mags/sample1/bin1/61mer_analysis_rgi_summary.txt rename to q2_amr/types/tests/data/card_kmer_analysis_mags/sample1/bin1/61mer_analysis_rgi_summary.txt diff --git a/q2_amr/card/types/tests/data/card_kmer_analysis_mags/sample1/e026af61-d911-4de3-a957-7e8bf837f30d/61mer_analysis.json b/q2_amr/types/tests/data/card_kmer_analysis_mags/sample1/e026af61-d911-4de3-a957-7e8bf837f30d/61mer_analysis.json similarity index 100% rename from q2_amr/card/types/tests/data/card_kmer_analysis_mags/sample1/e026af61-d911-4de3-a957-7e8bf837f30d/61mer_analysis.json rename to q2_amr/types/tests/data/card_kmer_analysis_mags/sample1/e026af61-d911-4de3-a957-7e8bf837f30d/61mer_analysis.json diff --git a/q2_amr/card/types/tests/data/card_kmer_analysis_mags/sample1/e026af61-d911-4de3-a957-7e8bf837f30d/61mer_analysis_rgi_summary.txt b/q2_amr/types/tests/data/card_kmer_analysis_mags/sample1/e026af61-d911-4de3-a957-7e8bf837f30d/61mer_analysis_rgi_summary.txt similarity index 100% rename from q2_amr/card/types/tests/data/card_kmer_analysis_mags/sample1/e026af61-d911-4de3-a957-7e8bf837f30d/61mer_analysis_rgi_summary.txt rename to q2_amr/types/tests/data/card_kmer_analysis_mags/sample1/e026af61-d911-4de3-a957-7e8bf837f30d/61mer_analysis_rgi_summary.txt diff --git a/q2_amr/card/types/tests/data/card_kmer_analysis_mags/sample2/aa447c99-ecd9-4c4a-a53b-4df6999815dd/61mer_analysis.json b/q2_amr/types/tests/data/card_kmer_analysis_mags/sample2/aa447c99-ecd9-4c4a-a53b-4df6999815dd/61mer_analysis.json similarity index 100% rename from q2_amr/card/types/tests/data/card_kmer_analysis_mags/sample2/aa447c99-ecd9-4c4a-a53b-4df6999815dd/61mer_analysis.json rename to q2_amr/types/tests/data/card_kmer_analysis_mags/sample2/aa447c99-ecd9-4c4a-a53b-4df6999815dd/61mer_analysis.json diff --git a/q2_amr/card/types/tests/data/card_kmer_analysis_mags/sample2/aa447c99-ecd9-4c4a-a53b-4df6999815dd/61mer_analysis_rgi_summary.txt b/q2_amr/types/tests/data/card_kmer_analysis_mags/sample2/aa447c99-ecd9-4c4a-a53b-4df6999815dd/61mer_analysis_rgi_summary.txt similarity index 100% rename from q2_amr/card/types/tests/data/card_kmer_analysis_mags/sample2/aa447c99-ecd9-4c4a-a53b-4df6999815dd/61mer_analysis_rgi_summary.txt rename to q2_amr/types/tests/data/card_kmer_analysis_mags/sample2/aa447c99-ecd9-4c4a-a53b-4df6999815dd/61mer_analysis_rgi_summary.txt diff --git a/q2_amr/card/types/tests/data/card_kmer_analysis_mags/sample2/f5a16381-ea80-49f9-875e-620f333a9293/61mer_analysis.json b/q2_amr/types/tests/data/card_kmer_analysis_mags/sample2/f5a16381-ea80-49f9-875e-620f333a9293/61mer_analysis.json similarity index 100% rename from q2_amr/card/types/tests/data/card_kmer_analysis_mags/sample2/f5a16381-ea80-49f9-875e-620f333a9293/61mer_analysis.json rename to q2_amr/types/tests/data/card_kmer_analysis_mags/sample2/f5a16381-ea80-49f9-875e-620f333a9293/61mer_analysis.json diff --git a/q2_amr/card/types/tests/data/card_kmer_analysis_mags/sample2/f5a16381-ea80-49f9-875e-620f333a9293/61mer_analysis_rgi_summary.txt b/q2_amr/types/tests/data/card_kmer_analysis_mags/sample2/f5a16381-ea80-49f9-875e-620f333a9293/61mer_analysis_rgi_summary.txt similarity index 100% rename from q2_amr/card/types/tests/data/card_kmer_analysis_mags/sample2/f5a16381-ea80-49f9-875e-620f333a9293/61mer_analysis_rgi_summary.txt rename to q2_amr/types/tests/data/card_kmer_analysis_mags/sample2/f5a16381-ea80-49f9-875e-620f333a9293/61mer_analysis_rgi_summary.txt diff --git a/q2_amr/card/types/tests/data/card_reads_allele_kmer_analysis/sample1/61mer_analysis.allele.txt b/q2_amr/types/tests/data/card_reads_allele_kmer_analysis/sample1/61mer_analysis.allele.txt similarity index 100% rename from q2_amr/card/types/tests/data/card_reads_allele_kmer_analysis/sample1/61mer_analysis.allele.txt rename to q2_amr/types/tests/data/card_reads_allele_kmer_analysis/sample1/61mer_analysis.allele.txt diff --git a/q2_amr/card/types/tests/data/card_reads_allele_kmer_analysis/sample1/61mer_analysis.json b/q2_amr/types/tests/data/card_reads_allele_kmer_analysis/sample1/61mer_analysis.json similarity index 100% rename from q2_amr/card/types/tests/data/card_reads_allele_kmer_analysis/sample1/61mer_analysis.json rename to q2_amr/types/tests/data/card_reads_allele_kmer_analysis/sample1/61mer_analysis.json diff --git a/q2_amr/card/types/tests/data/card_reads_allele_kmer_analysis/sample2/61mer_analysis.allele.txt b/q2_amr/types/tests/data/card_reads_allele_kmer_analysis/sample2/61mer_analysis.allele.txt similarity index 100% rename from q2_amr/card/types/tests/data/card_reads_allele_kmer_analysis/sample2/61mer_analysis.allele.txt rename to q2_amr/types/tests/data/card_reads_allele_kmer_analysis/sample2/61mer_analysis.allele.txt diff --git a/q2_amr/card/types/tests/data/card_reads_allele_kmer_analysis/sample2/61mer_analysis.json b/q2_amr/types/tests/data/card_reads_allele_kmer_analysis/sample2/61mer_analysis.json similarity index 100% rename from q2_amr/card/types/tests/data/card_reads_allele_kmer_analysis/sample2/61mer_analysis.json rename to q2_amr/types/tests/data/card_reads_allele_kmer_analysis/sample2/61mer_analysis.json diff --git a/q2_amr/card/types/tests/data/card_reads_gene_kmer_analysis/sample1/61mer_analysis.gene.txt b/q2_amr/types/tests/data/card_reads_gene_kmer_analysis/sample1/61mer_analysis.gene.txt similarity index 100% rename from q2_amr/card/types/tests/data/card_reads_gene_kmer_analysis/sample1/61mer_analysis.gene.txt rename to q2_amr/types/tests/data/card_reads_gene_kmer_analysis/sample1/61mer_analysis.gene.txt diff --git a/q2_amr/card/types/tests/data/card_reads_gene_kmer_analysis/sample2/61mer_analysis.gene.txt b/q2_amr/types/tests/data/card_reads_gene_kmer_analysis/sample2/61mer_analysis.gene.txt similarity index 100% rename from q2_amr/card/types/tests/data/card_reads_gene_kmer_analysis/sample2/61mer_analysis.gene.txt rename to q2_amr/types/tests/data/card_reads_gene_kmer_analysis/sample2/61mer_analysis.gene.txt diff --git a/q2_amr/card/types/tests/data/card_test.json b/q2_amr/types/tests/data/card_test.json similarity index 100% rename from q2_amr/card/types/tests/data/card_test.json rename to q2_amr/types/tests/data/card_test.json diff --git a/q2_amr/card/types/tests/data/card_test_dna.fasta b/q2_amr/types/tests/data/card_test_dna.fasta similarity index 100% rename from q2_amr/card/types/tests/data/card_test_dna.fasta rename to q2_amr/types/tests/data/card_test_dna.fasta diff --git a/q2_amr/card/types/tests/data/card_test_protein.fasta b/q2_amr/types/tests/data/card_test_protein.fasta similarity index 100% rename from q2_amr/card/types/tests/data/card_test_protein.fasta rename to q2_amr/types/tests/data/card_test_protein.fasta diff --git a/q2_amr/card/types/tests/data/empty_dict.json b/q2_amr/types/tests/data/empty_dict.json similarity index 100% rename from q2_amr/card/types/tests/data/empty_dict.json rename to q2_amr/types/tests/data/empty_dict.json diff --git a/q2_amr/card/types/tests/data/index-for-model-sequences-test.txt b/q2_amr/types/tests/data/index-for-model-sequences-test.txt similarity index 100% rename from q2_amr/card/types/tests/data/index-for-model-sequences-test.txt rename to q2_amr/types/tests/data/index-for-model-sequences-test.txt diff --git a/q2_amr/card/types/tests/data/kmer_json_test.json b/q2_amr/types/tests/data/kmer_json_test.json similarity index 100% rename from q2_amr/card/types/tests/data/kmer_json_test.json rename to q2_amr/types/tests/data/kmer_json_test.json diff --git a/q2_amr/card/types/tests/data/kmer_txt_test.txt b/q2_amr/types/tests/data/kmer_txt_test.txt similarity index 100% rename from q2_amr/card/types/tests/data/kmer_txt_test.txt rename to q2_amr/types/tests/data/kmer_txt_test.txt diff --git a/q2_amr/card/types/tests/data/mags_61mer_analysis.json b/q2_amr/types/tests/data/mags_61mer_analysis.json similarity index 100% rename from q2_amr/card/types/tests/data/mags_61mer_analysis.json rename to q2_amr/types/tests/data/mags_61mer_analysis.json diff --git a/q2_amr/card/types/tests/data/reads_61mer_analysis.json b/q2_amr/types/tests/data/reads_61mer_analysis.json similarity index 100% rename from q2_amr/card/types/tests/data/reads_61mer_analysis.json rename to q2_amr/types/tests/data/reads_61mer_analysis.json diff --git a/q2_amr/card/types/tests/data/rgi_output.json b/q2_amr/types/tests/data/rgi_output.json similarity index 100% rename from q2_amr/card/types/tests/data/rgi_output.json rename to q2_amr/types/tests/data/rgi_output.json diff --git a/q2_amr/card/types/tests/data/rgi_output.txt b/q2_amr/types/tests/data/rgi_output.txt similarity index 100% rename from q2_amr/card/types/tests/data/rgi_output.txt rename to q2_amr/types/tests/data/rgi_output.txt diff --git a/q2_amr/card/types/tests/data/rgi_output_dna.fna b/q2_amr/types/tests/data/rgi_output_dna.fna similarity index 100% rename from q2_amr/card/types/tests/data/rgi_output_dna.fna rename to q2_amr/types/tests/data/rgi_output_dna.fna diff --git a/q2_amr/card/types/tests/data/rgi_output_protein.fna b/q2_amr/types/tests/data/rgi_output_protein.fna similarity index 100% rename from q2_amr/card/types/tests/data/rgi_output_protein.fna rename to q2_amr/types/tests/data/rgi_output_protein.fna diff --git a/q2_amr/card/types/tests/data/tabulated_df_allele.txt b/q2_amr/types/tests/data/tabulated_df_allele.txt similarity index 100% rename from q2_amr/card/types/tests/data/tabulated_df_allele.txt rename to q2_amr/types/tests/data/tabulated_df_allele.txt diff --git a/q2_amr/card/types/tests/data/tabulated_df_mags.txt b/q2_amr/types/tests/data/tabulated_df_mags.txt similarity index 100% rename from q2_amr/card/types/tests/data/tabulated_df_mags.txt rename to q2_amr/types/tests/data/tabulated_df_mags.txt diff --git a/q2_amr/card/types/tests/test_types_formats_transformers.py b/q2_amr/types/tests/test_types_formats_transformers.py similarity index 99% rename from q2_amr/card/types/tests/test_types_formats_transformers.py rename to q2_amr/types/tests/test_types_formats_transformers.py index 2a0ac25..a871e99 100644 --- a/q2_amr/card/types/tests/test_types_formats_transformers.py +++ b/q2_amr/types/tests/test_types_formats_transformers.py @@ -24,12 +24,12 @@ from qiime2.plugin.testing import TestPluginBase from skbio import DNA, Protein -from q2_amr.card.types import ( +from q2_amr.types import ( CARDAlleleAnnotationDirectoryFormat, CARDDatabaseDirectoryFormat, CARDGeneAnnotationDirectoryFormat, ) -from q2_amr.card.types._format import ( +from q2_amr.types._format import ( CARDAnnotationDirectoryFormat, CARDAnnotationTXTFormat, CARDDatabaseFormat, @@ -47,7 +47,7 @@ CARDWildcardIndexFormat, GapDNAFASTAFormat, ) -from q2_amr.card.types._transformer import ( +from q2_amr.types._transformer import ( _read_from_card_file, card_annotation_df_to_fasta, extract_sequence, @@ -56,7 +56,7 @@ class AMRTypesTestPluginBase(TestPluginBase): - package = "q2_amr.card.types.tests" + package = "q2_amr.types.tests" def setUp(self): super().setUp() diff --git a/setup.py b/setup.py index eaf66a0..a08c229 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ "assets/rgi/annotation_stats/*", "assets/rgi/heatmap/*", ], - "q2_amr.card.types.tests": [ + "q2_amr.types.tests": [ "data/*", "data/*/*/*", "data/*/*/*/*", @@ -39,9 +39,6 @@ "data/*/*/*/*", "data/*/*/*/*/*", ], - "q2_amr.amrfinderplus.types.tests": [ - "data/*/*", - ], }, zip_safe=False, )