biocore / q2-qemistree

Hierarchical orderings for mass spectrometry data. Canonically pronounced "chemis-tree".
BSD 2-Clause "Simplified" License
31 stars 16 forks source link

added iToL bar chart function #91

Closed qiyunzhu closed 4 years ago

qiyunzhu commented 4 years ago

@anupriyatripathi I have implemented the very function following our discussion last year. This function takes the sample BIOM table and the sample metadata, and a user-defined categorical metadata column, and generate a iToL-readable Q2 artifact which will render a multi-bar chart.

Example command:

python q2_qemistree/_itol_metadata.py \
--classified-feature-data classified-feature-data.qza \
--classyfire-level subclass \
--color-file-path itol_colors.txt \
--label-file-path itol_labels.txt \
--sample-feature-table qe_qert_qiime2_table.qza \
--sample-metadata qe_qert_qiime2_metadata.tsv \
--sample-metadata-column ATTRIBUTE_Sample_type2 \
--barchart-file-path itol_bars.qza

In this case, the metadata column is ATTRIBUTE_Sample_type2. It has five categories. The output file is itol_bars.qza. This file can be directly dragged & dropped into the iToL interface.

The visual effect of the result is like (based on a subsample of 100 taxa): output

qiyunzhu commented 4 years ago

Hi @anupriyatripathi Thanks for your comment! Will get to it.

qiyunzhu commented 4 years ago

@anupriyatripathi Hope it works this time!

qiyunzhu commented 4 years ago

@anupriyatripathi Thanks! What kind of docstring is expected here? Currently there is a one-line docstring, consistent with other functions in the same script.