Skip to content

Commit

Permalink
Merge pull request #91 from biocore/fixv10bugs
Browse files Browse the repository at this point in the history
v. 0.0.11 Fixes v. 0.0.10 bugs
  • Loading branch information
cameronmartino authored Jun 13, 2024
2 parents 190f89e + a68b5a6 commit 7209fd3
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 20 deletions.
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"
18 changes: 14 additions & 4 deletions gemelli/rpca.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,15 +579,25 @@ 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',
inplace=False)
if min_feature_frequency is not None:
table = table.filter(frequency_filter,
axis='observation',
inplace=False)
if min_sample_count is not None:
table = table.filter(sample_filter,
axis='sample',
inplace=False)
# check the table after filtering
if len(table.ids()) != len(set(table.ids())):
raise ValueError('Data-table contains duplicate sample IDs')
if len(table.ids('observation')) != len(set(table.ids('observation'))):
raise ValueError('Data-table contains duplicate feature IDs')
# ensure empty samples / features are removed
table = table.remove_empty()

return table

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

0 comments on commit 7209fd3

Please sign in to comment.