ExpressionNormalizationWorkflow R package throws error
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 = ",")
rownames(sampleTable)<-sampleTable[,1]
rownames(sampleTable)
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
log2_normalized_counts<-log2(normalized_counts+1)
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)
dev.off()
##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.
• 842 views
•
link
0 answers
No answers yet.
Log in to answer this question.
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 https://support.bioconductor.org/, so I will be closing this post.
Hello rohitsatyam102!
We believe that this post does not fit the main topic of this site.
Please ask https://support.bioconductor.org/ (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.
Cheers!