Closed khemlalnirmalkar closed 3 years ago
@khemlalnirmalkar,
Hmmm. The fix I made yesterday regarding the group_order
option (#17) shouldn't allow this to happen. Are you sure you reinstalled the latest version of Dokdo (1.10.0-dev
)? Also, can you send me your .qzv file so I can test from my end? If you can't, no worries.
Yes, re-installed and i guess its working well. i cross checked with different sub-set of data using specific grouping/category. If you see both code, in one i used group_order "DonNew" but in the second one no grouping. i am not sure, if that is the reason. Reason of making second plot is to see the abundance of bacteria in a specific time point/longitudinally. this is the step i am getting stuck with one bacteria. i wanted to keep my donors/controls at the first two bars where prevotella is high. Please can you share email and i can sent it you qzv? Sorry, I cant share it here, I just saw your email in profile page. i am sending it there in 10 min.
sent....
I got your file. Will get back to ASAP!
Okay, thank you!
@khemlalnirmalkar,
Thank you for your patience. This was indeed a bug with the group
option (sorry, still getting used to having this option). Below are before and after the fix:
Before:
After:
Code used:
import dokdo
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns
sns.set()
import numpy as np
np.random.seed(1)
qzv_file = 'taxa-bar-plots.qzv'
fig, [ax1, ax2] = plt.subplots(1, 2, figsize=(15, 10))
kwargs = dict(count=8, level=7, legend_short=True, sort_by_mean2=False, sort_by_mean3=False)
dokdo.taxa_abundance_bar_plot(qzv_file,
ax=ax1,
group='body-site',
group_order=['gut'],
**kwargs,
artist_kwargs=dict(show_legend=True))
dokdo.taxa_abundance_bar_plot(qzv_file,
ax=ax2,
include_samples={'body-site': ['tongue', 'gut']},
**kwargs,
artist_kwargs=dict(show_legend=True))
plt.tight_layout()
Please reinstall the latest version with the fix. Please let me know if this doesn't fix your problem.
Hi @sbslee Thank you so much for fixing it, one question, when we choose sort_by_mean2=False, sort_by_mean3=False, how the sorting of taxa works? still with mean? but mean of particular taxa's abundance in all samples? or in one sample or in first sample of the list/group. reason of asking, because Prevotella's abudance in my two donors are ~27%, & ~17%. Now i cant see in count 20. thats strange. its coming in count 38.
@khemlalnirmalkar,
When you set sort_by_mean2
and sort_by_mean3
as False, the taxa will be sorted by their mean abundance across all samples. This ensures that all of your subplots have the identical color schemes for all taxa regardless of sample grouping/filtering.
If I understand your question correctly, you want Prevotella to be included in the plots, but it gets merged with 'Others' because its rank in mean abundance is 38th, right? If that's the case, see if the taxa_names
option can help in your situation. You can manually specify the names of taxa you want.
P.S. If my previous answer solved the original issue, could you let me know so I can close this issue? If you have other questions about the taxa_names
option, please open a different issue so other users can benefit from your insightful questions :)
Yes, please. You can close the issue, Thank you so much for everything, I will open a new issue, if i get any error,
Hi @sbslee , I found a small mismatch during grouping and orders of bacteria. Probably the way my data is but thought maybe you will have a solution, instead of going and labeling each bacteria with colors. if you see both figures, one small difference is prevotella and lactobacillaceae. I wanted to keep Prevotella in both figures but couldn't control. I guess, its how they started grouping, in first I started with control/donors but the second one with samples.
scripts for the first figure:
*** for the second figure
Note: Prevotella is more abundant in bar 1 and 2 (figure 1st) and last two bars (figure2) and they are my controls...so i want to keep.
Any suggestions?