From 1607a9a3347d88c6b68419cd1bb7ea84e9287b69 Mon Sep 17 00:00:00 2001 From: Greg Caporaso Date: Fri, 9 Aug 2024 05:34:02 -0700 Subject: [PATCH 1/4] MAINT: plugin_setup.py clean-up Remove unused citations.bib file; deduplicate some help text. --- q2_boots/citations.bib | 8 -------- q2_boots/plugin_setup.py | 18 +++++++++--------- setup.py | 4 +--- 3 files changed, 10 insertions(+), 20 deletions(-) delete mode 100644 q2_boots/citations.bib diff --git a/q2_boots/citations.bib b/q2_boots/citations.bib deleted file mode 100644 index 9723281..0000000 --- a/q2_boots/citations.bib +++ /dev/null @@ -1,8 +0,0 @@ -@InProceedings{ mckinney-proc-scipy-2010, - author = { Wes McKinney }, - title = { Data Structures for Statistical Computing in Python }, - booktitle = { Proceedings of the 9th Python in Science Conference }, - pages = { 51 -- 56 }, - year = { 2010 }, - editor = { St{\'e}fan van der Walt and Jarrod Millman } -} \ No newline at end of file diff --git a/q2_boots/plugin_setup.py b/q2_boots/plugin_setup.py index 8e1d23d..6ec4197 100644 --- a/q2_boots/plugin_setup.py +++ b/q2_boots/plugin_setup.py @@ -7,7 +7,7 @@ # ---------------------------------------------------------------------------- from qiime2.plugin import (Plugin, Int, Range, Collection, - Citations, Str, Choices, Bool, Float, Threads, + Str, Choices, Bool, Float, Threads, Metadata, Visualization) from q2_types.feature_table import ( @@ -33,8 +33,6 @@ _core_metrics_rarefaction_example) -Citations = Citations.load('citations.bib', package='q2_boots') - plugin = Plugin( name='boots', version=q2_boots.__version__, @@ -48,7 +46,12 @@ ) -_feature_table_description = 'The feature table to be resampled.' +_feature_table_description = 'The input feature table.' +_phylogeny_description = ( + 'The phylogenetic tree to use in phylogenetic diversity ' + 'calculations. All feature ids in `table` must be present in ' + 'this tree, but this tree can contain feature ids that are ' + 'not present in `table`.') _sampling_depth_description = ( 'The total number of observations that each sample in `table` should be ' 'resampled to. Samples where the total number of observations in `table` ' @@ -110,11 +113,8 @@ } _diversity_input_descriptions = { - 'table': 'The feature table to use in diversity computations.', - 'phylogeny': ('The phylogenetic tree to use in phylogenetic diversity ' - 'calculations. All feature ids in `table` must be present in ' - 'this tree, but this tree can contain feature ids that are ' - 'not present in `table`.') + 'table': _feature_table_description, + 'phylogeny': _phylogeny_description } _alpha_average_parameters = { diff --git a/setup.py b/setup.py index 3e38925..6dc73ef 100644 --- a/setup.py +++ b/setup.py @@ -26,8 +26,6 @@ entry_points={ "qiime2.plugins": ["q2-boots=q2_boots.plugin_setup:plugin"] }, - package_data={ - "q2_boots": ["citations.bib"], - }, + package_data={}, zip_safe=False, ) From 8b314b0b9fcc6e50f52b49529e0f8ce16c024f96 Mon Sep 17 00:00:00 2001 From: Greg Caporaso Date: Fri, 9 Aug 2024 06:11:53 -0700 Subject: [PATCH 2/4] TST: improve durability of tests --- q2_boots/tests/test_alpha.py | 30 +++++---------- q2_boots/tests/test_beta.py | 18 ++++----- q2_boots/tests/test_core_metrics.py | 57 ++++++++++++++++------------- 3 files changed, 50 insertions(+), 55 deletions(-) diff --git a/q2_boots/tests/test_alpha.py b/q2_boots/tests/test_alpha.py index 86ae3a1..9a8eca4 100644 --- a/q2_boots/tests/test_alpha.py +++ b/q2_boots/tests/test_alpha.py @@ -78,8 +78,7 @@ def test_alpha_collection_w_replacement(self): index=['S1', 'S2'], name='observed_features') for alpha_vector in observed.values(): - observed_series = qiime2.Artifact.view(alpha_vector, - view_type=pd.Series) + observed_series = alpha_vector.view(pd.Series) pdt.assert_series_equal(observed_series, expected_series) # at a sampling depth of 2, with table1 as input and sampling with @@ -101,8 +100,7 @@ def test_alpha_collection_w_replacement(self): count_possible_series2_observed = 0 other_series_observed = False for alpha_vector in observed.values(): - observed_series = qiime2.Artifact.view(alpha_vector, - view_type=pd.Series) + observed_series = alpha_vector.view(pd.Series) if observed_series.equals(possible_series1): count_possible_series1_observed += 1 elif observed_series.equals(possible_series2): @@ -133,8 +131,7 @@ def test_alpha_collection_wo_replacement(self): index=['S1', 'S2'], name='observed_features') for alpha_vector in observed.values(): - observed_series = qiime2.Artifact.view(alpha_vector, - view_type=pd.Series) + observed_series = alpha_vector.view(pd.Series) pdt.assert_series_equal(observed_series, expected_series) def test_alpha_collection_phylogenetic(self): @@ -160,8 +157,7 @@ def test_alpha_collection_phylogenetic(self): index=['S1', 'S2'], name='faith_pd') for alpha_vector in observed.values(): - observed_series = qiime2.Artifact.view(alpha_vector, - view_type=pd.Series) + observed_series = alpha_vector.view(pd.Series) pdt.assert_series_equal(observed_series, expected_series) def test_alpha_collection_invalid_input(self): @@ -203,8 +199,7 @@ def test_alpha_w_replacement(self): observed, = self.alpha_pipeline( table=table1, sampling_depth=1, metric='observed_features', n=42, replacement=True) - observed_series = qiime2.Artifact.view(observed, - view_type=pd.Series) + observed_series = observed.view(pd.Series) expected_series = pd.Series([1., 1.], index=['S1', 'S2'], @@ -219,8 +214,7 @@ def test_alpha_w_replacement(self): observed, = self.alpha_pipeline( table=table1, sampling_depth=2, metric='observed_features', n=99, replacement=True) - observed_series = qiime2.Artifact.view(observed, - view_type=pd.Series) + observed_series = observed.view(pd.Series) # note that because n is an odd number, the median for S1 will always # be one of the actual values that were observed (as opposed to possibly # being 1.5, if n was an even number). @@ -236,8 +230,7 @@ def test_alpha_w_replacement(self): observed, = self.alpha_pipeline( table=table1, sampling_depth=2, metric='observed_features', n=100, replacement=True, average_method='mean') - observed_series = qiime2.Artifact.view(observed, - view_type=pd.Series) + observed_series = observed.view(pd.Series) # note that b/c these are <, not <=, we know that identical tables # were not always obtained from the resampling step self.assertTrue(1.0 < observed_series['S1'] < 2.0) @@ -256,8 +249,7 @@ def test_alpha_wo_replacement(self): observed, = self.alpha_pipeline( table=table1, sampling_depth=1, metric='observed_features', n=42, replacement=False) - observed_series = qiime2.Artifact.view(observed, - view_type=pd.Series) + observed_series = observed.view(pd.Series) expected_series = pd.Series([1., 1.], index=['S1', 'S2'], @@ -270,8 +262,7 @@ def test_alpha_wo_replacement(self): observed, = self.alpha_pipeline( table=table1, sampling_depth=2, metric='observed_features', n=100, replacement=False) - observed_series = qiime2.Artifact.view(observed, - view_type=pd.Series) + observed_series = observed.view(pd.Series) expected_series = pd.Series([2., 1.], index=['S1', 'S2'], @@ -284,8 +275,7 @@ def test_alpha_wo_replacement(self): observed, = self.alpha_pipeline( table=table1, sampling_depth=2, metric='observed_features', n=100, replacement=False, average_method='mean') - observed_series = qiime2.Artifact.view(observed, - view_type=pd.Series) + observed_series = observed.view(pd.Series) expected_series = pd.Series([2., 1.], index=['S1', 'S2'], diff --git a/q2_boots/tests/test_beta.py b/q2_boots/tests/test_beta.py index 36aa62d..7005a2e 100644 --- a/q2_boots/tests/test_beta.py +++ b/q2_boots/tests/test_beta.py @@ -165,7 +165,7 @@ def test_beta_collection_w_replacement(self): count_other_dm_observed = 0 for o in observed.values(): - o = qiime2.Artifact.view(o, skbio.DistanceMatrix) + o = o.view(skbio.DistanceMatrix) if o == possible_dm1: count_possible_dm1_observed += 1 elif o == possible_dm2: @@ -190,7 +190,7 @@ def test_beta_collection_wo_replacement(self): replacement=False) self.assertEqual(len(observed), 10) for o in observed.values(): - o = qiime2.Artifact.view(o, skbio.DistanceMatrix) + o = o.view(skbio.DistanceMatrix) self.assertEqual(o, expected) def test_beta_collection_phylogenetic(self): @@ -208,7 +208,7 @@ def test_beta_collection_phylogenetic(self): sampling_depth=2, n=10, replacement=False) self.assertEqual(len(observed), 10) for o in observed.values(): - o = qiime2.Artifact.view(o, skbio.DistanceMatrix) + o = o.view(skbio.DistanceMatrix) self.assertEqual(o, expected) @@ -236,7 +236,7 @@ def test_beta_w_replacement(self): n=10, average_method='medoid', replacement=True) - observed = qiime2.Artifact.view(observed, skbio.DistanceMatrix) + observed = observed.view(skbio.DistanceMatrix) self.assertTrue(observed[('S1', 'S2')] in [0.0, 0.5, 1.0], msg=(f"Medoid value ({observed[('S1', 'S2')]}) is " "not equal to 0.0, 0.5, 1.0.")) @@ -247,7 +247,7 @@ def test_beta_w_replacement(self): n=9, average_method='non-metric-median', replacement=True) - observed = qiime2.Artifact.view(observed, skbio.DistanceMatrix) + observed = observed.view(skbio.DistanceMatrix) # because n is odd, we should always observe an actual distance # between S1 and S2 as the median (as opposed to the mean of two # actual values) @@ -261,7 +261,7 @@ def test_beta_w_replacement(self): n=20, average_method='non-metric-mean', replacement=True) - observed = qiime2.Artifact.view(observed, skbio.DistanceMatrix) + observed = observed.view(skbio.DistanceMatrix) # This can occasionally fail, but it should be very infrequent # (e.g., if all 0.0s or 1.0s were observed as the distances) self.assertTrue(0.0 < observed[('S1', 'S2')] < 1.0, @@ -280,7 +280,7 @@ def test_beta_wo_replacement(self): n=10, average_method='medoid', replacement=False) - observed = qiime2.Artifact.view(observed, skbio.DistanceMatrix) + observed = observed.view(skbio.DistanceMatrix) self.assertEqual(observed, expected) observed, = self.beta_pipeline(table=self.table1, @@ -289,7 +289,7 @@ def test_beta_wo_replacement(self): n=10, average_method='non-metric-median', replacement=False) - observed = qiime2.Artifact.view(observed, skbio.DistanceMatrix) + observed = observed.view(skbio.DistanceMatrix) self.assertEqual(observed, expected) observed, = self.beta_pipeline(table=self.table1, @@ -298,7 +298,7 @@ def test_beta_wo_replacement(self): n=10, average_method='non-metric-mean', replacement=False) - observed = qiime2.Artifact.view(observed, skbio.DistanceMatrix) + observed = observed.view(skbio.DistanceMatrix) self.assertEqual(observed, expected) def test_invalid(self): diff --git a/q2_boots/tests/test_core_metrics.py b/q2_boots/tests/test_core_metrics.py index c8def8a..0779612 100644 --- a/q2_boots/tests/test_core_metrics.py +++ b/q2_boots/tests/test_core_metrics.py @@ -49,17 +49,20 @@ def test_core_metrics_wo_replacement(self): columns=['F1', 'F2'], index=['S1', 'S2']) for e in output[0].values(): - observed_table = qiime2.Artifact.view(e, view_type=pd.DataFrame) + observed_table = e.view(pd.DataFrame) pdt.assert_frame_equal(observed_table, expected_table) # expected alpha vectors returned - self.assertEqual(set(output[1].keys()), - set(['observed_features', 'pielou_e', 'shannon'])) + skbio_lt_060_alpha_keys = set( + ['observed_features', 'pielou_evenness', 'shannon_entropy']) + skbio_gte_060_alpha_keys = set( + ['observed_features', 'pielou_e', 'shannon']) + self.assertTrue(set(output[1].keys()) == skbio_lt_060_alpha_keys or + set(output[1].keys()) == skbio_gte_060_alpha_keys) expected_obs_features = pd.Series([2.0, 1.0], index=['S1', 'S2'], name='observed_features') - observed_obs_features = qiime2.Artifact.view( - output[1]['observed_features'], view_type=pd.Series) + observed_obs_features = output[1]['observed_features'].view(pd.Series) pdt.assert_series_equal(observed_obs_features, expected_obs_features) # expected dms, pcoas, and plots returned @@ -68,8 +71,7 @@ def test_core_metrics_wo_replacement(self): self.assertEqual(set(output[4].keys()), set(['jaccard', 'braycurtis'])) expected_jaccard = skbio.DistanceMatrix([[0, 0.5], [0.5, 0]], ids=['S1', 'S2']) - observed_jaccard = qiime2.Artifact.view(output[2]['jaccard'], - view_type=skbio.DistanceMatrix) + observed_jaccard = output[2]['jaccard'].view(skbio.DistanceMatrix) self.assertEqual(observed_jaccard, expected_jaccard) def test_core_metrics_w_replacement(self): @@ -95,7 +97,7 @@ def test_core_metrics_w_replacement(self): count_possible_table3_observed = 0 count_other_table_observed = 0 for e in output[0].values(): - observed_table = qiime2.Artifact.view(e, view_type=pd.DataFrame) + observed_table = e.view(pd.DataFrame) if observed_table.equals(possible_table1): count_possible_table1_observed += 1 elif observed_table.equals(possible_table2): @@ -111,10 +113,13 @@ def test_core_metrics_w_replacement(self): self.assertEqual(count_other_table_observed, 0) # expected alpha vectors returned - self.assertEqual(set(output[1].keys()), - set(['observed_features', 'pielou_e', 'shannon'])) - observed_obs_features = qiime2.Artifact.view( - output[1]['observed_features'], view_type=pd.Series) + skbio_lt_060_alpha_keys = set( + ['observed_features', 'pielou_evenness', 'shannon_entropy']) + skbio_gte_060_alpha_keys = set( + ['observed_features', 'pielou_e', 'shannon']) + self.assertTrue(set(output[1].keys()) == skbio_lt_060_alpha_keys or + set(output[1].keys()) == skbio_gte_060_alpha_keys) + observed_obs_features = output[1]['observed_features'].view(pd.Series) # note that because n is an odd number, the median for S1 will always # be one of the actual values that were observed (as opposed to possibly # being 1.5, if n was an even number). @@ -128,8 +133,7 @@ def test_core_metrics_w_replacement(self): self.assertEqual(set(output[2].keys()), set(['jaccard', 'braycurtis'])) self.assertEqual(set(output[3].keys()), set(['jaccard', 'braycurtis'])) self.assertEqual(set(output[4].keys()), set(['jaccard', 'braycurtis'])) - observed_jaccard = qiime2.Artifact.view(output[2]['jaccard'], - view_type=skbio.DistanceMatrix) + observed_jaccard = output[2]['jaccard'].view(skbio.DistanceMatrix) # because n is odd, we should always observe an actual distance # between S1 and S2 as the median (as opposed to the mean of two # actual values) @@ -151,25 +155,27 @@ def test_core_metrics_phylogenetic(self): columns=['F1', 'F2'], index=['S1', 'S2']) for e in output[0].values(): - observed_table = qiime2.Artifact.view(e, view_type=pd.DataFrame) + observed_table = e.view(pd.DataFrame) pdt.assert_frame_equal(observed_table, expected_table) # expected alpha vectors returned - self.assertEqual(set(output[1].keys()), - set(['observed_features', 'pielou_e', 'shannon', - 'faith_pd'])) + skbio_lt_060_alpha_keys = set( + ['observed_features', 'pielou_evenness', 'shannon_entropy', + 'faith_pd']) + skbio_gte_060_alpha_keys = set( + ['observed_features', 'pielou_e', 'shannon', 'faith_pd']) + self.assertTrue(set(output[1].keys()) == skbio_lt_060_alpha_keys or + set(output[1].keys()) == skbio_gte_060_alpha_keys) expected_obs_features = pd.Series([2.0, 1.0], index=['S1', 'S2'], name='observed_features') - observed_obs_features = qiime2.Artifact.view( - output[1]['observed_features'], view_type=pd.Series) + observed_obs_features = output[1]['observed_features'].view(pd.Series) pdt.assert_series_equal(observed_obs_features, expected_obs_features) expected_faith_pd = pd.Series([4.0, 3.0], index=['S1', 'S2'], name='faith_pd') - observed_faith_pd = qiime2.Artifact.view( - output[1]['faith_pd'], view_type=pd.Series) + observed_faith_pd = output[1]['faith_pd'].view(pd.Series) pdt.assert_series_equal(observed_faith_pd, expected_faith_pd) # expected dms, pcoas, and plots returned @@ -180,13 +186,12 @@ def test_core_metrics_phylogenetic(self): self.assertEqual(set(output[4].keys()), expected_bdiv_keys) expected_jaccard = skbio.DistanceMatrix([[0, 0.5], [0.5, 0]], ids=['S1', 'S2']) - observed_jaccard = qiime2.Artifact.view(output[2]['jaccard'], - view_type=skbio.DistanceMatrix) + observed_jaccard = output[2]['jaccard'].view(skbio.DistanceMatrix) self.assertEqual(observed_jaccard, expected_jaccard) expected_unweighted_unifrac = skbio.DistanceMatrix( [[0, 0.25], [0.25, 0]], ids=['S1', 'S2']) - observed_unweighted_unifrac = qiime2.Artifact.view( - output[2]['unweighted_unifrac'], view_type=skbio.DistanceMatrix) + observed_unweighted_unifrac = \ + output[2]['unweighted_unifrac'].view(skbio.DistanceMatrix) self.assertEqual(observed_unweighted_unifrac, expected_unweighted_unifrac) From 653c2e1dd1e343898b933d24bc66654e6e4530d0 Mon Sep 17 00:00:00 2001 From: Greg Caporaso Date: Fri, 9 Aug 2024 06:39:53 -0700 Subject: [PATCH 3/4] MAINT: beta parameter fixes - remove `-n-jobs` in favor of `--parallel` - fix pass-through of beta metric modifier parameters fixes #23 --- q2_boots/_beta.py | 50 ++++++++++++++++++++--------- q2_boots/_core_metrics.py | 2 +- q2_boots/plugin_setup.py | 16 ++------- q2_boots/tests/test_core_metrics.py | 3 -- 4 files changed, 38 insertions(+), 33 deletions(-) diff --git a/q2_boots/_beta.py b/q2_boots/_beta.py index 1410d0e..6cedf57 100644 --- a/q2_boots/_beta.py +++ b/q2_boots/_beta.py @@ -19,6 +19,13 @@ from q2_boots._resample import resample +_METRIC_MOD_DEFAULTS = { + 'bypass_tips': False, + 'pseudocount': 1, + 'alpha': None, + 'variance_adjusted': False +} + def beta_average(data: skbio.DistanceMatrix, average_method: str) -> skbio.DistanceMatrix: @@ -42,13 +49,19 @@ def beta_average(data: skbio.DistanceMatrix, "mean, and medoid.") -def beta_collection(ctx, table, metric, sampling_depth, n, replacement, - phylogeny=None, bypass_tips=False, n_jobs=1, - pseudocount=1, alpha=None, variance_adjusted=False): +def beta_collection( + ctx, table, metric, sampling_depth, n, replacement, + phylogeny=None, + bypass_tips=_METRIC_MOD_DEFAULTS['bypass_tips'], + pseudocount=_METRIC_MOD_DEFAULTS['pseudocount'], + alpha=_METRIC_MOD_DEFAULTS['alpha'], + variance_adjusted=_METRIC_MOD_DEFAULTS['variance_adjusted']): _validate_beta_metric(metric, phylogeny) resample_function = resample - beta_metric_function = _get_beta_metric_function(ctx, metric, phylogeny) + beta_metric_function = _get_beta_metric_function( + ctx, metric, phylogeny, bypass_tips, pseudocount, alpha, + variance_adjusted) tables = resample_function(ctx=ctx, table=table, @@ -61,8 +74,11 @@ def beta_collection(ctx, table, metric, sampling_depth, n, replacement, def beta(ctx, table, metric, sampling_depth, n, replacement, - average_method='non-metric-median', phylogeny=None, bypass_tips=False, - n_jobs=1, pseudocount=1, alpha=None, variance_adjusted=False): + average_method='non-metric-median', phylogeny=None, + bypass_tips=_METRIC_MOD_DEFAULTS['bypass_tips'], + pseudocount=_METRIC_MOD_DEFAULTS['pseudocount'], + alpha=_METRIC_MOD_DEFAULTS['alpha'], + variance_adjusted=_METRIC_MOD_DEFAULTS['variance_adjusted']): beta_collection_function = beta_collection beta_average_action = ctx.get_action('boots', 'beta_average') dms = beta_collection_function(ctx=ctx, @@ -73,7 +89,6 @@ def beta(ctx, table, metric, sampling_depth, n, replacement, n=n, pseudocount=pseudocount, replacement=replacement, - n_jobs=n_jobs, variance_adjusted=variance_adjusted, alpha=alpha, bypass_tips=bypass_tips) @@ -114,18 +129,23 @@ def _validate_beta_metric(metric, phylogeny): raise ValueError(f'Metric {metric} requires a phylogenetic tree.') -def _get_beta_metric_function(ctx, metric, phylogeny): +def _get_beta_metric_function( + ctx, metric, phylogeny, + bypass_tips=_METRIC_MOD_DEFAULTS['bypass_tips'], + pseudocount=_METRIC_MOD_DEFAULTS['pseudocount'], + alpha=_METRIC_MOD_DEFAULTS['alpha'], + variance_adjusted=_METRIC_MOD_DEFAULTS['variance_adjusted']): if _is_phylogenetic_beta_metric(metric): beta_metric_function = q2div_beta_phylogenetic - beta_metric_function = functools.partial(beta_metric_function, - ctx=ctx, - phylogeny=phylogeny, - metric=metric) + beta_metric_function = functools.partial( + beta_metric_function, ctx=ctx, phylogeny=phylogeny, metric=metric, + bypass_tips=bypass_tips, alpha=alpha, + variance_adjusted=variance_adjusted) else: beta_metric_function = q2div_beta - beta_metric_function = functools.partial(beta_metric_function, - ctx=ctx, - metric=metric) + beta_metric_function = functools.partial( + beta_metric_function, ctx=ctx, metric=metric, + pseudocount=pseudocount) return beta_metric_function diff --git a/q2_boots/_core_metrics.py b/q2_boots/_core_metrics.py index 0ba8678..db7c6eb 100644 --- a/q2_boots/_core_metrics.py +++ b/q2_boots/_core_metrics.py @@ -16,7 +16,7 @@ def core_metrics(ctx, table, sampling_depth, metadata, n, replacement, - n_jobs=1, phylogeny=None, alpha_average_method='median', + phylogeny=None, alpha_average_method='median', beta_average_method='non-metric-median'): resample_function = resample diff --git a/q2_boots/plugin_setup.py b/q2_boots/plugin_setup.py index 6ec4197..b1cecab 100644 --- a/q2_boots/plugin_setup.py +++ b/q2_boots/plugin_setup.py @@ -6,9 +6,8 @@ # The full license is in the file LICENSE, distributed with this software. # ---------------------------------------------------------------------------- -from qiime2.plugin import (Plugin, Int, Range, Collection, - Str, Choices, Bool, Float, Threads, - Metadata, Visualization) +from qiime2.plugin import (Plugin, Int, Range, Collection, Str, Choices, Bool, + Float, Metadata, Visualization) from q2_types.feature_table import ( FeatureTable, Frequency, RelativeFrequency, PresenceAbsence @@ -252,7 +251,6 @@ beta_metrics['PHYLO']['UNIMPL']), 'pseudocount': Int % Range(1, None), 'replacement': Bool, - 'n_jobs': Threads, 'n': Int % Range(1, None), 'sampling_depth': Int % Range(1, None), 'bypass_tips': Bool, @@ -260,19 +258,11 @@ 'alpha': Float % Range(0, 1, inclusive_end=True) } -_n_jobs_description = ( - 'The number of CPU threads to use in performing this calculation. ' - 'May not exceed the number of available physical cores. If threads = ' - '\'auto\', one thread will be created for each identified CPU core on the ' - 'host.' -) - _beta_collection_parameter_descriptions = { 'metric': 'The beta diversity metric to be computed.', 'pseudocount': ('A pseudocount to handle zeros for compositional ' 'metrics. This is ignored for other metrics.'), 'replacement': _replacement_description, - 'n_jobs': _n_jobs_description, 'n': _n_description, 'sampling_depth': _sampling_depth_description, 'bypass_tips': ('Ignore tips of tree in phylogenetic diversity ' @@ -341,7 +331,6 @@ inputs=_diversity_inputs, parameters={ 'metadata': Metadata, - 'n_jobs': Threads, 'n': Int % Range(1, None), 'sampling_depth': Int % Range(1, None), 'alpha_average_method': Str % Choices('mean', 'median'), @@ -360,7 +349,6 @@ input_descriptions=_diversity_input_descriptions, parameter_descriptions={ 'metadata': 'The sample metadata used in generating Emperor plots.', - 'n_jobs': _n_jobs_description, 'n': _n_description, 'sampling_depth': _sampling_depth_description, 'alpha_average_method': 'Method to use for averaging alpha diversity.', diff --git a/q2_boots/tests/test_core_metrics.py b/q2_boots/tests/test_core_metrics.py index 0779612..f35180c 100644 --- a/q2_boots/tests/test_core_metrics.py +++ b/q2_boots/tests/test_core_metrics.py @@ -40,7 +40,6 @@ def test_core_metrics_wo_replacement(self): output = self.core_metrics(table=self.table1, sampling_depth=2, metadata=self.metadata, - n_jobs=1, replacement=False, n=10) # n tables returned @@ -78,7 +77,6 @@ def test_core_metrics_w_replacement(self): output = self.core_metrics(table=self.table1, sampling_depth=2, metadata=self.metadata, - n_jobs=1, replacement=True, n=99) # n tables returned @@ -146,7 +144,6 @@ def test_core_metrics_phylogenetic(self): phylogeny=self.phylogeny, sampling_depth=2, metadata=self.metadata, - n_jobs=1, replacement=False, n=10) # n tables returned From 91ff38afe74b08b599182368061315cac055b0b1 Mon Sep 17 00:00:00 2001 From: Greg Caporaso Date: Fri, 9 Aug 2024 06:45:39 -0700 Subject: [PATCH 4/4] MAINT: remove pipeline diagrams this are being moved to caporaso-lab/q2-boots-book (i.e., the docs) --- images/pipeline-chart.md | 55 ---------------------------------------- images/pipeline-key.md | 19 -------------- 2 files changed, 74 deletions(-) delete mode 100644 images/pipeline-chart.md delete mode 100644 images/pipeline-key.md diff --git a/images/pipeline-chart.md b/images/pipeline-chart.md deleted file mode 100644 index 72d390b..0000000 --- a/images/pipeline-chart.md +++ /dev/null @@ -1,55 +0,0 @@ -```mermaid -flowchart TD - - feature-table["FeatureTable"] --> resample - n(["n (Int)"]) --> resample - sampling-depth(["sampling-depth (Int)"]) --> resample - phylogeny-alpha[phylogeny] -- optional --> div-alpha - alpha-metric(["metric (alpha, String)"]) --> div-alpha - resample{qiime feature-table resample} --> - feature-collection[[FeatureTable]] -- looped call --> div-alpha - feature-collection -- looped call --> beta-diversity - div-alpha{qiime diversity alpha} --> sd-collection - alpha-rep(["representative (alpha, String)"]) --> alpha-avg - sd-collection[["SampleData[AlphaDiversity]"]] --> - alpha-avg{qiime boots alpha-average} --> - sample-data["SampleData[AlphaDiversity]"] - - style feature-table fill:#DDCC77 - style n fill:#DDCC77 - style sampling-depth fill:#DDCC77 - style resample fill:#DDCC77 - style feature-collection fill:#DDCC77 - - style phylogeny-alpha fill:#88CCEE - style alpha-metric fill:#88CCEE - style div-alpha fill:#88CCEE - style sd-collection fill:#88CCEE - style alpha-rep fill:#88CCEE - style alpha-avg fill:#88CCEE - style sample-data fill:#88CCEE - - beta-diversity{qiime diversity beta} --> dms - beta-metric(["metric (beta, String)"]) --> beta-diversity - phylogeny-beta[phylogeny] -- optional --> beta-diversity - - dms[[DistanceMatrix]] --> beta-average - beta-rep(["representative (beta, String)"]) --> - beta-average{qiime boots beta-average} --> - dm[DistanceMatrix] - - style beta-diversity fill:#CC6677 - style beta-metric fill:#CC6677 - style phylogeny-beta fill:#CC6677 - style dms fill:#CC6677 - style beta-rep fill:#CC6677 - style beta-average fill:#CC6677 - style dm fill:#CC6677 - - dm --> pcoa[PCoA] --> emperor-plot - style pcoa fill:white - style emperor-plot fill:white - emperor-plot["Emperor Plot (Visualization)"] - -``` - \ No newline at end of file diff --git a/images/pipeline-key.md b/images/pipeline-key.md deleted file mode 100644 index 410a4ee..0000000 --- a/images/pipeline-key.md +++ /dev/null @@ -1,19 +0,0 @@ -```mermaid -flowchart LR - function-call{qiime function call} - input - parameter([parameter]) - collection[[collection]] - - style function-call fill:white - style input fill:white - style parameter fill:white - style collection fill:white - - style Beta fill:#CC6677 - style Alpha fill:#88CCEE - AB[Alpha and Beta] - style AB fill:#DDCC77 - core-metrics[Core Metrics] - style core-metrics fill:white -```