Skip to content

Commit

Permalink
REF: bowtie2
Browse files Browse the repository at this point in the history
  • Loading branch information
ebolyen committed Jul 22, 2024
1 parent a22a64a commit ccd25ff
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 23 deletions.
1 change: 0 additions & 1 deletion q2_types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
importlib.import_module('q2_types.tree')
importlib.import_module('q2_types.ordination')
importlib.import_module('q2_types.sample_data')
importlib.import_module('q2_types.bowtie2')
importlib.import_module('q2_types.metadata')
importlib.import_module('q2_types.multiplexed_sequences')
importlib.import_module('q2_types.kraken2')
Expand Down
5 changes: 0 additions & 5 deletions q2_types/bowtie2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,4 @@
from ._formats import (Bowtie2IndexFileFormat, Bowtie2IndexDirFmt)
from ._types import Bowtie2Index

from ..plugin_setup import plugin, citations

plugin.register_views(Bowtie2IndexDirFmt,
citations=[citations['langmead2012fast']])

__all__ = ['Bowtie2IndexFileFormat', 'Bowtie2IndexDirFmt', 'Bowtie2Index']
26 changes: 26 additions & 0 deletions q2_types/bowtie2/_deferred_setup/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# ----------------------------------------------------------------------------
# Copyright (c) 2016-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.plugin import Citations

from .. import Bowtie2IndexDirFmt
from .. import Bowtie2Index

from ...plugin_setup import plugin

citations = Citations.load('citations.bib', package='q2_types.bowtie2')
plugin.register_views(Bowtie2IndexDirFmt,
citations=[citations['langmead2012fast']])

plugin.register_semantic_types(Bowtie2Index)

plugin.register_artifact_class(
Bowtie2Index,
directory_format=Bowtie2IndexDirFmt,
description='An index of sequences for Bowtie 2 to search against.'
)
5 changes: 0 additions & 5 deletions q2_types/bowtie2/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,9 @@
# ----------------------------------------------------------------------------

from qiime2.plugin import SemanticType
from . import Bowtie2IndexDirFmt
from ..plugin_setup import plugin


# Technically there is a bit more to this, for instance the ref sequences may
# or may not be present in an index, or may be the only thing in an index,
# but let's not worry about that just yet.
Bowtie2Index = SemanticType('Bowtie2Index')

plugin.register_semantic_types(Bowtie2Index)
plugin.register_artifact_class(Bowtie2Index, Bowtie2IndexDirFmt)
10 changes: 10 additions & 0 deletions q2_types/bowtie2/citations.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@article{langmead2012fast,
title={Fast gapped-read alignment with Bowtie 2},
author={Langmead, Ben and Salzberg, Steven L},
journal={Nature methods},
volume={9},
number={4},
pages={357},
year={2012},
publisher={Nature Publishing Group}
}
11 changes: 0 additions & 11 deletions q2_types/citations.bib
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,3 @@ @InProceedings{ mckinney-proc-scipy-2010
year = { 2010 },
editor = { St{\'e}fan van der Walt and Jarrod Millman }
}

@article{langmead2012fast,
title={Fast gapped-read alignment with Bowtie 2},
author={Langmead, Ben and Salzberg, Steven L},
journal={Nature methods},
volume={9},
number={4},
pages={357},
year={2012},
publisher={Nature Publishing Group}
}
5 changes: 4 additions & 1 deletion q2_types/plugin_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
# The full license is in the file LICENSE, distributed with this software.
# ----------------------------------------------------------------------------

import importlib

import pandas as pd

import qiime2.plugin
import qiime2.sdk

Expand All @@ -26,4 +29,4 @@
plugin.register_views(pd.Series, pd.DataFrame,
citations=[citations['mckinney-proc-scipy-2010']])

# __init__.py loads first and imports all of the subpackages.
importlib.import_module('q2_types.bowtie2._deferred_setup')
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
package_data={
'q2_types': ['citations.bib'],
'q2_types.tests': ['data/*'],
'q2_types.bowtie2': ['citations.bib'],
'q2_types.distance_matrix.tests': ['data/*'],
'q2_types.feature_data.tests': ['data/*',
'data/taxonomy/*',
Expand Down

0 comments on commit ccd25ff

Please sign in to comment.