[med-svn] [Git][med-team/q2-quality-filter][upstream] New upstream version 2021.8.0

Andreas Tille (@tille) gitlab at salsa.debian.org
Wed Sep 29 16:01:29 BST 2021



Andreas Tille pushed to branch upstream at Debian Med / q2-quality-filter


Commits:
67aab201 by Andreas Tille at 2021-09-29T16:54:42+02:00
New upstream version 2021.8.0
- - - - -


16 changed files:

- + .github/workflows/ci.yml
- − .travis.yml
- LICENSE
- README.md
- − ci/recipe/conda_build_config.yaml
- ci/recipe/meta.yaml
- q2_quality_filter/__init__.py
- q2_quality_filter/_filter.py
- q2_quality_filter/_format.py
- q2_quality_filter/_transformer.py
- q2_quality_filter/_type.py
- q2_quality_filter/_version.py
- q2_quality_filter/plugin_setup.py
- q2_quality_filter/test/__init__.py
- q2_quality_filter/test/test_filter.py
- setup.py


Changes:

=====================================
.github/workflows/ci.yml
=====================================
@@ -0,0 +1,55 @@
+# This file is automatically generated by busywork.qiime2.org and
+# template-repos - any manual edits made to this file will be erased when
+# busywork performs maintenance updates.
+
+name: ci
+
+on:
+  pull_request:
+  push:
+    branches:
+      - master
+
+jobs:
+  lint:
+    runs-on: ubuntu-latest
+    steps:
+    - name: checkout source
+      uses: actions/checkout at v2
+
+    - name: set up python 3.8
+      uses: actions/setup-python at v1
+      with:
+        python-version: 3.8
+
+    - name: install dependencies
+      run: python -m pip install --upgrade pip
+
+    - name: lint
+      run: |
+        pip install -q https://github.com/qiime2/q2lint/archive/master.zip
+        q2lint
+        pip install -q flake8
+        flake8
+
+  build-and-test:
+    needs: lint
+    strategy:
+      matrix:
+        os: [ubuntu-latest, macos-latest]
+    runs-on: ${{ matrix.os }}
+    steps:
+    - name: checkout source
+      uses: actions/checkout at v2
+      with:
+        fetch-depth: 0
+
+    - name: set up git repo for versioneer
+      run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
+
+    - uses: qiime2/action-library-packaging at alpha1
+      with:
+        package-name: q2-quality-filter
+        build-target: dev
+        additional-tests: py.test --pyargs q2_quality_filter
+        library-token: ${{ secrets.LIBRARY_TOKEN }}


=====================================
.travis.yml deleted
=====================================
@@ -1,23 +0,0 @@
-dist: trusty
-sudo: false
-language: python
-before_install:
-  - export MPLBACKEND='Agg'
-  - wget -q https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
-  - export MINICONDA_PREFIX="$HOME/miniconda"
-  - bash miniconda.sh -b -p $MINICONDA_PREFIX
-  - export PATH="$MINICONDA_PREFIX/bin:$PATH"
-  - conda config --set always_yes yes
-  - conda update -q conda
-  - conda info -a
-install:
-  - wget -q https://raw.githubusercontent.com/qiime2/environment-files/master/latest/staging/qiime2-latest-py36-linux-conda.yml
-  - conda env create -q -n test-env --file qiime2-latest-py36-linux-conda.yml
-  - source activate test-env
-  - conda install -q pytest-cov
-  - pip install -q flake8
-  - pip install -q https://github.com/qiime2/q2lint/archive/master.zip
-  - make install
-script:
-  - make lint
-  - make test-cov


=====================================
LICENSE
=====================================
@@ -1,6 +1,6 @@
 BSD 3-Clause License
 
-Copyright (c) 2017-2020, QIIME 2 development team.
+Copyright (c) 2017-2021, QIIME 2 development team.
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without


=====================================
README.md
=====================================
@@ -1,5 +1,5 @@
 # q2-quality-filter
 
