ChiLiubio / microeco

An R package for data analysis in microbial community ecology
GNU General Public License v3.0
181 stars 55 forks source link

why some otu were omiited when doing trans_venn ? #289

Closed Chuan-Jiang closed 7 months ago

Chuan-Jiang commented 8 months ago

Thanks, Dr. ChiLiu for the your excellent work.

When I am making a venn diagram with the following command,

tg <- crc_mg_filter$merge_samples(use_group = "LymNode")

t1 <- trans_venn$new(tg, ratio = "seqratio")
options(repr.plot.width=10, repr.plot.height=10)
#t1$plot_venn(petal_plot = TRUE)
t1$data_summary

I get classified 340 otus in total :

    Counts  Abundance
<int>   <chr>
LN  0   0%
LM  0   0%
C   0   0%
LN&LM   5   0.2%
LN&C    2   0.1%
LM&C    1   0.1%
LN&LM&C 332 99.7%

However, the count of otus in tg is 441:

dim(tg$otu_table)

# 441 3

the otus/taxa were ommit look like the following:

    LN  LM  C
<dbl>   <dbl>   <dbl>
k__Bacteria|p__Firmicutes|c__Clostridia|o__Eubacteriales|f__Lachnospiraceae|g__Mediterraneibacter|s__Mediterraneibacter_glycyrrhizinilyticus    2.28761 0.87670 4.29656
k__Bacteria|p__Firmicutes|c__Negativicutes|o__Veillonellales|f__Veillonellaceae|g__Veillonella|s__Veillonella_rogosae   2.13940 0.80637 8.55997
k__Bacteria|p__Firmicutes|c__Bacilli|o__Lactobacillales|f__Streptococcaceae|g__Streptococcus|s__Streptococcus_sanguinis 0.76406 4.08365 0.71979
k__Bacteria|p__Firmicutes|c__Clostridia|o__Eubacteriales|f__Eubacteriales_unclassified|g__Gemmiger|s__Gemmiger_SGB1481  1.05691 13.36147    0.68357
k__Bacteria|p__Firmicutes|c__Clostridia|o__Eubacteriales|f__Lachnospiraceae|g__Lachnospiraceae_unclassified|s__Lachnospiraceae_bacterium_BX3    2.02910 0.60045 6.64758
k__Bacteria|p__Firmicutes|c__Clostridia|o__Eubacteriales|f__Oscillospiraceae|g__GGB9616|s__GGB9616_SGB15051 1.95598 0.71533 3.36555

I am wondering why these otus were ommited by trans_venn? how should I adjust some corresponding thresholds?

Thanks

ChiLiubio commented 8 months ago

Hi. Could you please attach your data so that I can reproduce your issue? To save your dataset (i.e. crc_mg_filter), please follow the steps in the tutorial (https://chiliubio.github.io/microeco_tutorial/notes.html#save-function) and attach the compressed object.

Best, Chi

Chuan-Jiang commented 8 months ago

crc_mg_filter_metap.zip

here you are. thanks

ChiLiubio commented 8 months ago

Hi. The input data in this function is only designed for the count data. So there is no compatability for the data with decimals. To fix this issue, please try to convert the data to integers.

tg <- crc_mg_filter$merge_samples(use_group = "LymNode")
library(magrittr)
tg$otu_table %<>% ceiling
tg$tidy_dataset()

I am also curious about why the input data is decimals. I guess this data comes from metagenomic profiling, it is sure fine to convert them to integers with ceiling or round depending on your threshold.

Best, Chi

Chuan-Jiang commented 7 months ago

Thank you very much!