Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #14 from USDA-ARS-GBRU/1.8.1-EOL
Browse files Browse the repository at this point in the history
1.8.1 eol
  • Loading branch information
seina001 authored Jun 3, 2023
2 parents a2a2e7b + 0a7a282 commit 6802b05
Show file tree
Hide file tree
Showing 8 changed files with 168 additions and 95 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Weekly Build and Test

on:
push:
branches:
- 1.8.1-EOL
schedule:
- cron: "0 0 */7 * *"


jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
max-parallel: 5

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.7
uses: actions/setup-python@v3
with:
python-version: '3.8.13'
- run: |
sudo apt update
sudo apt install gcc-10 g++-10
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Initiate conda channels
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: testenv
python-version: 3.8.13
channels: conda-forge,bioconda
allow-softlinks: true
channel-priority: flexible
show-channel-urls: true
use-only-tar-bz2: true

- name: Set up environment
run: |
wget https://data.qiime2.org/distro/core/qiime2-2022.8-py38-linux-conda.yml
conda env create -n qiime2-2022.8 --file qiime2-2022.8-py38-linux-conda.yml
- name: Install Dependencies
run: |
source activate qiime2-2022.8
conda install -y -c bioconda bbmap==38.69
pip install itsxpress==1.8.1
conda install biopython
pip install pyzstd
pip install pytest
pip install .
- name: Test with pytest
run: |
source activate qiime2-2022.8
pytest
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

67 changes: 47 additions & 20 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,22 +1,37 @@
Q2_ITSxpress: A Qiime2 plugin to rapidly trim the Internally transcribed spacer (ITS) region of FASTQ files
===========================================================================================================
.. image:: https://travis-ci.org/USDA-ARS-GBRU/q2_itsxpress.svg?branch=master
:target: https://travis-ci.org/USDA-ARS-GBRU/q2_itsxpress

.. image:: https://codecov.io/gh/USDA-ARS-GBRU/q2_itsxpress/branch/master/graph/badge.svg
:target: https://codecov.io/gh/USDA-ARS-GBRU/q2_itsxpress

.. image:: https://api.codacy.com/project/badge/Grade/4d00341b4abc4e04a77cf5ca6674cd3c
:target: https://www.codacy.com/app/USDA-ARS-GBRU/q2_itsxpress?utm_source=github.com&utm_medium=referral&utm_content=USDA-ARS-GBRU/q2_itsxpress&utm_campaign=Badge_Grade

.. image:: https://github.com/USDA-ARS-GBRU/q2_itsxpress/actions/workflows/python-package.yml/badge.svg
:target: https://github.com/USDA-ARS-GBRU/q2_itsxpress/actions/workflows/python-package.yml
:alt: Build Status

.. image:: https://img.shields.io/github/v/release/USDA-ARS-GBRU/q2_itsxpress?style=social
:target: https://github.com/USDA-ARS-GBRU/q2_itsxpress/releases/latest
:alt: GitHub release (latest by date)

.. image:: https://zenodo.org/badge/138209572.svg
:target: https://zenodo.org/badge/latestdoi/138209572



#####

**This is the end of life version 1 of q2_itsxpress and the command line version of ITSxpress.
The new version 2 of ITSxpress, has the Qiime2 plugin built in with command line version of ITSxpress. See
1.8.1-EOL branch of ITSxpress.**

#####

See ITSxpress 1.8.1-EOL branch here: ITSxpress-1.8.1-EOL_

.. _`ITSxpress-1.8.1-EOL`: https://github.com/USDA-ARS-GBRU/itsxpress/tree/1.8.1-EOL


Authors
-------
* Adam R. Rivers, US Department of Agriculture, Agricultural Research Service
* Kyle C. Weber, US Department of Agriculture, Agricultural Research Service
* Sveinn V. Einarsson, US Department of Agriculture, Agricultural Research Service

Citation
--------
Expand All @@ -36,8 +51,8 @@ length spacer regions. In amplicon sequencing studies it is common practice to
trim off the conserved (SSU, 5,8S or LSU) regions. Bengtsson-Palme et al. (2013)
published a software package ITSx_ to do this.

Q2_ITSxpress extends this work by rapidly trimming FASTQ sequences within
Qiime2. Q2_ITSxpress is the Qiime2 plugin version of the stand alone command
Q2-ITSxpress extends this work by rapidly trimming FASTQ sequences within
Qiime2. Q2-ITSxpress is the Qiime2 plugin version of the stand alone command
line utility ITSxpress_. Q2_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
Expand All @@ -52,37 +67,49 @@ 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/2019.10/install/
* To install Qiime2 follow these instructions: https://docs.qiime2.org/2022.8/install/
* This end of life version 1 of q2-itsxpress and ITSxpress is **ONLY** compatible with Qiime2 version 2022.8. So make sure to follow the link above.

Q2_itsxpress Installation
-------------------------
* We are using mamba because it resolves packages better and faster, but conda can be substituted.
- Information on installing mamba or micromamba (either highly recommended) can be found here: `mamba installation guide`_

.. _`mamba installation guide`: https://mamba.readthedocs.io/en/latest/installation.html

Q2-itsxpress plugin installation
--------------------------------
1. Example on how to install and create new Qiime2-2022.8 environment.

.. code-block:: bash
wget https://data.qiime2.org/distro/core/qiime2-2022.8-py38-osx-conda.yml
mamba env create -n qiime2-2022.8 --file qiime2-2022.8-py38-osx-conda.yml
1. Activate the Qiime2 conda environment
2. Activate the Qiime2 conda environment

.. code-block:: bash
source activate qiime2-2019.10
mamba activate qiime2-2022.8
2. Install Q2_itsxpress using BioConda_. Be sure to install Q2_itsxpres in the Qiime2 environment.
3. Install Q2_itsxpress using BioConda_. Be sure to install itsxpress and q2_itsxpress in the Qiime2 environment using the following commands.

.. code-block:: bash
conda install -c bioconda itsxpress
mamba install -c bioconda itsxpress==1.8.1
pip install q2-itsxpress
3. In your Qiime2 environment, refresh the plugins.
4. In your Qiime2 environment, refresh the plugins.

.. code-block:: bash
qiime dev refresh-cache
4. Check to see if the ITSxpress plugin is installed. You should see an output similar to the image below.
5. Check to see if the ITSxpress plugin is installed. You should see an output similar to the image below.

.. code-block:: bash
qiime itsxpress
.. image:: ../../screenshot.png
.. image:: ./screenshot.png

Usage
-----
Expand Down
49 changes: 49 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"


[project]
name = "q2_itsxpress"
version = "1.8.1"
description = "A QIIME2 plugin to trim ITS regions using ITSxpress"
authors = [
{name = "Adam R. Rivers", email = "adam.rivers@usda.gov"},
{name = "Sveinn V. Einarsson", email = "seinarsson@ufl.edu"}]
maintainers = [
{name = "Adam R. Rivers", email = "adam.rivers@usda.gov"},
{name = "Sveinn V. Einarsson", email = "seinarsson@ufl.edu"}]
license = {file = "LICENSE.txt"}
readme = "README.rst"
keywords = ["Qiime2", "plugin", "Amplicon", "sequencing", "fungal", "ITS"]
requires-python = ">=3.5"

dependencies = [
"qiime2",
"itsxpress >=1.8.1",
"pandas",
]

classifiers = [
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.5",
"Development Status :: 3 - Alpha"
]


[project.urls]
repository = "http://github.com/usda-ars-gbru/q2_itsxpress"



[project.optional-dependencies]
tests = [
"pytest"
]

[project.entry-points."qiime2.plugins"]
q2_itsxpress="q2_itsxpress.plugin_setup:plugin"

[tool.setuptools.package-data]
q2_itsxpress = ["*.bib"]
19 changes: 8 additions & 11 deletions q2_itsxpress/_itsxpress.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env python
"""A python module to integrate ITSxpress into QIIME for the trimming of amplicon sequences.
Authors: Adam Rivers and Kyle Weber, USDA Agricultural Research Service
Authors: Adam Rivers, Kyle Weber, Sveinn V. Einarsson USDA Agricultural Research Service
#####This is the end of life version 1 of the qiime2 plugin for ITSxpress. Please check Github page below to access version 2 of ITSxpress#####
The internally transcribed spacer region is a region between the highly conserved small
subunit (SSU) of rRNA and the large subunit (LSU) of the rRNA. The eukaryotic ITS contains
Expand Down Expand Up @@ -40,7 +42,7 @@ def _set_fastqs_and_check(fastq: 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.
"""Checks and writes the fastqs as well as if they are paired end and single end.
Args:
fastq (str): The path to the forward reads file.
Expand Down Expand Up @@ -68,22 +70,17 @@ def _set_fastqs_and_check(fastq: str,

raise ValueError("There is a problem with the fastq file(s) you selected")
# Create SeqSample objects and merge if needed.
if paired_end and interleaved:
sobj = itsxpress.SeqSamplePairedInterleaved(fastq=fastq,
tempdir=None,
reversed_primers=reversed_primers)
sobj._merge_reads(threads=threads)
return sobj

elif paired_end and not interleaved:

if paired_end:
sobj = itsxpress.SeqSamplePairedNotInterleaved(fastq=fastq,
fastq2=fastq2,
tempdir=None,
reversed_primers=reversed_primers)
sobj._merge_reads(threads=threads)
return sobj

elif not paired_end and not interleaved:
elif not paired_end:
sobj = itsxpress.SeqSampleNotPaired(fastq=fastq,
tempdir=None)
return sobj
Expand Down Expand Up @@ -198,7 +195,7 @@ def main(per_sample_sequences,
fastq=sample.forward,
fastq2=sample.reverse if paired_in else None,
sample_id=sample.Index,
single_end=paired_out,
single_end=False if paired_in else True,
reversed_primers=reversed_primers,
threads=threads)
# Deduplicate
Expand Down
8 changes: 5 additions & 3 deletions q2_itsxpress/plugin_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
default_cluster_id)

plugin = Plugin(
name='itsxpress',
version='1.8.0',
name='q2_itsxpress',
version='1.8.1',
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 their ITS region. '
description='#####This is the end of life version 1 of ITSxpress. Please check Github for version 2'
'of ITSxpress.#####'
'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. '
Expand Down
30 changes: 0 additions & 30 deletions setup.py

This file was deleted.

3 changes: 2 additions & 1 deletion tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def test_trim_single_no_cluster():
exp3 = getsizeof(TEST_DATA_SINGLEOUT)
eq_(exp2, exp3)


def test_trim_pair_no_hmmer():
threads = 1
taxa = "F"
Expand All @@ -149,7 +150,7 @@ def test_trim_pair_no_hmmer():

class TrimTests(unittest.TestCase):
def setUp(self):
self.plugin = qiime2.sdk.PluginManager().plugins['itsxpress']
self.plugin = qiime2.sdk.PluginManager().plugins['q2_itsxpress']
self.trim_single_fn = self.plugin.methods['trim_single']
self.trim_paired_fn = self.plugin.methods['trim_pair']
self.trim_paired_unmerged_fn = \
Expand Down

0 comments on commit 6802b05

Please sign in to comment.