Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trans_diff$new with method "DESeq2" causes error. #412

Open
145218415 opened this issue Sep 24, 2024 · 5 comments
Open

trans_diff$new with method "DESeq2" causes error. #412

145218415 opened this issue Sep 24, 2024 · 5 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers

Comments

@145218415
Copy link

Hi, thanks for building and maintaining this fantastic package.

I am wanting to use the DESeq2 method in your trans_diff function but come across the following error:

t1 <- trans_diff$new(dataset = me, method = "DESeq2", group = "chimio", alpha = 0.05)

293 input features ...
Available feature number:
Error in initialize(...) : The input otu_table must be data.frame format!

me

microtable-class object:
sample_table have 50 rows and 14 columns
otu_table have 1121 rows and 50 columns
tax_table have 1121 rows and 7 columns
phylo_tree have 1121 tips
rep_fasta have 1121 sequences
Taxa abundance: calculated for Kingdom,Phylum,Class,Order,Family,Genus,Species
Alpha diversity: calculated for Observed,Chao1,se.chao1,ACE,se.ACE,Shannon,Simpson,InvSimpson,Fisher,Pielou,Coverage,PD
Beta diversity: calculated for bray,jaccard,wei_unifrac,unwei_unifrac

class(me$otu_table)

[1] "data.frame"

The data I am using works on other methods such as lefse, t.test, metastat, rf, but not ancombc2 which gives the same error.

Any thoughts on what could be causing this and how I can fix it ?

Thanks in advance !

@ChiLiubio
Copy link
Owner

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

@145218415
Copy link
Author

I restarted everything (updated Rstudio) and now it is working.
Just to let you know, when the error occurred, it was also happening with the mt object from the tutorial. So probably a conflict with loaded libraries.
Sorry for the waste of time, and thanks again for your fantastic tool and your reactivity !

@ChiLiubio ChiLiubio added the documentation Improvements or additions to documentation label Sep 26, 2024
@hanareia
Copy link

Hi there, I am also getting the same error when trying to use DESeq2 when looking at fungal traits across groups (9.1 Fungi data in the tutorial):

t7 <- trans_diff$new(dataset = ttmp_mt, method = "DESeq2", group = "Location", taxa_level = "func")

25 input features ...
Available feature number:
Error in initialize(...) : The input otu_table must be data.frame format!

class(ttmp_mt$otu_table)

[1] "data.frame"

I have attached the ttmp_mt object I am using: ttmp_mt.zip

Any help is much appreciated!

@ChiLiubio
Copy link
Owner

Hi. The reason is that taxa_level "func" is not in the tax_table, while the methods like deseq, ALDEx2_t, edgeR and linda are designed for the sequencing abundance of units. The input of these methods inside the function are the abundance table otu_table, not the 'func' table in taxa_abund list. This is very different with the traditional method like anova, kw, wilcox, lm etc. which directly use the 'func' table in taxa_abund for the calculation. So I suggest using those traditional method instead of those that is developed specifically for the ASV/OTU. If you want to use it, please try this.

ttmp_mt$otu_table <- ttmp_mt$taxa_abund$func
ttmp_mt$tax_table <- NULL
ttmp_mt$add_rownames2taxonomy("func")
ttmp_mt$tidy_dataset()
t7 <- trans_diff$new(dataset = ttmp_mt, method = "DESeq2", group = "Location", taxa_level = "func")
# error says the input data should be intergers like otu abundance. So please try to use other method

@ChiLiubio ChiLiubio added enhancement New feature or request good first issue Good for newcomers labels Oct 30, 2024
@ChiLiubio
Copy link
Owner

@hanareia I will add more checking and messages in the function for such usages in case of the data mismatch problem. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants