Entering edit mode
This is my code :-
library(DESeq2)
library(ggplot2)
countData <- read.csv('/home/keshav/Downloads/gene_count_matrix.csv', header = TRUE,sep = ",")
countData <- as.matrix(countData)
rownames(countData) <- countData[ , 1]
countData = as.matrix(countData[ , -1])
head(countData)
(condition <- factor(c("Normal","Tumor","Normal","Tumor")))
(coldata <- data.frame(row.names=colnames(countData), condition))
dds <- DESeqDataSetFromMatrix(countData=countData,
colData=coldata,
design=~condition)
dds
The error I'm facing is :-
Error in DESeqDataSet(se, design = design, ignoreRank) :
some values in assay are negative
Please advise.
```
I suggest you to check your counts matrix because there shouldn't be negative raw counts in this matrix. You should investigate why : is it your own count matrix?, did you perform any modifications before?, have you downloaded it somewhere else?
I have generated the gene count matrix manually . Upon downloading the data from sra, perfomed fastqc analysis and then proceeded with trimmomatic to trim the low quality reads. Then i made use of hisat2 to align it to a reference genome and upon doing so, made use of samtools to generate sorted bam files. I then proceeded with stringtie to generate a gene count matrix. This is the procedure i followed.
You don't need stringtie unless you want to assemble a transcriptome. Just use featureCounts to make your count matrix. It will do fine, and will not make any mess.
Okay. Thank you.
Your error might stem from stringie then, unfortunately I do not use it and I think you would have a better answer by opening a github issue (it seems this error already happened here : https://github.com/gpertea/stringtie/issues/69). You could first check that you have indeed negative values in your raw counts with
sum(countData<0)
Thank you . I will look into it, and upon running sum(countData<0), out of 231780 elements, 231642 of those are below 0. I think it may be an issue with stringtie. I will try running another tool to generate the count matrix.