diff --git a/.github/workflows/test_and_lint.yml b/.github/workflows/test_and_lint.yml index 660ebf1..1bf6bf3 100644 --- a/.github/workflows/test_and_lint.yml +++ b/.github/workflows/test_and_lint.yml @@ -12,23 +12,22 @@ jobs: - uses: actions/setup-python@v2 - uses: psf/black@stable build: - runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7, 3.8, 3.9] + python-version: [3.8, 3.9] steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install . - pip install pytest - - name: Test with pytest - run: | - pytest + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install . + pip install pytest + - name: Test with pytest + run: | + pytest diff --git a/CITATION.cff b/CITATION.cff index 53d2993..1c955f9 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -8,5 +8,5 @@ authors: given-names: "Rodrigo Juliani" orcid: https://orcid.org/0000-0002-1688-6155 title: "MicroView" -version: 0.9.5 +version: 0.9.6 url: "https://github.com/jvfe/microview" diff --git a/microview/__init__.py b/microview/__init__.py index 64ccddc..87dbf17 100644 --- a/microview/__init__.py +++ b/microview/__init__.py @@ -1,4 +1,4 @@ name = "microview" __author__ = """João Vitor F. Cavalcante""" __email__ = "jvfe@ufrn.edu.br" -__version__ = "0.9.5" +__version__ = "0.9.6" diff --git a/microview/file_finder.py b/microview/file_finder.py index 83f67a7..5edd42f 100644 --- a/microview/file_finder.py +++ b/microview/file_finder.py @@ -120,7 +120,6 @@ def detect_report_type(report_paths: List[Path], console) -> List[Sample]: console.print("\n Could not find any valid reports", style="red") raise Exception("Could not find any valid files.") else: - kraken_not_in_kaiju = list( filter(lambda report: report not in kaiju_reports, kraken_reports) ) diff --git a/microview/parse_taxonomy.py b/microview/parse_taxonomy.py index 5f7b928..2fd3725 100644 --- a/microview/parse_taxonomy.py +++ b/microview/parse_taxonomy.py @@ -46,7 +46,6 @@ def parse_kaiju2table(sample_name: str, df, parsed_stats: Dict) -> None: Parses kaiju report """ for row in df.itertuples(): - row_dict = {"n_reads": row.reads, "percent": row.percent} if row.taxon_name == "unclassified": parsed_stats[sample_name].update({"unclassified": row_dict}) diff --git a/microview/plotting.py b/microview/plotting.py index ddfde11..1d221cb 100644 --- a/microview/plotting.py +++ b/microview/plotting.py @@ -1,3 +1,4 @@ +from pathlib import Path from typing import Dict, Optional from plotly import io @@ -52,7 +53,6 @@ def plot_common_taxas(common_taxas_df, **kwargs): "index": "Sample name", "value": "% of reads", "variable": "Taxon name", - "group": "Group", }, template="plotly_white", color_discrete_sequence=colors.qualitative.Alphabet, @@ -70,7 +70,7 @@ def plot_abund_div(abund_div_df, **kwargs): y="Shannon Diversity", size="N Taxas", hover_data=["index"], - labels={"group": "Group", "N Taxas": "# taxas"}, + labels={"N Taxas": "# taxas"}, template="plotly_white", color_discrete_sequence=colors.qualitative.Safe[3:], **kwargs, @@ -86,7 +86,7 @@ def plot_beta_pcoa(beta_pcoa, **kwargs): x="PC1", y="PC2", hover_data=["sample"], - labels={"sample": "Sample name", "group": "Group"}, + labels={"sample": "Sample name"}, template="plotly_white", **kwargs, ) @@ -157,6 +157,9 @@ def generate_taxo_plots(tax_data: Dict, contrast_df=None) -> Dict: # TODO: Improve this check if contrast_df is not None and "group" in contrast_df.columns: + contrast_df["sample"] = [ + str(Path(s).name) for s in contrast_df["sample"].to_list() + ] merged_taxas_df = merge_with_contrasts(tax_data["common taxas"], contrast_df) common_taxas = plot_common_taxas(merged_taxas_df, facet_col="group") diff --git a/setup.cfg b/setup.cfg index c02a82a..be404ae 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.9.5 +current_version = 0.9.6 commit = True tag = True diff --git a/setup.py b/setup.py index fcc3709..fd651ba 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ readme = readme_file.read() install_requirements = [ - "scipy<=1.8", + "scipy", "scikit-bio", "pandas", "numpy", @@ -15,7 +15,7 @@ "rich", "rich-click", "click-option-group", - "frictionless", + "frictionless==4.32.0", ] test_requirements = [ @@ -36,13 +36,13 @@ setup( author="João Vitor F. Cavalcante", author_email="jvfe@ufrn.edu.br", - python_requires=">=3.7", + python_requires=">=3.8", classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Science/Research", "Topic :: Scientific/Engineering :: Bio-Informatics", "License :: OSI Approved :: BSD License", - "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", "Natural Language :: English", ], description="Generate reports from metagenomics data", @@ -64,6 +64,6 @@ "Documentation": "https://jvfe.github.io/microview/", "Source Code": "https://github.com/jvfe/microview", }, - version="0.9.5", + version="0.9.6", zip_safe=False, )