Question: (Closed) ExpressionNormalizationWorkflow R package throws error
gravatar for rohitsatyam102
6 months ago by
rohitsatyam102200 wrote:

Hi Everyone!!

I am using the following package for SVA analysis. Using normalized log2 values from DESeq2 object. However, I am getting the error at the SVA step. The entire code is as follows:

sampleTable <- read.csv("samplesheet.csv",  header = T, stringsAsFactors = FALSE, sep = ",")

ddsHTSeq<-DESeqDataSetFromHTSeqCount(sampleTable = sampleTable, directory = ".", design = ~ Sampletype + Batch)
keep <- rowSums(counts(ddsHTSeq)) > 10
ddsHTSeq <- ddsHTSeq[keep,]
ddsHTSeq <- estimateSizeFactors(ddsHTSeq)
normalized_counts <- counts(ddsHTSeq, normalized=TRUE)

##Checking the source of variation
    ###SVA analysis using Expression Normalization workflow package
    inpData <- expSetobj(log2_normalized_counts, sampleTable)

 ## Set the covariates whose effect size on the data needs to be calculated
        cvrts_eff_var <- c("Sampletype", "Batch")
        pct_thrsh <- 0.75 
        ## Perform the PVCA analysis
        library(grid, lib.loc = "C:/Program Files/R/R-3.6.2/library")
        png("PVCA_Batch_eff.png", width = 10, height = 9, units = 'in', res = 700)
        pvcAnaly(inpData, pct_thrsh, cvrts_eff_var)

    ##Surrogate variable analysis
    ## Choose a biological variable that is to be used to calculate the surrogate variables
    biol_var_sva <- "Sampletype" 
    sur_var_obj <- surVarAnaly(inpData, biol_var_sva)
  Error in names(x) <- value :  'names' attribute [2] must be the same length as the vector [0]

But when I use:
 biol_var_sva <- "Batch" 
    #Number of significant surrogate variables is:  1 
            #Iteration (out of 5 ):1  2  3  4  5  

    ## The newly generated surrogate variables sv1 is appended to the ExpressionSet object
    inpData_sv <- sur_var_obj$expSetobject
    var_names <- "sv1"
pData(inpData_sv)<-conTocat(pData(inpData_sv), var_names) 

Error in 1:len : argument of length 0

I am unable to understand what's wrong over here. Please help.

ADD COMMENTlink modified 6 months ago • written 6 months ago by rohitsatyam102200

Is there a reason you're using this obscure package instead of something like sva or ComBat? For errors you face in such obscure packages, you'd be better off emailing the author/developer directly. Also, this question belongs on, so I will be closing this post.

ADD REPLYlink modified 6 months ago • written 6 months ago by _r_am31k

Hello rohitsatyam102!

We believe that this post does not fit the main topic of this site.

Please ask (or even better, email the author/developer)

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.


ADD REPLYlink written 6 months ago by _r_am31k
Please log in to add an answer.
The thread is closed. No new answers may be added.


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