Getting Greengenes2 for python users

Great work, I will probably move all my pipelines to gg2 soon.
Can you please give usage example for python users?
I tried:
from q2_gg2 import non_v4_16s
but it requires "ctx" which I don't know how to provide.
I have V3-V4 reads and went with non-v4-16s route.

Another point which I didn't understand is,
inputs include table and sequences artifacts. I assume we could use something like table.qza and rep-seqs.qza from moving pictures tutorial.
classify-sklearn using only rep-seqs, why do we need a table here?
When writing this question, it came to my mind that the mapped-table artifact probably contains both sequence and frequency data, which will be use for all subsequent analyses, phlylogenetic and taxonomic, so we get rid of rep-seqs here. Is my understanding correct?

Hi @Marsel_Murzabaev,

I just wanted to let you know that i pulled this over to a seperate topic!


1 Like

Hi @Marsel_Murzabaev,

I apologize for the delay in reply. To interact with the QIIME 2 actions from Python directly, it is necessary to import the plugin representation. For example:

>>> from qiime2.plugins import greengenes2
>>> greengenes2.actions.non_v4_16s
<pipeline qiime2.plugins.greengenes2.pipelines.non_v4_16s>

More information on interacting with QIIME 2 plugins from Python can be found in the Artifact API tutorial.

The reason a FeatureTable[Frequency] is also needed for non-v4-16s is that, behind the scenes, it is executing a q2-vsearch for closed reference OTU picking. That action requires the feature table.

Does that help clarify things?

All the best,


This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.