DeSeq2 filter transcripts
1
0
Entering edit mode
6 weeks ago
bleven • 0

Hello, I am running Differential gene analysis. I am filter the counts before running differential gene analysis, because so many of my genes have low mapped reads and that is affecting it. My issue is that I take out my transcript column to run DeSeq2 but the issue is that then since I filter the sample I am unsure what gene goes with what count, so then when I make a volcano plot I can see genes are upregulated and down regulated but I do not know what genes are. Please see attached code

  cts <- read_excel("~/DS.xlsx", sheet="fibro_IFN100_DS_CT")

metadata <- (read_excel("~/DS.xlsx", sheet="fibro_IFN100_DS_CT_coldata"))

rownames(cts) <- cts$transcript

temp_cts_with_transcriptNames <- cts

#Adding NULL info to roName
cts$transcript <- NULL
cts_no_transcript<- cts[,-1]

dds <- DESeqDataSetFromMatrix(countData = cts_no_transcript,
                              colData = metadata,
                              design= ~ factor(condition))

smallestGroupSize <- 2

keep <- rowSums(counts(dds) >= 50) >= smallestGroupSize
dds <- dds[keep,]


dds2 <- DESeq(dds)
resultsNames(dds2)
res <- results(dds2, name="factor.condition.DS")
res
res
DeSeq2 RNA-seq RNA • 291 views
ADD COMMENT
0
Entering edit mode
6 weeks ago
seidel 11k

You can hand DESeq2 a matrix with rownames as gene names, or if the first column of your matrix is gene names use the tidy=TRUE argument (see ?DESeqDataSetFromMatrix)

Guessing from your code above, you should be able to do something like:

rownames(cts) <- cts$transcript
cts <- cts[,-1]

dds <- DESeqDataSetFromMatrix(countData = cts,
                              colData = metadata,
                              design= ~ factor(condition))

(just removing the transcript column from your matrix after you use it to assign rownames)

ADD COMMENT

Login before adding your answer.

Traffic: 2556 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

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

Powered by the version 2.3.6