error using fitTimeSeries from metagenomeSeq
2
0
Entering edit mode
noelle.noyes ▴ 30
@noellenoyes-7241
Last seen 8.8 years ago
United States

I am getting an error message trying to run fitTimeSeries from metagenomeSeq:

 

 

fitTimeSeries(obj, feature=1, class="Class", time="Time" , id="Sample")

Error in Summary.factor(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,  : 

  min not meaningful for factors

 

I tried changing "Time" to numeric, thinking that perhaps that was the problem:

fitTimeSeries(obj, feature=1, class="Class", time = as.numeric("Time"), id="Sample")

But got this error message:

Error in `[.data.frame`(pData(obj), , time) : undefined columns selected

In addition: Warning message:

In `[.data.frame`(pData(obj), , time) : NAs introduced by coercion

I've checked that "Class", "Time" and "Sample" are all contained in the pData, so I'm not sure why the columns are undefined...

Thanks very much!

 

metagenomeSeq microbiome • 1.7k views
ADD COMMENT
1
Entering edit mode
@joseph-nathaniel-paulson-6442
Last seen 7.7 years ago
United States

Hi Noelle again!

You are correct that the issue is that Time is not a continuous value! The issue comes from when calling time, class, and id in the fitTimeSeries function you're sending the column names of the phenoData matrix, not the actual values. You can recreate the MRexperiment object and it should work once you remake the object with time a numeric variable as opposed to a factor.

pd = pData(obj)
pd$Time = as.numeric(pd$Time)
x = newMRexperiment(MRcounts(obj),normFactors=normFactors(obj),phenoData=AnnotatedDataFrame(pd))
fit = fitTimeSeries(x, feature=1, class="Matrix", time="Time" , id="Sample")

 

Best wishes

ADD COMMENT
1
Entering edit mode
noelle.noyes ▴ 30
@noellenoyes-7241
Last seen 8.8 years ago
United States

Thanks Joseph for your help with all of my questions -- your suggestions worked great!  

ADD COMMENT

Login before adding your answer.

Traffic: 846 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6