help with time series analysis
1
0
Entering edit mode
11 months ago

Hello,

I have readcount data from my metagenome experiment. My metagenome experiment looks like this:

control T0   T1   T2   T3   T4
case    T0   T1   T2   T3   T4


I have two conditions (case and control) and five time points. I have readcounts data from each control and case samples across these 5 time points. I want to conduct analysis as below:

1. Calculate abundance differences within each condition i.e. control and for example, T0 vs T4, T1 vs T4, T2 vs T4 and T3 vs T4). Like which taxa is significantly different at different time point compared to baseline (T4).

2. Measure differences between control and cases on each time point i.e case vs control @ T0, case vs control @ T1, case vs control @ T2, case vs control @ T3, case vs control @ T4.

I know I should be doing time series analysis but I don't know how to perform this complex longitudinal analysis.

I would really appreciate if you someone could help me in deciding where to start? Or direct me to any tutorial where I could learn and apply the same on my data.

time-series readcount time series RNAseq • 708 views
0
Entering edit mode

This seems a good one and may serve my purpose. So, I tried it but I get the error when I run the following:

variance_per_genes = apply(data, 1, mad)


I get the following error:

Error in x - center : non-numeric argument to binary operator


I looked at the shoemaker data too and it contain all the values greater than 0 whereas my data contains 0 as well. Also, shoemaker data has equal replications (1,2,3) whereas i have different replication number for some samples. Could that be the reason? Any thoughts?

0
Entering edit mode

This issue seems to be related to the file format. When I loaded the shoemaker2015 data directly from the package, I can run rest of the all steps without any error. However, when I first saved the "data" and "meta" on my computer in .txt/.csv format then loaded it from my computer, it gives me the following error:

Code:

moanin_model = create_moanin_model(data=data, meta=meta,  degrees_of_freedom=6)


Error:

Error in contrasts<-(*tmp*, value = contr.funs[1 + isOF[nn]]) : contrasts can be applied only to factors with 2 or more levels


Any ideas in which format the shoemaker2015 data is?

0
Entering edit mode
11 months ago
Chris Dean ▴ 280

There are a couple of options, depending on which analysis you would like to do.

If you would like to proceed with a longitudinal differential abundance analysis, you can use the fitTimeSeries function in the metagenomeSeq package. If you would like to proceed with a differential abundance analysis between your grouping variables, you can use ANCOM, ALDEx2, and others.

I suggested ANCOM and ALDEx2 because these have become increasingly popular in the microbiome literature.

I hope this helps!