biocore / gemelli

Gemelli is a tool box for running Robust Aitchison PCA (RPCA), Joint Robust Aitchison PCA (Joint-RPCA), TEMPoral TEnsor Decomposition (TEMPTED), and Compositional Tensor Factorization (CTF) on sparse compositional omics datasets.
BSD 3-Clause "New" or "Revised" License
74 stars 18 forks source link

Qiime2 Version - not able to do multiple states #68

Open callaband opened 1 year ago

callaband commented 1 year ago

Working on doing CTF using the qiime2 CLI, but got an error I don't quite understand.

!qiime gemelli ctf \
    --i-table  ../data/Microbiome/pool_filtered/RPCA/gemelli_filtered.qza \
    --m-sample-metadata-file ../data/Microbiome/14577_fixed.txt \
    --m-feature-metadata-file ../../shotgun_scripts/woltka_v2_taxonomy.qza \
    --p-state-column timepoint_number \
    --p-state-column timepoint_group \
    --p-individual-id-column marmoset_id \
    --output-dir ../data/Microbiome/pool_filtered/ctf-results

Error: (1/1?) Option '--p-state-column' was specified multiple times in the command.

But...

 --p-state-column TEXT  Metadata column containing state (e.g.,Time,
                         BodySite) across which samples are paired. At least
                         one is required but up to four are allowed by other
                         state inputs.                              [required]

So how do I specify more than one state? --p-state-column timepoint_number,timepoint_group \ also did not work.

@gibsramen dug into this a bit, but sounds like it might not actually allow multiple states

gibsramen commented 1 year ago

I think this line:

https://github.com/biocore/gemelli/blob/28d418438814fe2734e5b6c46b21080e1a81af4e/gemelli/ctf.py#L623

is intended to allow multiple states but there does not seem to be a way to pass multiple states in that are coerced properly. I think a possible solution is to first check if the parameter passed to state_column is a list or a string and proceed accordingly. I am not sure how this could be integrated into Q2 as I don't know how they handled multiple arguments for the same parameter.

cameronmartino commented 1 year ago

Thanks @callaband & @gibsramen. I think this is just a case of a maybe poorly worded parameter that is passed across the Q2 and standalone commands. The QIIME2 frame can not have variable outputs (from what I know) so there can not be variable state inputs. So what you are trying in QIIME2 is currently not possible in the current framework. The standalone command can do multiple states and will output variable outputs based on that.

gibsramen commented 1 year ago

Excellent, thanks!