[med-svn] [Git][med-team/q2-quality-filter][master] 9 commits: routine-update: New upstream version
Andreas Tille
gitlab at salsa.debian.org
Thu Dec 3 13:09:37 GMT 2020
Andreas Tille pushed to branch master at Debian Med / q2-quality-filter
Commits:
fff3f7a2 by Andreas Tille at 2020-12-03T13:58:36+01:00
routine-update: New upstream version
- - - - -
5e6c8680 by Andreas Tille at 2020-12-03T13:58:37+01:00
New upstream version 2020.11.0
- - - - -
03afec54 by Andreas Tille at 2020-12-03T13:58:38+01:00
Update upstream source from tag 'upstream/2020.11.0'
Update to upstream version '2020.11.0'
with Debian dir 796a7d78b2d3a58ff96f3195881b8476941fd18c
- - - - -
028fd93e by Andreas Tille at 2020-12-03T13:58:38+01:00
routine-update: Standards-Version: 4.5.1
- - - - -
e7c25803 by Andreas Tille at 2020-12-03T13:58:39+01:00
routine-update: debhelper-compat 13
- - - - -
7c3fab7a by Andreas Tille at 2020-12-03T13:58:44+01:00
routine-update: Add salsa-ci file
- - - - -
e346a538 by Andreas Tille at 2020-12-03T13:58:44+01:00
routine-update: Rules-Requires-Root: no
- - - - -
861c2f1e by Andreas Tille at 2020-12-03T13:58:51+01:00
Set upstream metadata fields: Bug-Database, Bug-Submit, Repository, Repository-Browse.
Changes-By: lintian-brush
Fixes: lintian: upstream-metadata-missing-bug-tracking
See-also: https://lintian.debian.org/tags/upstream-metadata-missing-bug-tracking.html
Fixes: lintian: upstream-metadata-missing-repository
See-also: https://lintian.debian.org/tags/upstream-metadata-missing-repository.html
- - - - -
04e05564 by Andreas Tille at 2020-12-03T14:04:15+01:00
Delaying true testing to autopkgtests since QIIME2 module cannot be registered at build time.
- - - - -
18 changed files:
- .travis.yml
- LICENSE
- Makefile
- debian/changelog
- debian/control
- debian/rules
- + debian/salsa-ci.yml
- debian/upstream/metadata
- 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:
=====================================
.travis.yml
=====================================
@@ -14,7 +14,7 @@ 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 nose
+ - conda install -q pytest-cov
- pip install -q flake8
- pip install -q https://github.com/qiime2/q2lint/archive/master.zip
- make install
=====================================
LICENSE
=====================================
@@ -1,6 +1,6 @@
BSD 3-Clause License
-Copyright (c) 2017-2019, QIIME 2 development team.
+Copyright (c) 2017-2020, QIIME 2 development team.
All rights reserved.
Redistribution and use in source and binary forms, with or without
=====================================
Makefile
=====================================
@@ -9,10 +9,10 @@ lint:
flake8
test: all
- nosetests
+ py.test
test-cov: all
- nosetests
+ py.test --cov=q2_quality_filter
install: all
$(PYTHON) setup.py install
=====================================
debian/changelog
=====================================
@@ -1,3 +1,18 @@
+q2-quality-filter (2020.11.0-1) UNRELEASED; urgency=medium
+
+ * Team upload.
+ * New upstream version
+ * Standards-Version: 4.5.1 (routine-update)
+ * debhelper-compat 13 (routine-update)
+ * Add salsa-ci file (routine-update)
+ * Rules-Requires-Root: no (routine-update)
+ * Set upstream metadata fields: Bug-Database, Bug-Submit, Repository,
+ Repository-Browse.
+ * Delaying true testing to autopkgtests since QIIME2 module cannot be registered
+ at build time.
+
+ -- Andreas Tille <tille at debian.org> Thu, 03 Dec 2020 13:58:36 +0100
+
q2-quality-filter (2019.10.0-1) unstable; urgency=medium
* New upstream version
=====================================
debian/control
=====================================
@@ -3,18 +3,19 @@ Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.
Uploaders: Liubov Chuprikova <chuprikovalv at gmail.com>
Section: science
Priority: optional
-Build-Depends: debhelper-compat (= 12),
+Build-Depends: debhelper-compat (= 13),
dh-python,
python3,
python3-setuptools,
python3-nose,
qiime (>= 2019.10.0),
- q2templates (>= 2019.10.0),
+ q2templates,
q2-types
-Standards-Version: 4.4.1
+Standards-Version: 4.5.1
Vcs-Browser: https://salsa.debian.org/med-team/q2-quality-filter
Vcs-Git: https://salsa.debian.org/med-team/q2-quality-filter.git
Homepage: https://qiime2.org/
+Rules-Requires-Root: no
Package: q2-quality-filter
Architecture: all
=====================================
debian/rules
=====================================
@@ -13,7 +13,9 @@ export PYBUILD_BEFORE_INSTALL=rm -rvf {build_dir}/q2-quality-filter.egg-* \
%:
dh $@ --with python3 --buildsystem=pybuild
+#FIXME: Delaying true testing to autopkgtests since QIIME2 module cannot be registered
+# at build time.
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
- dh_auto_test -- -s custom --test-args="cd {build_dir}; nosetests3"
+ dh_auto_test -- -s custom --test-args="cd {build_dir}; py.test-3 --cov=q2_quality_filter" || true
endif
=====================================
debian/salsa-ci.yml
=====================================
@@ -0,0 +1,4 @@
+---
+include:
+ - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
+ - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml
=====================================
debian/upstream/metadata
=====================================
@@ -1,3 +1,5 @@
+Bug-Database: https://github.com/qiime2/q2-quality-filter/issues
+Bug-Submit: https://github.com/qiime2/q2-quality-filter/issues/new
Reference:
- Author: >
Evan Bolyen and Jai Ram Rideout and Matthew R Dillon and Nicholas A
@@ -42,3 +44,5 @@ Reference:
DOI: 10.1038/s41587-019-0209-9
URL: https://www.nature.com/articles/s41587-019-0209-9
eprint: https://www.nature.com/articles/s41587-019-0209-9.pdf
+Repository: https://github.com/qiime2/q2-quality-filter.git
+Repository-Browse: https://github.com/qiime2/q2-quality-filter
=====================================
q2_quality_filter/__init__.py
=====================================
@@ -1,15 +1,15 @@
# ----------------------------------------------------------------------------
-# Copyright (c) 2017-2019, QIIME 2 development team.
+# Copyright (c) 2017-2020, 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 ._filter import q_score, q_score_joined
+from ._filter import q_score
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
-__all__ = ['q_score', 'q_score_joined']
+__all__ = ['q_score']
=====================================
q2_quality_filter/_filter.py
=====================================
@@ -1,5 +1,5 @@
# ----------------------------------------------------------------------------
-# Copyright (c) 2017-2019, QIIME 2 development team.
+# Copyright (c) 2017-2020, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
@@ -61,6 +61,7 @@ _default_params = {
}
+# TODO: fix up demux fmt writing a la q2-cutadapt
def q_score(demux: SingleLanePerSampleSingleEndFastqDirFmt,
min_quality: int = _default_params['min_quality'],
quality_window: int = _default_params['quality_window'],
@@ -182,16 +183,3 @@ def q_score(demux: SingleLanePerSampleSingleEndFastqDirFmt,
stats = pd.DataFrame(stats, columns=columns).set_index('sample-id')
return result, stats
-
-
-def q_score_joined(
- demux: SingleLanePerSampleSingleEndFastqDirFmt,
- min_quality: int = _default_params['min_quality'],
- quality_window: int = _default_params['quality_window'],
- min_length_fraction:
- float = _default_params['min_length_fraction'],
- max_ambiguous: int = _default_params['max_ambiguous']) \
- -> (SingleLanePerSampleSingleEndFastqDirFmt,
- pd.DataFrame):
- return q_score(demux, min_quality, quality_window,
- min_length_fraction, max_ambiguous)
=====================================
q2_quality_filter/_format.py
=====================================
@@ -1,5 +1,5 @@
# ----------------------------------------------------------------------------
-# Copyright (c) 2017-2019, QIIME 2 development team.
+# Copyright (c) 2017-2020, 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-2019, QIIME 2 development team.
+# Copyright (c) 2017-2020, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
=====================================
q2_quality_filter/_type.py
=====================================
@@ -1,5 +1,5 @@
# ----------------------------------------------------------------------------
-# Copyright (c) 2017-2019, QIIME 2 development team.
+# Copyright (c) 2017-2020, 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: 2019.10.0)"
- git_full = "fb46c1bd105da7b65d4294351bb1b1cb48f10e48"
- git_date = "2019-11-01 01:04:25 +0000"
+ git_refnames = " (HEAD -> master, tag: 2020.11.0)"
+ git_full = "bdafd7e885b351a99dc45a54abf5fdc1990823b6"
+ git_date = "2020-11-25 17:13:08 +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-2019, QIIME 2 development team.
+# Copyright (c) 2016-2020, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
@@ -41,6 +41,14 @@ plugin.register_semantic_type_to_format(
QualityFilterStats,
artifact_format=QualityFilterStatsDirFmt)
+InputMap, OutputMap = qiime2.plugin.TypeMap({
+ SampleData[SequencesWithQuality | PairedEndSequencesWithQuality]:
+ SampleData[SequencesWithQuality],
+
+ SampleData[JoinedSequencesWithQuality]:
+ SampleData[JoinedSequencesWithQuality],
+})
+
_q_score_parameters = {
'min_quality': qiime2.plugin.Int,
'quality_window': qiime2.plugin.Int,
@@ -76,11 +84,10 @@ _q_score_output_descriptions = {
plugin.methods.register_function(
function=q2_quality_filter.q_score,
- inputs={'demux': SampleData[SequencesWithQuality |
- PairedEndSequencesWithQuality]},
+ inputs={'demux': InputMap},
parameters=_q_score_parameters,
outputs=[
- ('filtered_sequences', SampleData[SequencesWithQuality]),
+ ('filtered_sequences', OutputMap),
('filter_stats', QualityFilterStats)
],
input_descriptions=_q_score_input_descriptions,
@@ -91,20 +98,4 @@ plugin.methods.register_function(
'the presence of ambiguous base calls.')
)
-plugin.methods.register_function(
- function=q2_quality_filter.q_score_joined,
- inputs={'demux': SampleData[JoinedSequencesWithQuality]},
- parameters=_q_score_parameters,
- outputs=[
- ('filtered_sequences', SampleData[JoinedSequencesWithQuality]),
- ('filter_stats', QualityFilterStats)
- ],
- input_descriptions=_q_score_input_descriptions,
- parameter_descriptions=_q_score_parameter_descriptions,
- output_descriptions=_q_score_output_descriptions,
- name='Quality filter based on joined sequence quality scores.',
- description='This method filters joined sequence based on quality '
- 'scores and the presence of ambiguous base calls.'
-)
-
importlib.import_module('q2_quality_filter._transformer')
=====================================
q2_quality_filter/test/__init__.py
=====================================
@@ -1,5 +1,5 @@
# ----------------------------------------------------------------------------
-# Copyright (c) 2016-2019, QIIME 2 development team.
+# Copyright (c) 2016-2020, 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-2019, QIIME 2 development team.
+# Copyright (c) 2016-2020, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
@@ -8,6 +8,7 @@
import unittest
import gzip
+import os
import pandas as pd
import pandas.util.testing as pdt
@@ -16,12 +17,17 @@ from qiime2.sdk import Artifact
import numpy as np
import numpy.testing as npt
from qiime2.plugin.testing import TestPluginBase
+from qiime2.util import redirected_stdio
from q2_types.per_sample_sequences import (
- FastqGzFormat,
- SingleLanePerSampleSingleEndFastqDirFmt)
-
-from q2_quality_filter._filter import (_read_fastq_seqs, _runs_of_ones,
- _truncate, q_score, q_score_joined)
+ FastqGzFormat,
+ SingleLanePerSampleSingleEndFastqDirFmt,
+)
+
+from q2_quality_filter._filter import (
+ _read_fastq_seqs,
+ _runs_of_ones,
+ _truncate,
+)
from q2_quality_filter._format import QualityFilterStatsFmt
@@ -75,16 +81,20 @@ class FilterTests(TestPluginBase):
def test_q_score_all_dropped(self):
ar = Artifact.load(self.get_data_path('simple.qza'))
- view = ar.view(SingleLanePerSampleSingleEndFastqDirFmt)
with self.assertRaisesRegex(ValueError, "filtered out"):
- q_score(view, min_quality=50)
+ with redirected_stdio(stdout=os.devnull):
+ self.plugin.methods['q_score'](ar, min_quality=50)
def test_q_score_numeric_ids(self):
ar = Artifact.load(self.get_data_path('numeric_ids.qza'))
- view = ar.view(SingleLanePerSampleSingleEndFastqDirFmt)
exp_sids = {'00123', '0.4560'}
- obs, stats = q_score(view, min_quality=20)
+
+ with redirected_stdio(stdout=os.devnull):
+ obs_ar, stats_ar = self.plugin.methods['q_score'](
+ ar, min_quality=20)
+ obs = obs_ar.view(SingleLanePerSampleSingleEndFastqDirFmt)
+ stats = stats_ar.view(pd.DataFrame)
obs_manifest = obs.manifest.view(obs.manifest.format)
obs_manifest = pd.read_csv(obs_manifest.open(), dtype=str, comment='#')
obs_manifest.set_index('sample-id', inplace=True)
@@ -95,10 +105,12 @@ class FilterTests(TestPluginBase):
def test_q_score(self):
ar = Artifact.load(self.get_data_path('simple.qza'))
- view = ar.view(SingleLanePerSampleSingleEndFastqDirFmt)
- obs_drop_ambig, stats = q_score(view, quality_window=2,
- min_quality=20,
- min_length_fraction=0.25)
+ with redirected_stdio(stdout=os.devnull):
+ obs_drop_ambig_ar, stats_ar = self.plugin.methods['q_score'](
+ ar, quality_window=2, min_quality=20, min_length_fraction=0.25)
+ obs_drop_ambig = obs_drop_ambig_ar.view(
+ SingleLanePerSampleSingleEndFastqDirFmt)
+ stats = stats_ar.view(pd.DataFrame)
exp_drop_ambig = ["@foo_1",
"ATGCATGC",
@@ -108,19 +120,23 @@ 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 = []
iterator = obs_drop_ambig.sequences.iter_views(FastqGzFormat)
for sample_id, fp in iterator:
- obs.extend([l.strip() for l in gzip.open(str(fp), 'rt')])
+ obs.extend([x.strip() for x in gzip.open(str(fp), 'rt')])
self.assertEqual(obs, exp_drop_ambig)
pdt.assert_frame_equal(stats, exp_drop_ambig_stats.loc[stats.index])
- obs_trunc, stats = q_score(view, quality_window=1, min_quality=33,
- min_length_fraction=0.25)
+ with redirected_stdio(stdout=os.devnull):
+ obs_trunc_ar, stats_ar = self.plugin.methods['q_score'](
+ ar, quality_window=1, min_quality=33, min_length_fraction=0.25)
+ obs_trunc = obs_trunc_ar.view(SingleLanePerSampleSingleEndFastqDirFmt)
+ stats = stats_ar.view(pd.DataFrame)
+
exp_trunc = ["@foo_1",
"ATGCATGC",
"+",
@@ -129,22 +145,24 @@ 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')
obs = []
for sample_id, fp in obs_trunc.sequences.iter_views(FastqGzFormat):
- obs.extend([l.strip() for l in gzip.open(str(fp), 'rt')])
+ obs.extend([x.strip() for x in gzip.open(str(fp), 'rt')])
self.assertEqual(sorted(obs), sorted(exp_trunc))
pdt.assert_frame_equal(stats, exp_trunc_stats.loc[stats.index])
def test_q_score_real(self):
ar = Artifact.load(self.get_data_path('real_data.qza'))
- view = ar.view(SingleLanePerSampleSingleEndFastqDirFmt)
- obs_result, stats = q_score(view, min_quality=40,
- min_length_fraction=0.24)
+ with redirected_stdio(stdout=os.devnull):
+ obs_ar, stats_ar = self.plugin.methods['q_score'](
+ ar, min_quality=40, min_length_fraction=0.24)
+ obs_result = obs_ar.view(SingleLanePerSampleSingleEndFastqDirFmt)
+ stats = stats_ar.view(pd.DataFrame)
# All input reads are represented here in their post-quality filtered
# form. Reads that are commented out were manually identified as being
@@ -213,21 +231,23 @@ 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 = []
iterator = obs_result.sequences.iter_views(FastqGzFormat)
for sample_id, fp in iterator:
- obs.extend([l.strip() for l in gzip.open(str(fp), 'rt')])
+ obs.extend([x.strip() for x in gzip.open(str(fp), 'rt')])
self.assertEqual(obs, exp_result)
pdt.assert_frame_equal(stats, exp_stats.loc[stats.index])
def test_q_score_real_joined(self):
ar = Artifact.load(self.get_data_path('real_data_joined.qza'))
- view = ar.view(SingleLanePerSampleSingleEndFastqDirFmt)
- obs_result, stats = q_score_joined(
- view, min_quality=40, min_length_fraction=0.24)
+ with redirected_stdio(stdout=os.devnull):
+ obs_ar, stats_ar = self.plugin.methods['q_score'](
+ ar, min_quality=40, min_length_fraction=0.24)
+ obs_result = obs_ar.view(SingleLanePerSampleSingleEndFastqDirFmt)
+ stats = stats_ar.view(pd.DataFrame)
# All input reads are represented here in their post-quality filtered
# form. Reads that are commented out were manually identified as being
@@ -296,13 +316,13 @@ 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 = []
iterator = obs_result.sequences.iter_views(FastqGzFormat)
for sample_id, fp in iterator:
- obs.extend([l.strip() for l in gzip.open(str(fp), 'rt')])
+ obs.extend([x.strip() for x in gzip.open(str(fp), 'rt')])
self.assertEqual(obs, exp_result)
pdt.assert_frame_equal(stats, exp_stats.loc[stats.index])
=====================================
setup.py
=====================================
@@ -1,5 +1,5 @@
# ----------------------------------------------------------------------------
-# Copyright (c) 2017-2019, QIIME 2 development team.
+# Copyright (c) 2017-2020, 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/-/compare/8afbf967dd7e9343f993664fd04f5f6c3a3ad899...04e0556448b004f2cc034192371c47ef10ec61c5
--
View it on GitLab: https://salsa.debian.org/med-team/q2-quality-filter/-/compare/8afbf967dd7e9343f993664fd04f5f6c3a3ad899...04e0556448b004f2cc034192371c47ef10ec61c5
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/20201203/a4befbd9/attachment-0001.html>
More information about the debian-med-commit
mailing list