-[![Build Status](https://travis-ci.org/qiime2/q2-quality-filter.svg?branch=master)](https://travis-ci.org/qiime2/q2-quality-filter)
+![](https://github.com/qiime2/q2-quality-filter/workflows/ci/badge.svg)
 
-This is a QIIME 2 plugin. For details on QIIME 2, see https://qiime2.org..
+This is a QIIME 2 plugin. For details on QIIME 2, see https://qiime2.org..
\ No newline at end of file


=====================================
ci/recipe/conda_build_config.yaml deleted
=====================================
@@ -1,2 +0,0 @@
-python:
-  - 3.6


=====================================
ci/recipe/meta.yaml
=====================================
@@ -1,6 +1,5 @@
 {% set data = load_setup_py_data() %}
 {% set version = data.get('version') or 'placehold' %}
-{% set release = '.'.join(version.split('.')[:2]) %}
 
 package:
   name: q2-quality-filter
@@ -20,11 +19,18 @@ requirements:
   run:
     - python {{ python }}
     - pandas
-    - qiime2 {{ release }}.*
-    - q2templates {{ release }}.*
-    - q2-types {{ release }}.*
+    - numpy
+    - qiime2 {{ qiime2_epoch }}.*
+    - q2templates {{ qiime2_epoch }}.*
+    - q2-types {{ qiime2_epoch }}.*
 
 test:
+  requires:
+    - qiime2 >={{ qiime2 }}
+    - q2templates >={{ q2templates }}
+    - q2-types >={{ q2_types }}
+    - pytest
+
   imports:
     - q2_quality_filter
     - qiime2.plugins.quality_filter


=====================================
q2_quality_filter/__init__.py
=====================================
@@ -1,5 +1,5 @@
 # ----------------------------------------------------------------------------
-# Copyright (c) 2017-2020, QIIME 2 development team.
+# Copyright (c) 2017-2021, QIIME 2 development team.
 #
 # Distributed under the terms of the Modified BSD License.
 #


=====================================
q2_quality_filter/_filter.py
=====================================
@@ -1,5 +1,5 @@
 # ----------------------------------------------------------------------------
-# Copyright (c) 2017-2020, QIIME 2 development team.
+# Copyright (c) 2017-2021, QIIME 2 development team.
 #
 # Distributed under the terms of the Modified BSD License.
 #
@@ -20,10 +20,11 @@ from q2_types.per_sample_sequences import (
 def _read_fastq_seqs(filepath, phred_offset):
     # This function is adapted from @jairideout's SO post:
     # http://stackoverflow.com/a/39302117/3424666
-    fh = gzip.open(filepath, 'rt')
+    fh = gzip.open(filepath, 'rb')
     for seq_header, seq, qual_header, qual in itertools.zip_longest(*[fh] * 4):
         qual = qual.strip()
-        qual_parsed = np.fromstring(qual, dtype=np.uint8) - phred_offset
+        qual_parsed = np.frombuffer(memoryview(qual), dtype=np.uint8)
+        qual_parsed = qual_parsed - phred_offset
         yield (seq_header.strip(), seq.strip(), qual_header.strip(),
                qual, qual_parsed)
 
@@ -86,7 +87,8 @@ def q_score(demux: SingleLanePerSampleSingleEndFastqDirFmt,
     log_records_totalkept_counts = {}
 
     metadata_view = demux.metadata.view(YamlFormat).open()
-    phred_offset = yaml.load(metadata_view)['phred-offset']
+    phred_offset = yaml.load(metadata_view,
+                             Loader=yaml.SafeLoader)['phred-offset']
     demux_manifest = demux.manifest.view(demux.manifest.format)
     demux_manifest = pd.read_csv(demux_manifest.open(), dtype=str)
     demux_manifest.set_index('filename', inplace=True)
@@ -139,12 +141,11 @@ def q_score(demux: SingleLanePerSampleSingleEndFastqDirFmt,
                     continue
 
             # do not keep the read if there are too many ambiguous bases
-            if sequence_record[1].count('N') > max_ambiguous:
+            if sequence_record[1].count(b'N') > max_ambiguous:
                 log_records_max_ambig_counts[sample_id] += 1
                 continue
 
-            fastq_lines = '\n'.join(sequence_record[:4]) + '\n'
-            fastq_lines = fastq_lines.encode('utf-8')
+            fastq_lines = b'\n'.join(sequence_record[:4]) + b'\n'
 
             if writer is None:
                 writer = gzip.open(str(path), mode='w')


=====================================
q2_quality_filter/_format.py
=====================================
@@ -1,5 +1,5 @@
 # ----------------------------------------------------------------------------
-# Copyright (c) 2017-2020, QIIME 2 development team.
+# Copyright (c) 2017-2021, QIIME 2 development team.
 #
 # Distributed under the terms of the Modified BSD License.
 #


=====================================
q2_quality_filter/_transformer.py
=====================================
@@ -1,5 +1,5 @@
 # ----------------------------------------------------------------------------
-# Copyright (c) 2017-2020, QIIME 2 development team.
+# Copyright (c) 2017-2021, QIIME 2 development team.
 #
 # Distributed under the terms of the Modified BSD License.
 #
@@ -7,7 +7,6 @@
 # ----------------------------------------------------------------------------
 
 import pandas as pd
-import numpy as np
 import qiime2
 
 from .plugin_setup import plugin
@@ -22,12 +21,12 @@ def _1(data: pd.DataFrame) -> QualityFilterStatsFmt:
 
 
 _stats_column_dtypes = {
-    'sample-id': np.str,
-    'total-input-reads': np.number,
-    'total-retained-reads': np.number,
-    'reads-truncated': np.number,
-    'reads-too-short-after-truncation': np.number,
-    'reads-exceeding-maximum-ambiguous-bases': np.number
+    'sample-id': str,
+    'total-input-reads': int,
+    'total-retained-reads': int,
+    'reads-truncated': int,
+    'reads-too-short-after-truncation': int,
+    'reads-exceeding-maximum-ambiguous-bases': int,
 }
 
 


=====================================
q2_quality_filter/_type.py
=====================================
@@ -1,5 +1,5 @@
 # ----------------------------------------------------------------------------
-# Copyright (c) 2017-2020, QIIME 2 development team.
+# Copyright (c) 2017-2021, QIIME 2 development team.
 #
 # Distributed under the terms of the Modified BSD License.
 #


=====================================
q2_quality_filter/_version.py
=====================================
@@ -23,9 +23,9 @@ def get_keywords():
     # setup.py/versioneer.py will grep for the variable names, so they must
     # each be defined on a line of their own. _version.py will just call
     # get_keywords().
-    git_refnames = " (tag: 2020.11.1)"
-    git_full = "7230c7590aa3a3400df954a6333b63f2c8c276a1"
-    git_date = "2020-12-05 20:44:48 +0000"
+    git_refnames = " (tag: 2021.8.0)"
+    git_full = "16889091c5e035dc1a849aacdb6e90b55fe096b1"
+    git_date = "2021-09-09 18:35:30 +0000"
     keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
     return keywords
 


=====================================
q2_quality_filter/plugin_setup.py
=====================================
@@ -1,5 +1,5 @@
 # ----------------------------------------------------------------------------
-# Copyright (c) 2016-2020, QIIME 2 development team.
+# Copyright (c) 2016-2021, QIIME 2 development team.
 #
 # Distributed under the terms of the Modified BSD License.
 #


=====================================
q2_quality_filter/test/__init__.py
=====================================
@@ -1,5 +1,5 @@
 # ----------------------------------------------------------------------------
-# Copyright (c) 2016-2020, QIIME 2 development team.
+# Copyright (c) 2016-2021, QIIME 2 development team.
 #
 # Distributed under the terms of the Modified BSD License.
 #


=====================================
q2_quality_filter/test/test_filter.py
=====================================
@@ -1,5 +1,5 @@
 # ----------------------------------------------------------------------------
-# Copyright (c) 2016-2020, QIIME 2 development team.
+# Copyright (c) 2016-2021, QIIME 2 development team.
 #
 # Distributed under the terms of the Modified BSD License.
 #
@@ -11,7 +11,7 @@ import gzip
 import os
 
 import pandas as pd
-import pandas.util.testing as pdt
+import pandas.testing as pdt
 import qiime2
 from qiime2.sdk import Artifact
 import numpy as np
@@ -35,8 +35,8 @@ class FilterTests(TestPluginBase):
     package = 'q2_quality_filter.test'
 
     def test_read_fastq_seqs(self):
-        exp = [('@foo', 'ATGC', '+', 'IIII', np.array([40, 40, 40, 40])),
-               ('@bar', 'TGCA', '+', 'ABCD', np.array([32, 33, 34, 35]))]
+        exp = [(b'@foo', b'ATGC', b'+', b'IIII', np.array([40, 40, 40, 40])),
+               (b'@bar', b'TGCA', b'+', b'ABCD', np.array([32, 33, 34, 35]))]
         obs = list(_read_fastq_seqs(self.get_data_path('simple.fastq.gz'), 33))
         self.assertEqual(len(obs), 2)
 
@@ -120,8 +120,8 @@ class FilterTests(TestPluginBase):
                    'reads-truncated',
                    'reads-too-short-after-truncation',
                    'reads-exceeding-maximum-ambiguous-bases']
-        exp_drop_ambig_stats = pd.DataFrame([('foo', 2., 1., 0., 0., 1.),
-                                             ('bar', 1., 0., 0., 0., 1.)],
+        exp_drop_ambig_stats = pd.DataFrame([('foo', 2, 1, 0, 0, 1),
+                                             ('bar', 1, 0, 0, 0, 1)],
                                             columns=columns)
         exp_drop_ambig_stats = exp_drop_ambig_stats.set_index('sample-id')
         obs = []
@@ -145,8 +145,8 @@ class FilterTests(TestPluginBase):
                      "ATA",
                      "+",
                      "DDD"]
-        exp_trunc_stats = pd.DataFrame([('foo', 2., 1., 0., 0., 1.),
-                                        ('bar', 1., 1., 1., 0., 0.)],
+        exp_trunc_stats = pd.DataFrame([('foo', 2, 1, 0, 0, 1),
+                                        ('bar', 1, 1, 1, 0, 0)],
                                        columns=columns)
         exp_trunc_stats = exp_trunc_stats.set_index('sample-id')
 
@@ -231,7 +231,7 @@ class FilterTests(TestPluginBase):
                    'reads-truncated',
                    'reads-too-short-after-truncation',
                    'reads-exceeding-maximum-ambiguous-bases']
-        exp_stats = pd.DataFrame([('foo', 10., 6., 10., 4., 0.)],
+        exp_stats = pd.DataFrame([('foo', 10, 6, 10, 4, 0)],
                                  columns=columns)
         exp_stats = exp_stats.set_index('sample-id')
         obs = []
@@ -316,7 +316,7 @@ class FilterTests(TestPluginBase):
                    'reads-truncated',
                    'reads-too-short-after-truncation',
                    'reads-exceeding-maximum-ambiguous-bases']
-        exp_stats = pd.DataFrame([('foo', 10., 6., 10., 4., 0.)],
+        exp_stats = pd.DataFrame([('foo', 10, 6, 10, 4, 0)],
                                  columns=columns)
         exp_stats = exp_stats.set_index('sample-id')
         obs = []


=====================================
setup.py
=====================================
@@ -1,5 +1,5 @@
 # ----------------------------------------------------------------------------
-# Copyright (c) 2017-2020, QIIME 2 development team.
+# Copyright (c) 2017-2021, QIIME 2 development team.
 #
 # Distributed under the terms of the Modified BSD License.
 #



View it on GitLab: https://salsa.debian.org/med-team/q2-quality-filter/-/commit/67aab201bcef1ab6d86fefe5d8ad46741e60f59d

-- 
View it on GitLab: https://salsa.debian.org/med-team/q2-quality-filter/-/commit/67aab201bcef1ab6d86fefe5d8ad46741e60f59d
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20210929/1f3b3485/attachment-0001.htm>


More information about the debian-med-commit mailing list