Skip to content

Instantly share code, notes, and snippets.

@gregcaporaso
Last active November 19, 2025 22:13
Show Gist options
  • Select an option

  • Save gregcaporaso/4be64940f80256316e3308d2ae2ec0da to your computer and use it in GitHub Desktop.

Select an option

Save gregcaporaso/4be64940f80256316e3308d2ae2ec0da to your computer and use it in GitHub Desktop.
Generate a list of the names of all metadata parameters in a rachis deployment.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"id": "1368c246",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/opt/homebrew/Caskroom/miniforge/base/envs/q2dev-amplicon-2025-11-17/lib/python3.10/site-packages/unifrac/__init__.py:9: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.\n",
" import pkg_resources\n"
]
}
],
"source": [
"import qiime2.sdk\n",
"from qiime2.plugin import Metadata\n",
"pm = qiime2.sdk.PluginManager()"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "17981030",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"boots core_metrics: metadata\n",
"boots kmer_diversity: metadata\n",
"emperor plot: metadata\n",
"emperor procrustes_plot: metadata\n",
"**: emperor biplot: sample_metadata\n",
"**: emperor biplot: feature_metadata\n",
"vizard heatmap: metadata\n",
"vizard scatterplot_2d: metadata\n",
"vizard lineplot: metadata\n",
"vizard boxplot: metadata\n",
"**: rescript get_ncbi_data: accession_ids\n",
"**: rescript get_ncbi_data_protein: accession_ids\n",
"**: rescript filter_taxa: ids_to_keep\n",
"kmerizer core_metrics: metadata\n",
"phylogeny filter_tree: metadata\n",
"feature-table filter_samples: metadata\n",
"feature-table filter_features: metadata\n",
"feature-table filter_seqs: metadata\n",
"**: feature-table summarize: sample_metadata\n",
"feature-table tabulate_seqs: metadata\n",
"feature-table summarize_plus: metadata\n",
"sample-classifier metatable: metadata\n",
"diversity filter_distance_matrix: metadata\n",
"diversity filter_alpha_diversity: metadata\n",
"diversity alpha_group_significance: metadata\n",
"diversity bioenv: metadata\n",
"diversity alpha_correlation: metadata\n",
"diversity alpha_rarefaction: metadata\n",
"diversity beta_rarefaction: metadata\n",
"diversity adonis: metadata\n",
"diversity core_metrics_phylogenetic: metadata\n",
"diversity core_metrics: metadata\n",
"quality-control decontam_identify: metadata\n",
"quality-control decontam_identify_batches: metadata\n",
"longitudinal nmit: metadata\n",
"longitudinal first_differences: metadata\n",
"longitudinal first_distances: metadata\n",
"longitudinal pairwise_differences: metadata\n",
"longitudinal pairwise_distances: metadata\n",
"longitudinal linear_mixed_effects: metadata\n",
"longitudinal anova: metadata\n",
"longitudinal volatility: metadata\n",
"longitudinal plot_feature_volatility: metadata\n",
"longitudinal feature_volatility: metadata\n",
"longitudinal maturity_index: metadata\n",
"demux filter_samples: metadata\n",
"**: metadata merge: metadata1\n",
"**: metadata merge: metadata2\n",
"**: metadata tabulate: input\n",
"taxa barplot: metadata\n",
"taxa barplot2: metadata\n",
"stats prep_alpha_distribution: metadata\n",
"stats alpha_group_significance: metadata\n",
"composition ancombc: metadata\n",
"composition ancombc2: metadata\n",
"**: composition da_barplot: feature_ids\n"
]
}
],
"source": [
"preferred_metadata_names = set(['metadata'])\n",
"\n",
"for plugin_name, plugin in pm.plugins.items():\n",
" for action_name, action in plugin.actions.items():\n",
" for param_name, param in action.signature.parameters.items():\n",
" if param.qiime_type == Metadata:\n",
" if param_name not in preferred_metadata_names:\n",
" print('**', end=': ')\n",
" print(f'{plugin_name} {action_name}: {param_name}')"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "25ffe996",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.14"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment