Skip to content

Commit

Permalink
added new amrfinder directory and moved types to card directory
Browse files Browse the repository at this point in the history
  • Loading branch information
VinzentRisch committed Jun 28, 2024
1 parent 5ace3a6 commit d33e0cb
Show file tree
Hide file tree
Showing 74 changed files with 92 additions and 25 deletions.
File renamed without changes.
7 changes: 7 additions & 0 deletions q2_amr/amrfinderplus/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ----------------------------------------------------------------------------
# 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.
# ----------------------------------------------------------------------------
9 changes: 9 additions & 0 deletions q2_amr/amrfinderplus/types/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# ----------------------------------------------------------------------------
# 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.
# ----------------------------------------------------------------------------

__all__ = []
7 changes: 7 additions & 0 deletions q2_amr/amrfinderplus/types/_format.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ----------------------------------------------------------------------------
# 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.
# ----------------------------------------------------------------------------
7 changes: 7 additions & 0 deletions q2_amr/amrfinderplus/types/_transformer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ----------------------------------------------------------------------------
# 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.
# ----------------------------------------------------------------------------
10 changes: 10 additions & 0 deletions q2_amr/amrfinderplus/types/_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# ----------------------------------------------------------------------------
# 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 qiime2.core.type import SemanticType

AMRFinderPlusDatabase = SemanticType("AMRFinderPlusDatabase")
7 changes: 7 additions & 0 deletions q2_amr/amrfinderplus/types/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ----------------------------------------------------------------------------
# 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.
# ----------------------------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ----------------------------------------------------------------------------
# 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.
# ----------------------------------------------------------------------------
4 changes: 2 additions & 2 deletions q2_amr/card/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
import requests
from tqdm import tqdm

