Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes v. 0.0.10 bugs #91

Merged
merged 12 commits into from
Jun 13, 2024
10 changes: 7 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,25 @@ jobs:
fetch-depth: 0

- name: Download Q2 file
run: wget -q https://raw.githubusercontent.com/qiime2/environment-files/master/latest/staging/qiime2-latest-py36-linux-conda.yml
run: wget -q https://raw.githubusercontent.com/qiime2/environment-files/master/latest/staging/qiime2-latest-py38-linux-conda.yml

- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: q2
environment-file: qiime2-latest-py36-linux-conda.yml
environment-file: qiime2-latest-py38-linux-conda.yml

- name: Install conda reqs
shell: bash -l {0}
run: conda install --file ci/conda_requirements.txt -c biocore

- name: Install auxillary CI packages
- name: Install auxillary conda CI packages
shell: bash -l {0}
run: conda install -c conda-forge coveralls flake8 nose

- name: Install auxillary pip CI packages
shell: bash -l {0}
run: pip install iow tax2tree

- name: Install gemelli
shell: bash -l {0}
run: pip install -e .
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@

v0.0.11 (2024-06-24)

### Bug fixes

* Passes non-centered tables if non-centered flag is passed.
* see issue #82
* setup.py packages html files so visualization commands works from pip install.
* see issue #83
* see issue #87
* Passes no filtering to the QIIME2/API TEMPTED command since filtering and transformation should already be done.
* see issue #90

v0.0.10 (2023-12-01)

### Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion gemelli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# The full license is in the file COPYING.txt, distributed with this software.
# ----------------------------------------------------------------------------

__version__ = "0.0.10"
__version__ = "0.0.11"
9 changes: 6 additions & 3 deletions gemelli/rpca.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,9 +579,12 @@ def frequency_filter(val, id_, md):
return (np.sum(val > 0) / n_samples) > (min_feature_frequency / 100)

# filter and import table for each filter above
table = table.filter(observation_filter, axis='observation')
table = table.filter(frequency_filter, axis='observation')
table = table.filter(sample_filter, axis='sample')
if min_feature_count is not None:
table = table.filter(observation_filter, axis='observation')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note these operations are inplace by default. If that is not expected, suggest either creating a copy prior, or passing inplace=False

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to know. I added inplace=False just for continuities sake. Thanks!

if min_feature_frequency is not None:
table = table.filter(frequency_filter, axis='observation')
if min_sample_count is not None:
table = table.filter(sample_filter, axis='sample')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest ensuring empty samples / features are removed just in case

Suggested change
table = table.filter(sample_filter, axis='sample')
table = table.filter(sample_filter, axis='sample')
table = table.remove_empty()

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added! Thanks!


# check the table after filtering
if len(table.ids()) != len(set(table.ids())):
Expand Down
32 changes: 21 additions & 11 deletions gemelli/tempted.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ def tempted_factorize(table: biom.Table,
individual_id_column,
state_column,
n_components=n_components,
min_sample_count=0,
min_feature_count=0,
min_feature_frequency=0,
min_sample_count=None,
min_feature_count=None,
min_feature_frequency=None,
transformation=lambda x: x,
pseudo_count=0,
replicate_handling=replicate_handling,
Expand Down Expand Up @@ -480,14 +480,24 @@ def tempted(table: biom.Table,
svd_centralized=svd_centralized,
n_components_centralize=n_components_centralize)
# run TEMPTED
tempted_res = tempted_helper(tensor.individual_id_tables_centralized,
tensor.individual_id_state_orders,
tensor.feature_order,
n_components=n_components,
smooth=smooth,
resolution=resolution,
maxiter=max_iterations,
epsilon=epsilon)
if svd_centralized:
tempted_res = tempted_helper(tensor.individual_id_tables_centralized,
tensor.individual_id_state_orders,
tensor.feature_order,
n_components=n_components,
smooth=smooth,
resolution=resolution,
maxiter=max_iterations,
epsilon=epsilon)
else:
tempted_res = tempted_helper(tensor.individual_id_tables,
tensor.individual_id_state_orders,
tensor.feature_order,
n_components=n_components,
smooth=smooth,
resolution=resolution,
maxiter=max_iterations,
epsilon=epsilon)
(individual_loadings,
feature_loadings,
state_loadings,
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ def run(self):
'console_scripts': standalone},
# Inclusion of citations.bib in package_data based on how this is done in
# q2-emperor's setup.py file
package_data={'gemelli': ['citations.bib']},
package_data={'gemelli': ['citations.bib',
'q2/qc_assests/*.html']},
cmdclass={'install': CustomInstallCommand,
'develop': CustomDevelopCommand,
'egg_info': CustomEggInfoCommand, },
Expand Down
Loading