Invalid covariate name
0
1
Entering edit mode
4.4 years ago

Hi, I am trying to follow this ballgown tutorial https://rpubs.com/selveyad/ballgown_tutorial

I do create two ballgown objects, e.g.

bg = ballgown(dataDir = "ballgown", samplePattern = "HI.3923.001.Index", pData = phenodata )

and

bg_filt = subset(bg, "rowVars(texpr(bg)) >1", genomesubset=TRUE)

however when it comes to results_transcripts step I have the following error

results_transcripts <- stattest(bg_filt, 
  feature="transcript",
  covariate="tissue", 
  adjustvars=c("state"), 
  getFC = TRUE, 
  meas = "FPKM")

**Error in stattest(bg_filt, feature = "transcript", covariate = "tissue",  : 
  invalid covariate name**

I thought it is due to the factorisation or smth. but nope, the tissue column is a 2-lvl factor:

str(phenodata)
'data.frame':   12 obs. of  3 variables:
 $ id    : Factor w/ 12 levels "HI.3923.001.Index_1.1BD1",..: 1 5 6 7 8 9 10 11 12 2 ...
 $ tissue: Factor w/ 2 levels "brain","intestine": 1 1 1 1 1 1 2 2 2 2 ...
 $ state : Factor w/ 3 levels "control","fasted",..: 1 2 3 1 2 3 3 1 1 2 ...

I wonder, therefore, what is that "covariate name" problem?

Can anyone help me with that? I would be very much obliged. Thank you!

RNA-Seq R ballgown • 1.5k views
ADD COMMENT
0
Entering edit mode

Do you get the same error on the unfiltered bg data set? btw this is the code that's generating the error:

colind = which(names(pData) == covariate)
if(length(colind) == 0) stop("invalid covariate name")

It's checking if the covariate specified exists in your dataframe. For whatever reason it's not seeing it....

ADD REPLY

Login before adding your answer.

Traffic: 2420 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