from q2_amr.card.utils import colorify, run_command
from q2_amr.types._format import (
from q2_amr.card.types._format import (
CARDDatabaseDirectoryFormat,
CARDKmerDatabaseDirectoryFormat,
)
from q2_amr.card.utils import colorify, run_command


def fetch_card_db() -> (CARDDatabaseDirectoryFormat, CARDKmerDatabaseDirectoryFormat):
Expand Down
2 changes: 1 addition & 1 deletion q2_amr/card/heatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion q2_amr/card/mags.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions q2_amr/card/partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
import numpy as np
from qiime2.util import duplicate

from q2_amr.card.utils import copy_files
from q2_amr.types import (
from q2_amr.card.types import (
CARDAlleleAnnotationDirectoryFormat,
CARDAnnotationDirectoryFormat,
CARDGeneAnnotationDirectoryFormat,
CARDMAGsKmerAnalysisDirectoryFormat,
CARDReadsAlleleKmerAnalysisDirectoryFormat,
CARDReadsGeneKmerAnalysisDirectoryFormat,
)
from q2_amr.card.utils import copy_files


def collate_mags_annotations(
Expand Down
4 changes: 2 additions & 2 deletions q2_amr/card/reads.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
SingleLanePerSampleSingleEndFastqDirFmt,
)

from q2_amr.card.utils import create_count_table, load_card_db, read_in_txt, run_command
from q2_amr.types import (
from q2_amr.card.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(
Expand Down
5 changes: 4 additions & 1 deletion q2_amr/card/tests/test_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
from qiime2.plugin.testing import TestPluginBase

from q2_amr.card.database import download_with_progress_bar, fetch_card_db, preprocess
from q2_amr.types import CARDDatabaseDirectoryFormat, CARDKmerDatabaseDirectoryFormat
from q2_amr.card.types import (
CARDDatabaseDirectoryFormat,
CARDKmerDatabaseDirectoryFormat,
)


class TestAnnotateMagsCard(TestPluginBase):
Expand Down
2 changes: 1 addition & 1 deletion q2_amr/card/tests/test_heatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
heatmap,
run_rgi_heatmap,
)
from q2_amr.types import CARDAnnotationDirectoryFormat
from q2_amr.card.types import CARDAnnotationDirectoryFormat


class TestHeatmap(TestPluginBase):
Expand Down
2 changes: 1 addition & 1 deletion q2_amr/card/tests/test_mags.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.types import CARDAnnotationDirectoryFormat, CARDDatabaseDirectoryFormat
from q2_amr.card.types import CARDAnnotationDirectoryFormat, CARDDatabaseDirectoryFormat


class TestAnnotateMagsCard(TestPluginBase):
Expand Down
2 changes: 1 addition & 1 deletion q2_amr/card/tests/test_partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
partition_reads_allele_annotations,
partition_reads_gene_annotations,
)
from q2_amr.types import (
from q2_amr.card.types import (
CARDAlleleAnnotationDirectoryFormat,
CARDAnnotationDirectoryFormat,
CARDGeneAnnotationDirectoryFormat,
Expand Down
2 changes: 1 addition & 1 deletion q2_amr/card/tests/test_reads.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from qiime2.plugin.testing import TestPluginBase

from q2_amr.card.reads import annotate_reads_card, run_rgi_bwt
from q2_amr.types import (
from q2_amr.card.types import (
CARDAlleleAnnotationDirectoryFormat,
CARDDatabaseDirectoryFormat,
CARDGeneAnnotationDirectoryFormat,
Expand Down
5 changes: 4 additions & 1 deletion q2_amr/card/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@
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,
create_count_table,
load_card_db,
read_in_txt,
)
from q2_amr.types import CARDDatabaseDirectoryFormat, CARDKmerDatabaseDirectoryFormat


class TestAnnotateReadsCARD(TestPluginBase):
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
from q2_types.genome_data import GenesDirectoryFormat, ProteinsDirectoryFormat
from skbio import DNA, Protein

from q2_amr.types import CARDAnnotationDirectoryFormat
from q2_amr.card.types import CARDAnnotationDirectoryFormat
from q2_amr.plugin_setup import plugin

from ..plugin_setup import plugin
from ._format import (
CARDAlleleAnnotationDirectoryFormat,
CARDAnnotationJSONFormat,
Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions q2_amr/card/types/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ----------------------------------------------------------------------------
# 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.
# ----------------------------------------------------------------------------
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
from qiime2.plugin.testing import TestPluginBase
from skbio import DNA, Protein

from q2_amr.types import (
from q2_amr.card.types import (
CARDAlleleAnnotationDirectoryFormat,
CARDDatabaseDirectoryFormat,
CARDGeneAnnotationDirectoryFormat,
)
from q2_amr.types._format import (
from q2_amr.card.types._format import (
CARDAnnotationDirectoryFormat,
CARDAnnotationTXTFormat,
CARDDatabaseFormat,
Expand All @@ -47,7 +47,7 @@
CARDWildcardIndexFormat,
GapDNAFASTAFormat,
)
from q2_amr.types._transformer import (
from q2_amr.card.types._transformer import (
_read_from_card_file,
card_annotation_df_to_fasta,
extract_sequence,
Expand All @@ -56,7 +56,7 @@


class AMRTypesTestPluginBase(TestPluginBase):
package = "q2_amr.types.tests"
package = "q2_amr.card.types.tests"

def setUp(self):
super().setUp()
Expand Down
8 changes: 4 additions & 4 deletions q2_amr/plugin_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@
partition_reads_gene_annotations,
)
from q2_amr.card.reads import annotate_reads_card
from q2_amr.types import (
from q2_amr.card.types import (
CARDAnnotationJSONFormat,
CARDAnnotationTXTFormat,
CARDDatabase,
CARDDatabaseDirectoryFormat,
CARDDatabaseFormat,
)
from q2_amr.types._format import (
from q2_amr.card.types._format import (
CARDAlleleAnnotationDirectoryFormat,
CARDAlleleAnnotationFormat,
CARDAnnotationDirectoryFormat,
Expand All @@ -71,7 +71,7 @@
CARDWildcardIndexFormat,
GapDNAFASTAFormat,
)
from q2_amr.types._type import (
from q2_amr.card.types._type import (
CARDAlleleAnnotation,
CARDAnnotation,
CARDGeneAnnotation,
Expand Down Expand Up @@ -524,4 +524,4 @@
CARDReadsAlleleKmerAnalysisDirectoryFormat,
)

importlib.import_module("q2_amr.types._transformer")
importlib.import_module("q2_amr.card.types._transformer")
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"assets/rgi/annotation_stats/*",
"assets/rgi/heatmap/*",
],
"q2_amr.types.tests": [
"q2_amr.card.types.tests": [
"data/*",
"data/*/*/*",
"data/*/*/*/*",
Expand Down

0 comments on commit d33e0cb

Please sign in to comment.