Question: Invalid covariate name
1
gravatar for mark.pekarsky
6 months ago by
mark.pekarsky20 wrote:

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 ballgown R • 316 views
ADD COMMENTlink modified 6 months ago by Biostar ♦♦ 20 • written 6 months ago by mark.pekarsky20

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 REPLYlink modified 6 months ago • written 6 months ago by Amar650
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 2.3.0
Traffic: 879 users visited in the last hour