Off topic:ExpressionNormalizationWorkflow R package throws error
Entering edit mode
12 months ago

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.

normalisation RNA-Seq rna-seq sequencing • 299 views
This thread is not open. No new answers may be added
Traffic: 2607 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6