The following was working just fine last week, however, I keep getting different errors all of a sudden and I don't know why
I've been getting either: duplicate 'row.names' are not allowed
when I delete row.names I get: ncol doesn't equal ncount or I get that there are neg values in my count data, which there are not and I simply can not figure out what's wrong... any suggestions?
I've tried playing around with header and a few other things, but can't figure it out
I think it has something to do with it not correctly reading the first column that has the gene names and the first row that has the names that correspond to who the count values within the matrix belong to, but don't know how to fix it
library("DESeq2")
genecountmatrix <- as.matrix(read.csv("/home/gordovezfa/R/3.5/Shawn/file.csv", row.names = "geneid")) View(genecount_matrix)
RNAseq <- read.csv("/home/gordovezfa/R/3.5/Shawn/file.csv", row.names = "ids") View(SMS_RNAseq)
Disease <- factor(c("SMS","Con"))
genecountmatrix <- as.data.frame(genecountmatrix)
RNAseq <- as.data.frame(RNAseq)
dds <- DESeqDataSetFromMatrix(countData = genecountmatrix, colData = RNAseq, design = ~Disease, tidy = TRUE)
dds
dds <- dds[ rowSums(counts(dds)) > 5,] dds <- DESeq(dds)
res <- results(dds, contrast = c("Disease", "Effec", "Con"), tidy = TRUE) res <- res[order(res$padj),] sum(res$padj < 0.05, na.rm = TRUE)
res <- res[ !is.na(res$padj), ] res <- res[ !is.na(res$pvalue), ] res <- res[, -which(names(res) == "padj")]
sum(res$padj < 0.05)
write.csv(as.data.frame(res), file="SMS.csv")
any(duplicated(rownames(genecountmatrix))) [1] FALSE
https://imgur.com/a/hDG7Av6
Current error:
Error in .rowNamesDF<-(x, value = value) : duplicate 'row.names' are not allowed In addition: Warning message: non-unique values when setting 'row.names': ‘0’, ‘1’, ‘10’, ‘100
It’s your colData though that’s giving the error right?
posted an image of the coldata as well if you scroll down
Also, geneNames = row.names(SMS_RNAseq)