Skip to content

Commit

Permalink
fix: Change version and get contrast filename (#1)
Browse files Browse the repository at this point in the history
* fix: Make frictionless == 4

* refactor: Get filename before contrast_df merge

* style: Run black and isort

* ci: Remove py37

* refactor: Increase min version to 3.8

* Bump version: 0.9.5 → 0.9.6
  • Loading branch information
jvfe authored Oct 19, 2023
1 parent 7bfd81c commit 6d2947f
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 28 deletions.
29 changes: 14 additions & 15 deletions .github/workflows/test_and_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion microview/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name = "microview"
__author__ = """João Vitor F. Cavalcante"""
__email__ = "[email protected]"
__version__ = "0.9.5"
__version__ = "0.9.6"
1 change: 0 additions & 1 deletion microview/file_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Expand Down
1 change: 0 additions & 1 deletion microview/parse_taxonomy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
9 changes: 6 additions & 3 deletions microview/plotting.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from pathlib import Path
from typing import Dict, Optional

from plotly import io
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
)
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.9.5
current_version = 0.9.6
commit = True
tag = True

Expand Down
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
readme = readme_file.read()

install_requirements = [
"scipy<=1.8",
"scipy",
"scikit-bio",
"pandas",
"numpy",
Expand All @@ -15,7 +15,7 @@
"rich",
"rich-click",
"click-option-group",
"frictionless",
"frictionless==4.32.0",
]

test_requirements = [
Expand All @@ -36,13 +36,13 @@
setup(
author="João Vitor F. Cavalcante",
author_email="[email protected]",
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",
Expand All @@ -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,
)

0 comments on commit 6d2947f

Please sign in to comment.