guokai8 / microbial

Do microbiome analysis with dada2 and phyloseq object
GNU General Public License v3.0
12 stars 3 forks source link

ldamarker error #6

Open Jawen-D opened 2 years ago

Jawen-D commented 2 years ago

Hi Kai,

I get this error whenever I try these scripts in R:

ps phyloseq-class experiment-level object otu_table() OTU Table: [ 1052 taxa and 24 samples ] sample_data() Sample Data: [ 24 samples by 2 sample variables ] tax_table() Taxonomy Table: [ 1052 taxa by 8 taxonomic ranks ]

pp <- ldamarker(ps, pvalue = 0.05, normalize = TRUE, method = "relative") Normalization using relative method Error in $<-.data.frame(*tmp*, "tax", value = character(0)) : replacement has 0 rows, data has 25248

May I ask some advice on how to resolve this.

Thanks James

guokai8 commented 2 years ago

Hi @Jawen-D, Do you have the group in your data. I think you may need to give the group name for the ldamarker function. K

Jawen-D commented 2 years ago

Do you have the group in your data.

Yes I do have.

I tried using this script to use groupings in the ldamarker function:

res2 <- ldamarker(ps, group="Group", pvalue = 0.05, normalize = TRUE, method = "relative")

But still, I get this error: Error in $<-.data.frame(*tmp*, "tax", value = character(0)) : replacement has 0 rows, data has 25248

James

guokai8 commented 2 years ago

Do you have multiple groups in your data?
K

Jawen-D commented 2 years ago

I only have two groups. Patient and Control group.

James

Jawen-D commented 2 years ago

Is there something wrong with my script or is it my phyloseq object that needs to be checked?

guokai8 commented 2 years ago

Hi @Jawen-D , Did you try other functions to find the differential ASVs? I am not sure if there are anything wrong with your script or your phyloseq object. Could you list the information about your sample data? K