Data Preparation for Fourth Corner Analysis #110
-
Hi, Thank you so much for this amazing package. I am a microbiologist with very minimal knowledge of coding :0 It's been a while since I tried to run the fourth corner analysis, but I cannot. Hopefully, you can help me: Problem: My data x, y, and TR are not properly created and I received different errors from error in cbind to having an empty TR in the fourth corner. What I have done so far: I tried to create the X: 90X5, y: 90X90 and TR: 90X5. Transformed and rotated them so many times. Made sure the row are matched and it did not help. My data: I am working with a very large amount of data. I have about 27000 traits (metabolic pathways). I picked only 5 pathways to just check the data but it didn't work. For my environmental data I only choose the numeric columns and used as.numeric function to make sure they are. My data without any reduction: This is my y: ( my relative abundance data. First column is the sample names, the rest are my ASVs) This is my TR: (my metabolic pathways. First column is the metabolic pathways nemae. THe rest are my ASVs) These are the pathways I wanted to test: Also to choose the same ASVs for Y and TR I get the common cols by using this code: Get the common column namescommon_cols <- intersect(colnames(data_frame_for_gllvm), colnames(pathways_wider)) The code I used:
I hope I have provided enough information; if not, please let me know. I really appreciate your help. Thank you, |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Thanks for the code! I was unable to reproduce your issues though; you provide a file "pathways_wider", but it is not clear from the script where that should come in. Generally, the easiest format for your data is "wide" so that the number of columns in If you need more help, please incorporate the pathway file in your code above so I that can reproduce your issues. |
Beta Was this translation helpful? Give feedback.
-
Thank you so much Bert. @BertvanderVeen I ended up making a subset of pathway_wider called pathway_wider_1: And this is the final code:
I hope this help reproduce my issue. |
Beta Was this translation helpful? Give feedback.
-
Not really - but your matrix for |
Beta Was this translation helpful? Give feedback.
-
Thank you so much @BertvanderVeen . That was the problem. I removed the NAs and it worked. |
Beta Was this translation helpful? Give feedback.
Not really - but your matrix for
X
looks fine. One potential issue with "pathways_wider_1.csv" from above is that it contains NAs, which is not allowed.