micom-dev / q2-micom

A Qiime plugin for MICOM.
https://micom-dev.github.io/q2-micom
Apache License 2.0
10 stars 4 forks source link

qiime micom build KeyError: 'd__Bacteria;p__Bacteroidota;c__Bacteroidia;__;__;__' #31

Open Zhaoju-Deng opened 5 months ago

Zhaoju-Deng commented 5 months ago

Hi Diener, I tried to run qiime micom build and had the error in below: 1713936914661

version info: q2cli version 2024.2.0 + QIIME 2 Plugin 'micom' version 0.14.0 (from package 'q2-micom' version 0.14.0) I am wondering if I should remove all the unassigned taxonomy? or anything else was wrong?

many thanks for your help! Zhaoju

cdiener commented 5 months ago

Hi, the unassigned taxonomy is fine. Your tables look a bit odd though. Can you tell me a bit more how you generated them? Were those all outputs from Qiime 2? Because at least the taxonomy looks like it is misformatted. Usually those have spaces between the ; and the rank prefixes should be consistent, so I would have expected d_Bacteria; p__Bacteroidota; c__Bacteroidia; o__; f__; g__. Is that output from the Qiime 2 metagenomics distribution?

Zhaoju-Deng commented 5 months ago

Hi Diener, Thanks very much for your quick reply! the input files were both produced using qiime2 amplicon distribution, and I reproduced the feature table 1713941695030 it seems no spaces between the ; again. should I manually insert a spece between the ranks?

1713941875157 the taxonomy file seems with spaces. many thanks, Zhaoju

cdiener commented 5 months ago

Hm it does not look like the biom table came from the amplicon distribution. This should have the same IDs as the taxa table (the Feature ID column). Normally, all the row names in the biom table appear as feature ID in the taxonomy table.

Zhaoju-Deng commented 5 months ago

hi Diener, thanks for your reply, I will run the previous steps again with newly installed qiime2 amplicon distribution and put the output here.

cdiener commented 5 months ago

Sounds good.

Zhaoju-Deng commented 5 months ago

Hi Diener, I reinstalled qiime2 amplicon distribution and re-run the whole steps from importing 16s amplicon sequences untile producing taxonomy.qza file and feature table file. however, the feature table still the same as previous one with no space between ranks and also missing rank signs. the qiime2 was installed with file from https://data.qiime2.org/distro/amplicon/qiime2-amplicon-2024.2-py38-linux-conda.yml (https://docs.qiime2.org/2024.2/install/native/). any suggestions? many thanks! image

cdiener commented 5 months ago

Hi,

Can you paste the commands you are running? Is the feature table the output from dada2 or did you do something else with it like summarizing on the genus level?

For the micom plugin it expects the table directly from dada2. It will collapse on the used rank automatically.

Zhaoju-Deng commented 5 months ago

Hi Diener, I used deblur and indeed, I summarised at genus level! I just used the output from deblur and it worked out for building the community model and simulate growth in western diet media. for the growth media, would it possible to also include culture media from Carveme? my samples are all cow fecal samples, but there are no cow gut media for simmulating the growth of bacteria? many thanks for your help!! Zhaoju

Zhaoju-Deng commented 5 months ago

Hi Diener, I ran all 263 16s amplicon samples with qiime2 amplicon version and q2-micom, I have the following problems: 1) in qiime micom build I received this warning "Could not identify an external boundary_types.py:90 compartment by name and choosing one with the most boundary reactions. That might be complete nonsense or change suddenly. Consider renaming your compartments using Model.compartments to fix this." I googled it and find this https://github.com/opencobra/cobrapy/issues/926, however, I did not find the reaction.py file in qiime2-micom mamba environment, would it possible to pinpoint the directory of reaction.py file in q2-micom? 1714129413940 Meanwhile, the community size (genus level) seems rather small (average 7+-2)? I used carveme260d0f1_refseq216_genus_1.qza database to build the genus level community.

2) when run qiime micom grow, I received this error/warning for 239/263 samples: "solver encountered an error infeasible solution.py:204 ERROR Could not solve cooperative tradeoff for grow.py:66 SRR13854841. This can often be fixed by enabling presolve, choosing more permissive atol and rtol arguments, or by checking that medium fluxes are > atol." 1714130037752

3) there were 263 samples, but only 19 samples displayed in Sample metabolite utilization/production qzv plot, does that have any connection with the problem in 1)? 1714130290864

many thanks for your valuable help! Zhaoju

cdiener commented 5 months ago

Hi, the warning shouldn't be a problem if you are using CARVEME.

You are right that there aren't that many taxa in there however it does seem to match a good chunk of the abundance so it looks like there aren't that many taxa in the original data? You could also play around with the --p-ccutoff during build to add in more low abundance taxa.

The infeasibility usually comes from not using the correct medium for the model database (needs to be one built for CARVEME, from the media repository for instance).