biocore / empress

A fast and scalable phylogenetic tree viewer for microbiome data analysis
BSD 3-Clause "New" or "Revised" License
45 stars 31 forks source link

Feature metadata is being dropped #511

Closed mortonjt closed 3 years ago

mortonjt commented 3 years ago

I've been playing around with leveraging empress to visualization phylogenetic log-ratios; honestly its incredibly impressive how seamlessly this whole process is.

I'm finetuning some of these visualizations and am noticing that not all of the feature metadata is being rendered. For instance if I highlight clade28 I will get the following figure with a bunch of white patches scattered through out the figure

ilr-balances

I've double checked the feature metadata and the tree, all of the features and their metadata are synced, so I'm a little confused where the white spaces are coming from. Below is the command and the qzas to reproduce this figure. I've gotten this work seamlessly with other examples so there is a chance that this is just an edge case.

qiime empress tree-plot \
       --i-tree bifurcated_tree.qza \
      --m-feature-metadata-file taxonomy.qza \
      --m-feature-metadata-file clade_metadata.qza \
      --o-visualization phylogenetic-balances.qzv

qzas.zip

EDIT : this only happens when taxonomy.qza is included; if only clade_metadata.qza is included then the problem goes away.

kwcantrell commented 3 years ago

hey @mortonjt I'm not entirely sure why you are getting this behavior but I have a couple ideas. Ill take a look at the .qzas and let you know what I find.

kwcantrell commented 3 years ago

Okay, @fedarko mentioned this might actually be a Q2 issue. It looks like Q2 is merging your metadata files before passing it to EMPress however Q2 uses an inner join to merge multiple metadata files. (see open issue here). Basically clade_metadata.qza contains tips not found in taxonomy.qza so when Q2 merges these two files, it will remove the tips not found in taxonomy.qza. This also explains why it works with just clade_metadata.qza.

So I guess the solution in the meantime (although not ideal) is to manually merge the files before passing them into EMPress.

mortonjt commented 3 years ago

Right on, thanks for confirming @kwcantrell !

fedarko commented 3 years ago

I think we can close this issue since this confusion will be need to be fixed on the QIIME 2 side of things, as Kalen explained. In the meantime, the README has some documentation discussing this. Please feel free to re-open if I'm mistaken!

mortonjt commented 3 years ago

No, my question was answered since this appears to be a qiime2 issue. Thanks!