|
8 | 8 |
|
9 | 9 | import importlib
|
10 | 10 |
|
11 |
| -from qiime2.plugin import Citations, Int, List, Metadata, Plugin, Str |
| 11 | +from qiime2.plugin import Citations, Float, Int, List, Metadata, Plugin, Str |
12 | 12 | from q2_types.feature_table import FeatureTable, Frequency
|
13 | 13 |
|
14 | 14 | from q2_qsip2 import __version__
|
15 | 15 | from q2_qsip2.types import QSIP2Data, Unfiltered, Filtered, EAF
|
16 | 16 | from q2_qsip2.workflow import (
|
17 |
| - standard_workflow, create_qsip_data, subset_and_filter |
| 17 | + standard_workflow, create_qsip_data, subset_and_filter, |
| 18 | + resample_and_calculate_EAF |
18 | 19 | )
|
19 | 20 | from q2_qsip2.visualizers._visualizers import (
|
20 | 21 | plot_weighted_average_densities, plot_sample_curves, plot_density_outliers,
|
21 |
| - show_comparison_groups, plot_filtered_features |
| 22 | + show_comparison_groups, plot_filtered_features, plot_excess_atom_fractions |
22 | 23 | )
|
23 | 24 |
|
24 | 25 |
|
|
34 | 35 | "data."
|
35 | 36 | ),
|
36 | 37 | short_description="Analyze qSIP data.",
|
37 |
| - # TODO |
38 | 38 | citations=[citations['Caporaso-Bolyen-2024']]
|
39 | 39 | )
|
40 | 40 |
|
41 |
| -plugin.methods.register_function( |
42 |
| - function=standard_workflow, |
43 |
| - inputs={ |
44 |
| - 'table': FeatureTable[Frequency], |
45 |
| - 'qsip_metadata': QSIP2Data[Unfiltered], |
46 |
| - }, |
47 |
| - parameters={}, |
48 |
| - outputs=[ |
49 |
| - ('output_table', FeatureTable[Frequency]) |
50 |
| - ], |
51 |
| - input_descriptions={ |
52 |
| - 'table': 'The feature table.', |
53 |
| - 'qsip_metadata': 'The qSIP metadata.', |
54 |
| - }, |
55 |
| - parameter_descriptions={}, |
56 |
| - output_descriptions={ |
57 |
| - 'output_table': 'Placeholder.' |
58 |
| - }, |
59 |
| - name='Run the standard qSIP2 workflow.', |
60 |
| - description=( |
61 |
| - 'Placeholder.' |
62 |
| - ) |
63 |
| -) |
64 |
| - |
65 | 41 | plugin.methods.register_function(
|
66 | 42 | function=create_qsip_data,
|
67 | 43 | inputs={
|
|
99 | 75 | name='Bundle your qSIP metadata and feature table.',
|
100 | 76 | description=(
|
101 | 77 | 'Placeholder.'
|
102 |
| - ) |
| 78 | + ), |
| 79 | + citations=[] |
103 | 80 | )
|
104 | 81 |
|
105 | 82 | plugin.methods.register_function(
|
|
147 | 124 | name='Subset sources and filter features to prepare for comparison.',
|
148 | 125 | description=(
|
149 | 126 | 'Placeholder.'
|
150 |
| - ) |
| 127 | + ), |
| 128 | + citations=[] |
| 129 | +) |
| 130 | + |
| 131 | +plugin.methods.register_function( |
| 132 | + function=resample_and_calculate_EAF, |
| 133 | + inputs={ |
| 134 | + 'filtered_qsip_data': QSIP2Data[Filtered] |
| 135 | + }, |
| 136 | + parameters={ |
| 137 | + 'resamples': Int, |
| 138 | + 'random_seed': Int, |
| 139 | + }, |
| 140 | + outputs=[ |
| 141 | + ('eaf_qsip_data', QSIP2Data[EAF]) |
| 142 | + ], |
| 143 | + input_descriptions={ |
| 144 | + 'filtered_qsip_data': 'Your filtered qSIP2 data.' |
| 145 | + }, |
| 146 | + parameter_descriptions={ |
| 147 | + 'resamples': 'The number of bootstrap resamplings to perform.', |
| 148 | + 'random_seed': 'The random seed to use during resampling.', |
| 149 | + }, |
| 150 | + output_descriptions={ |
| 151 | + 'eaf_qsip_data': ( |
| 152 | + 'Your qSIP2 data with excess atom fraction (EAF) values ' |
| 153 | + 'calculated on a per-taxon basis.' |
| 154 | + ) |
| 155 | + }, |
| 156 | + name='Calculate excess atom fraction (EAF).', |
| 157 | + description=( |
| 158 | + 'Placeholder.' |
| 159 | + ), |
| 160 | + citations=[] |
151 | 161 | )
|
152 | 162 |
|
153 | 163 | plugin.visualizers.register_function(
|
|
249 | 259 | citations=[],
|
250 | 260 | )
|
251 | 261 |
|
| 262 | +plugin.visualizers.register_function( |
| 263 | + function=plot_excess_atom_fractions, |
| 264 | + inputs={ |
| 265 | + 'eaf_qsip_data': QSIP2Data[EAF], |
| 266 | + }, |
| 267 | + parameters={ |
| 268 | + 'num_top': Int, |
| 269 | + 'confidence_interval': Float |
| 270 | + }, |
| 271 | + input_descriptions={ |
| 272 | + 'eaf_qsip_data': 'Your EAF-calculated qSIP2 data.', |
| 273 | + }, |
| 274 | + parameter_descriptions={ |
| 275 | + 'num_top': ( |
| 276 | + 'The number of taxa displayed, selected in order of decreasing ' |
| 277 | + 'excess atom fraction.' |
| 278 | + ), |
| 279 | + 'confidence_interval': ( |
| 280 | + 'The confidence interval to display from the bootstrapped excess ' |
| 281 | + 'atom fractions.' |
| 282 | + ) |
| 283 | + }, |
| 284 | + name='Visualize per-taxon excess atom fractions.', |
| 285 | + description=( |
| 286 | + 'Plots per-taxon excess atom fractions with bootstrapped confidence ' |
| 287 | + 'intervals.' |
| 288 | + ), |
| 289 | + citations=[] |
| 290 | +) |
| 291 | + |
252 | 292 | importlib.import_module('q2_qsip2.types._deferred_setup')
|
0 commit comments