This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Invalid covariate name

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

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....

0 answers

No answers yet.

Log in to answer this question.