diff --git a/.travis.yml b/.travis.yml index 771af7a..6f01d32 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: python dist: trusty sudo: false - + # command to install dependencies before_install: - wget -q https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh @@ -10,8 +10,8 @@ before_install: - export PATH="$MINICONDAS/bin:$PATH" - conda config --set always_yes yes - conda update -q conda - - wget https://raw.githubusercontent.com/qiime2/environment-files/master/latest/staging/qiime2-latest-py35-linux-conda.yml - - conda env create -n test-env --file qiime2-latest-py35-linux-conda.yml + - wget https://raw.githubusercontent.com/qiime2/environment-files/master/latest/staging/qiime2-latest-py36-linux-conda.yml + - conda env create -n test-env --file qiime2-latest-py36-linux-conda.yml - source activate test-env install: - conda config --add channels bioconda @@ -28,5 +28,3 @@ script: after_success: - codecov - - diff --git a/README.rst b/README.rst index 5d69e62..ec92925 100644 --- a/README.rst +++ b/README.rst @@ -52,7 +52,7 @@ Requirements/Dependencies ------------------------- * Qiime2 is required to run Q2-itsxpress (for stand alone software see ITSxpress_) -* To install Qiime2 follow these instructions: https://docs.qiime2.org/2018.8/install/ +* To install Qiime2 follow these instructions: https://docs.qiime2.org/2019.10/install/ Q2_itsxpress Installation ------------------------- @@ -61,7 +61,7 @@ Q2_itsxpress Installation .. code-block:: bash - source activate qiime2-2018.8 + source activate qiime2-2019.10 2. Install Q2_itsxpress using BioConda_. Be sure to install Q2_itsxpres in the Qiime2 environment. diff --git a/meta.yaml b/meta.yaml deleted file mode 100644 index f17612a..0000000 --- a/meta.yaml +++ /dev/null @@ -1,41 +0,0 @@ -{% set version = "1.4.1" %} -{% set name = "q2_itsxpress" %} -{% set file_ext = "tar.gz" %} -{% set hash_type = "sha256" %} -{% set hash_value = "f974a0c6e88cde4c064cc1d12e1567d4222df0af651eae748db23fe954d3b1db" %} - -package: - name: '{{ name|lower }}' - version: '{{ version }}' - -source: - url: 'https://files.pythonhosted.org/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.{{ file_ext }}' - sha256: '{{ hash_value }}' - -build: - number: 0 - entry_points: - - pip install q2-itsxpress - - -requirements: - build: - - python - - pip - run: - - python - - itsxpress - -test: - imports: - - q2_itsxpress - -about: - home: 'https://github.com/kweber1/q2_itsxpress' - summary: 'A qiime2 plugin using ITSxpress to trim the Internally transcribed spacer (ITS) region of FASTQ files' - license: 'License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication' - license_family: 'PUBLIC_DOMAIN' - license_file: '' - -extra: - recipe-maintainers : 'Adam R. Rivers, Kyle C. Weber' diff --git a/q2_itsxpress/_itsxpress.py b/q2_itsxpress/_itsxpress.py index ff048ab..a4cf3a7 100644 --- a/q2_itsxpress/_itsxpress.py +++ b/q2_itsxpress/_itsxpress.py @@ -38,6 +38,7 @@ def _set_fastqs_and_check(fastq: str, fastq2: str, sample_id: str, single_end: bool, + reversed_primers: bool, threads: int) -> object: """Checks and writes the fastqs as well as if they are paired end, interleaved and single end. @@ -69,14 +70,16 @@ def _set_fastqs_and_check(fastq: str, # Create SeqSample objects and merge if needed. if paired_end and interleaved: sobj = itsxpress.SeqSamplePairedInterleaved(fastq=fastq, - tempdir=None) + tempdir=None, + reversed_primers=reversed_primers) sobj._merge_reads(threads=threads) return sobj elif paired_end and not interleaved: sobj = itsxpress.SeqSamplePairedNotInterleaved(fastq=fastq, fastq2=fastq2, - tempdir=None) + tempdir=None, + reversed_primers=reversed_primers) sobj._merge_reads(threads=threads) return sobj @@ -116,6 +119,7 @@ def trim_single(per_sample_sequences: SingleLanePerSampleSingleEndFastqDirFmt, region=region, paired_in=False, paired_out=False, + reversed_primers=False, cluster_id=cluster_id) return results @@ -125,6 +129,7 @@ def trim_pair(per_sample_sequences: SingleLanePerSamplePairedEndFastqDirFmt, region: str, taxa: str = "F", threads: int = 1, + reversed_primers: bool = False, cluster_id: float = default_cluster_id) -> CasavaOneEightSingleLanePerSampleDirFmt: results = main(per_sample_sequences=per_sample_sequences, threads=threads, @@ -132,6 +137,7 @@ def trim_pair(per_sample_sequences: SingleLanePerSamplePairedEndFastqDirFmt, region=region, paired_in=True, paired_out=False, + reversed_primers=reversed_primers, cluster_id=cluster_id) return results @@ -140,6 +146,7 @@ def trim_pair_output_unmerged(per_sample_sequences: SingleLanePerSamplePairedEnd region: str, taxa: str = "F", threads: int = 1, + reversed_primers: bool = False, cluster_id: float = default_cluster_id) -> CasavaOneEightSingleLanePerSampleDirFmt: results = main(per_sample_sequences=per_sample_sequences, threads=threads, @@ -147,6 +154,7 @@ def trim_pair_output_unmerged(per_sample_sequences: SingleLanePerSamplePairedEnd region=region, paired_in=True, paired_out=True, + reversed_primers=reversed_primers, cluster_id=cluster_id) return results # The ITSxpress handling @@ -156,6 +164,7 @@ def main(per_sample_sequences, region: str, paired_in: bool, paired_out: bool, + reversed_primers: bool, cluster_id: float) -> CasavaOneEightSingleLanePerSampleDirFmt: """The main communication between the plugin and the ITSxpress program. @@ -190,6 +199,7 @@ def main(per_sample_sequences, fastq2=sample.reverse if paired_in else None, sample_id=sample.Index, single_end=paired_out, + reversed_primers=reversed_primers, threads=threads) # Deduplicate if math.isclose(cluster_id, 1,rel_tol=1e-05): diff --git a/q2_itsxpress/plugin_setup.py b/q2_itsxpress/plugin_setup.py index 55407ed..fd6fc2d 100644 --- a/q2_itsxpress/plugin_setup.py +++ b/q2_itsxpress/plugin_setup.py @@ -8,6 +8,7 @@ Int, Float, Range, + Bool, Citations) from q2_itsxpress._itsxpress import (trim_single, @@ -17,19 +18,20 @@ plugin = Plugin( name='itsxpress', - version='1.7.4', + version='1.8.0', package='q2_itsxpress', website='https://github.com/USDA-ARS-GBRU/q2_itsxpress ' 'ITSxpress: https://github.com/USDA-ARS-GBRU/itsxpress', - description='ITSxpress trims amplicon reads down to the just their ITS region. ' + description='ITSxpress trims amplicon reads down to their ITS region. ' 'ITSxpress is designed to support the calling of exact sequence variants ' 'rather than OTUs. This newer method of sequence error-correction requires ' 'quality score data from each sequence, so each input sequence must be trimmed. ' 'ITSxpress makes this possible by taking FASTQ data, de-replicating the ' 'sequences then identifying the start and stop sites using HMMSearch. ' 'Results are parsed and the trimmed files are returned. ' - 'The ITS 1, ITS2 or the entire ITS region including the 5.8s rRNA gene can be selected. ' - 'ITSxpress uses the hmm models from ITSx so results are comparable.', + 'The ITS 1, ITS2 or the entire ITS region including the 5.8s rRNA' + 'gene can be selected. ALL requires very long reads so it is not routinely' + 'used with Illumina data. ITSxpress uses the hmm models from ITSx so results are comparable.', short_description='Plugin for using ITSxpress to rapidly trim the\n' 'internally transcribed spacer (ITS) region of FASTQ files.', citations=Citations.load('citations.bib', package='q2_itsxpress') @@ -89,6 +91,7 @@ parameters={'region': Str % Choices(['ITS2', 'ITS1', 'ALL']), 'taxa': Str % Choices(taxaList), 'threads': Int, + 'reversed_primers': Bool, 'cluster_id': Float % Range(0.97, 1.0, inclusive_start=True, inclusive_end=True)}, outputs=[('trimmed', SampleData[JoinedSequencesWithQuality])], input_descriptions={'per_sample_sequences': 'The artifact that contains the sequence file(s). ' @@ -98,7 +101,8 @@ 'region': ('\nThe regions ITS2, ITS1, and ALL that can be selected from.'), 'taxa': ('\nThe selected taxonomic group sequenced that can be selected from.'), 'threads': ('\nThe number of processor threads to use in the run.'), - 'cluster_id': ('\nThe percent identity for clustering reads, set to 1 for exact dereplication.') + 'cluster_id': ('\nThe percent identity for clustering reads, set to 1 for exact dereplication.'), + 'reversed_primers': ('\n Primers are in reverse orientation as in Taylor et al. 2016, DOI:10.1128/AEM.02576-16.') }, output_descriptions={'trimmed': 'The resulting trimmed sequences from ITSxpress'}, name='Trim paired-end reads, output merged reads for use with Deblur', @@ -136,6 +140,7 @@ parameters={'region': Str % Choices(['ITS2', 'ITS1', 'ALL']), 'taxa': Str % Choices(taxaList), 'threads': Int, + 'reversed_primers': Bool, 'cluster_id': Float % Range(0.97, 1.0, inclusive_start=True, inclusive_end=True)}, outputs=[('trimmed', SampleData[PairedEndSequencesWithQuality])], input_descriptions={'per_sample_sequences': 'The artifact that contains the sequence file(s). ' @@ -145,7 +150,8 @@ 'region': ('\nThe regions ITS2, ITS1, and ALL that can be selected from.'), 'taxa': ('\nThe selected taxonomic group sequenced that can be selected from.'), 'threads': ('\nThe number of processor threads to use in the run.'), - 'cluster_id': ('\nThe percent identity for clustering reads, set to 1 for exact dereplication.') + 'cluster_id': ('\nThe percent identity for clustering reads, set to 1 for exact dereplication.'), + 'reversed_primers': ('\n Primers are in reverse orientation as in Taylor et al. 2016, DOI:10.1128/AEM.02576-16.') }, output_descriptions={'trimmed': 'The resulting trimmed sequences from ITSxpress'}, name='Trim paired-end reads, output unmerged reads for use with Dada2', diff --git a/setup.py b/setup.py index a3855d0..a681061 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='q2_itsxpress', - version='1.7.4', + version='1.8.0', packages=['q2_itsxpress'], author='Adam R. Rivers, Kyle C. Weber', author_email='adam.rivers@ars.usda.gov, kweber1@ufl.edu', @@ -19,7 +19,7 @@ python_requires=">3.5", include_package_data=True, install_requires=[ - 'itsxpress>=1.7.2', + 'itsxpress>=1.8.0', 'qiime2', 'pandas', ], diff --git a/tests/test_main.py b/tests/test_main.py index a23ef8b..481f1fc 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -78,6 +78,7 @@ def test_single(self): fastq2=None, sample_id=sample.Index, single_end=True, + reversed_primers=False, threads=1) self.assertTrue("4774-1-MSITS3" in obs.fastq) @@ -88,6 +89,7 @@ def test_paired(self): fastq2=sample.reverse, sample_id=sample.Index, single_end=True, + reversed_primers=False, threads=1) self.assertTrue("4774-1-MSITS3" in obs.fastq) @@ -98,6 +100,7 @@ def test_paired_unmerged(self): fastq2=sample.reverse, sample_id=sample.Index, single_end=False, + reversed_primers=False, threads=1) self.assertTrue("4774-1-MSITS3" in obs.fastq) self.assertTrue("4774-1-MSITS3" in obs.fastq2) @@ -109,11 +112,13 @@ def test_trim_pair_no_bb(self): fastq2=sample.reverse, sample_id=sample.Index, single_end=False, + reversed_primers=False, threads=1)) raises(ValueError, lambda: _itsxpress._set_fastqs_and_check(fastq=sample.forward, fastq2=sample.reverse, sample_id=sample.Index, single_end=True, + reversed_primers=False, threads=1))