[med-svn] [Git][med-team/q2-emperor][upstream] 2 commits: New upstream version 2021.8.0
Steffen Möller (@moeller)
gitlab at salsa.debian.org
Tue Jul 12 12:03:06 BST 2022
Steffen Möller pushed to branch upstream at Debian Med / q2-emperor
Commits:
e0b52436 by Steffen at 2021-12-04T22:49:21+01:00
New upstream version 2021.8.0
- - - - -
40d89c00 by Steffen Moeller at 2022-07-12T13:01:53+02:00
New upstream version 2022.2.0
- - - - -
14 changed files:
- + .github/workflows/ci.yml
- − .travis.yml
- LICENSE
- README.md
- − ci/recipe/conda_build_config.yaml
- ci/recipe/meta.yaml
- q2_emperor/__init__.py
- q2_emperor/_plot.py
- q2_emperor/_version.py
- q2_emperor/plugin_setup.py
- q2_emperor/tests/__init__.py
- q2_emperor/tests/test_plot.py
- q2_emperor/tests/test_plugin_setup.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-emperor
+ build-target: dev
+ additional-tests: py.test --pyargs q2_emperor
+ library-token: ${{ secrets.LIBRARY_TOKEN }}
=====================================
.travis.yml deleted
=====================================
@@ -1,25 +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 coveralls
- - pip install -q https://github.com/qiime2/q2lint/archive/master.zip
- - make install
-script:
- - make lint
- - make test-cov
-after_success:
- - coveralls
=====================================
LICENSE
=====================================
@@ -1,6 +1,6 @@
BSD 3-Clause License
-Copyright (c) 2016-2020, QIIME 2 development team.
+Copyright (c) 2016-2022, QIIME 2 development team.
All rights reserved.
Redistribution and use in source and binary forms, with or without
=====================================
README.md
=====================================
@@ -1,6 +1,5 @@
-# QIIME 2 Emperor plugin
+# q2-emperor
-[![Build Status](https://travis-ci.org/qiime2/q2-emperor.svg?branch=master)](https://travis-ci.org/qiime2/q2-emperor)
-[![Coverage Status](https://coveralls.io/repos/github/qiime2/q2-emperor/badge.svg?branch=master)](https://coveralls.io/github/qiime2/q2-emperor?branch=master)
+![](https://github.com/qiime2/q2-emperor/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-emperor
@@ -22,12 +21,18 @@ requirements:
- numpy
- pandas
- scikit-bio
- - emperor 1.0.1
- - qiime2 {{ release }}.*
- - q2templates {{ release }}.*
- - q2-types {{ release }}.*
+ - emperor ==1.0.3
+ - qiime2 {{ qiime2_epoch }}.*
+ - q2templates {{ qiime2_epoch }}.*
+ - q2-types {{ qiime2_epoch }}.*
test:
+ requires:
+ - qiime2 >={{ qiime2 }}
+ - q2templates >={{ q2templates }}
+ - q2-types >={{ q2_types }}
+ - pytest
+
imports:
- q2_emperor
- qiime2.plugins.emperor
=====================================
q2_emperor/__init__.py
=====================================
@@ -1,5 +1,5 @@
# ----------------------------------------------------------------------------
-# Copyright (c) 2016-2020, QIIME 2 development team.
+# Copyright (c) 2016-2022, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
=====================================
q2_emperor/_plot.py
=====================================
@@ -1,5 +1,5 @@
# ----------------------------------------------------------------------------
-# Copyright (c) 2016-2020, QIIME 2 development team.
+# Copyright (c) 2016-2022, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
@@ -12,7 +12,9 @@ import pkg_resources
import qiime2
import skbio
import q2templates
+import math
import numpy as np
+import pandas as pd
from emperor import Emperor
from scipy.spatial.distance import euclidean
@@ -22,7 +24,7 @@ TEMPLATES = pkg_resources.resource_filename('q2_emperor', 'assets')
def generic_plot(output_dir: str, master: skbio.OrdinationResults,
metadata: qiime2.Metadata,
other_pcoa: skbio.OrdinationResults,
- plot_name: str,
+ plot_name: str, info: str = None,
custom_axes: str = None, settings: dict = None,
ignore_missing_samples: bool = False,
feature_metadata: qiime2.Metadata = None):
@@ -46,6 +48,7 @@ def generic_plot(output_dir: str, master: skbio.OrdinationResults,
if other_pcoa:
viz.procrustes_names = ['reference', 'other']
+ viz.info = info
viz.settings = settings
html = viz.make_emperor(standalone=True)
@@ -76,12 +79,30 @@ def plot(output_dir: str, pcoa: skbio.OrdinationResults,
def procrustes_plot(output_dir: str, reference_pcoa: skbio.OrdinationResults,
other_pcoa: skbio.OrdinationResults,
- metadata: qiime2.Metadata, custom_axes: str = None,
+ metadata: qiime2.Metadata, m2_stats: pd.DataFrame = None,
+ custom_axes: str = None,
ignore_missing_samples: bool = False) -> None:
+ info = None
+ if m2_stats is not None:
+ m2 = '%.5f' % m2_stats['true M^2 value'][0]
+ permutations = m2_stats['number of Monte Carlo permutations'][0]
+ p_val = m2_stats['p-value for true M^2 value'][0]
+
+ if permutations < 1:
+ p_val = 'N/A'
+ else:
+ # Because the number of p-val dec places is dynamic, we need to
+ # dynamically build the string template up.
+ dec_places = math.ceil(math.log10(permutations))
+ p_val_tmpl = '%%.%df' % dec_places
+ p_val = p_val_tmpl % m2_stats['p-value for true M^2 value'][0]
+
+ info = 'M² = %s p-value = %s' % (m2, p_val)
+
generic_plot(output_dir, master=reference_pcoa, metadata=metadata,
other_pcoa=other_pcoa, custom_axes=custom_axes,
ignore_missing_samples=ignore_missing_samples,
- plot_name='procrustes_plot')
+ plot_name='procrustes_plot', info=info)
def biplot(output_dir: str, biplot: skbio.OrdinationResults,
=====================================
q2_emperor/_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 = "f05cd193415232ce62fd3c6144bc8a2adfe89a44"
- git_date = "2020-12-05 20:44:48 +0000"
+ git_refnames = " (tag: 2022.2.0)"
+ git_full = "0f7ca77ef3334269623ad4f5167a4b664032dff1"
+ git_date = "2022-02-18 18:31:39 +0000"
keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
return keywords
=====================================
q2_emperor/plugin_setup.py
=====================================
@@ -1,5 +1,5 @@
# ----------------------------------------------------------------------------
-# Copyright (c) 2016-2020, QIIME 2 development team.
+# Copyright (c) 2016-2022, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
@@ -12,7 +12,7 @@ from ._plot import plot, procrustes_plot, biplot
from qiime2.plugin import (Plugin, Metadata, Str, List, Citations, Range, Int,
Bool, Properties)
-from q2_types.ordination import PCoAResults
+from q2_types.ordination import PCoAResults, ProcrustesStatistics
PARAMETERS = {'metadata': Metadata, 'custom_axes': List[Str],
'ignore_missing_samples': Bool}
@@ -72,12 +72,15 @@ plugin.visualizers.register_function(
plugin.visualizers.register_function(
function=procrustes_plot,
- inputs={'reference_pcoa': PCoAResults, 'other_pcoa': PCoAResults},
+ inputs={'reference_pcoa': PCoAResults, 'other_pcoa': PCoAResults,
+ 'm2_stats': ProcrustesStatistics},
parameters=PARAMETERS,
input_descriptions={
'reference_pcoa': 'The reference ordination matrix to be plotted.',
'other_pcoa': 'The "other" ordination matrix to be plotted (the one '
- 'that was fitted to the reference).'
+ 'that was fitted to the reference).',
+ 'm2_stats': 'The M^2 value of the procrustes analysis & its associated'
+ ' p value.'
},
parameter_descriptions=PARAMETERS_DESC,
name='Visualize and Interact with a procrustes plot',
=====================================
q2_emperor/tests/__init__.py
=====================================
@@ -1,5 +1,5 @@
# ----------------------------------------------------------------------------
-# Copyright (c) 2016-2020, QIIME 2 development team.
+# Copyright (c) 2016-2022, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
=====================================
q2_emperor/tests/test_plot.py
=====================================
@@ -1,5 +1,5 @@
# ----------------------------------------------------------------------------
-# Copyright (c) 2016-2020, QIIME 2 development team.
+# Copyright (c) 2016-2022, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
=====================================
q2_emperor/tests/test_plugin_setup.py
=====================================
@@ -1,5 +1,5 @@
# ----------------------------------------------------------------------------
-# Copyright (c) 2016-2020, QIIME 2 development team.
+# Copyright (c) 2016-2022, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
=====================================
setup.py
=====================================
@@ -1,5 +1,5 @@
# ----------------------------------------------------------------------------
-# Copyright (c) 2016-2020, QIIME 2 development team.
+# Copyright (c) 2016-2022, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
View it on GitLab: https://salsa.debian.org/med-team/q2-emperor/-/compare/e514c150831eddd966d264d43e9273ba7ab9f7dd...40d89c0006fb1db534182a9f9443ee934bf5f934
--
View it on GitLab: https://salsa.debian.org/med-team/q2-emperor/-/compare/e514c150831eddd966d264d43e9273ba7ab9f7dd...40d89c0006fb1db534182a9f9443ee934bf5f934
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/20220712/aeafb3d5/attachment-0001.htm>
More information about the debian-med-commit
mailing list