cafferychen777 / MicrobiomeStat

Track, Analyze, Visualize: Unravel Your Microbiome's Temporal Pattern with MicrobiomeStat
https://www.microbiomestat.wiki/
31 stars 4 forks source link

generate_beta_pc_boxplot_long not plotting all paired lines #13

Closed kennyyeo13 closed 11 months ago

kennyyeo13 commented 11 months ago

Hi Chen,

This is my plot, I have paired data inputted. But it seems to not plot paired lines for all. I have tried it with peerj32.obj and it worked fine. Wondering if you can help?

Thanks Kenny

generate_beta_pc_boxplot_long(

Rplot

cafferychen777 commented 11 months ago

Hi Kenny,

Thank you for reaching out. From what you've described, it sounds like the issue arises due to the design of the generate_beta_pc_boxplot_long function in the MicrobiomeStat package. Specifically, when there's a concern about the plot becoming cluttered due to many subjects, we've set a threshold to limit the number of paired lines. If the number of subjects exceeds this threshold, only an average connecting line will be plotted instead of individual subject lines.

To address your specific issue, you can modify the code of the generate_beta_pc_boxplot_long function. Look for the line:

if (n_times > 10 || n_subjects > 25) {

You can adjust the threshold value of n_subjects to a number that suits your dataset. For instance, if you wish to see paired lines for up to 50 subjects, you can change it to:

if (n_times > 10 || n_subjects > 50) {

After making this change, you should be able to see paired lines for each subject up to the new limit you've set.

I hope this helps! Please let me know if you have any other questions or if there's anything else I can assist you with.

Best regards, Chen

kennyyeo13 commented 11 months ago

Thanks for the help!