Question: error using fitTimeSeries from metagenomeSeq
0
gravatar for noelle.noyes
4.8 years ago by
noelle.noyes30
United States
noelle.noyes30 wrote:

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!

 

microbiome metagenomeseq • 782 views
ADD COMMENTlink modified 4.8 years ago • written 4.8 years ago by noelle.noyes30
Answer: error using fitTimeSeries from metagenomeSeq
1
gravatar for Joseph Nathaniel Paulson
4.8 years ago by
United States
Joseph Nathaniel Paulson270 wrote:

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 COMMENTlink written 4.8 years ago by Joseph Nathaniel Paulson270
Answer: error using fitTimeSeries from metagenomeSeq
1
gravatar for noelle.noyes
4.8 years ago by
noelle.noyes30
United States
noelle.noyes30 wrote:

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

ADD COMMENTlink written 4.8 years ago by noelle.noyes30
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 160 users visited in the last hour