I am new to RNAseq and started to analyze my dataset using DESeq2. I first run the DESeqDataSetFromMatrix
function and found the error message Error in DESeqDataSetFromMatrix(countData = HitCount, colData = myCondition, : ncol(countData) == nrow(colData) is not TRUE
I then searched online and arranged my code as follow:
myCondition <- read_excel("ConditionTable.xlsx")
View(myCondition)
head(myCondition)
HitCount <- read_excel("HitCounts_30mpi.xlsx", col_names = TRUE,
col_types = c("text", "numeric", "numeric",
"numeric", "numeric", "numeric",
"numeric", "numeric", "numeric",
"numeric"))
View(HitCount)
head(HitCount)
rownames(HitCount) <- HitCount[,1]
HitCount <- HitCount[,-1]
head(HitCount)
all(colnames(HitCount) == myCondition$SampleID)
str(HitCount)
dds <- DESeqDataSetFromMatrix(countData = HitCount,
colData = myCondition,
design = ~ Condition)
dds <- DESeq(dds)
However, I do get the following error when running rownames(HitCount) <- HitCount[,1]
:
Error in
.rowNamesDF<-(x, value = value) : invalid lenght in 'row.names'
This does not stop R to in the calculation but I get in my results that the row names are changed in numbers.