RNA-seq, R, DESeq2,
2
0
Entering edit mode
6.9 years ago
onemore100iq ▴ 20

How to extract transformed counts from DESeqDataSet object as a matrix using assay?

rna-seq • 2.4k views
ADD COMMENT
3
Entering edit mode
6.9 years ago

You should have a dds object that contains normalised counts and that was created and/or further manipulated by the DESeq function.

To transform the normalised counts to regularised log expression levels:

rld <- rlog(dds, blind=FALSE)

To access the counts:

assay(rld)

You can feasibly save these in a new object:

matrixRLD <- assay(rld)
ADD COMMENT
0
Entering edit mode

Thank you so much, sir it worked perfectly

ADD REPLY
0
Entering edit mode

Another 2 questions please,

after getting this matrixRLD, how to subset it so it includes a gene set that in table x in directory y? and if this table x has Enseml gene IDs and HGNC gene name how to get only HGNC gene names to be included in this new matrix?

Thanks in advance

ADD REPLY
0
Entering edit mode

Please, I need help with these 2 questions, I been trying for hours: after getting this matrixRLD, how to subset it so it includes a gene set that in table x in directory y? and if this table x has Enseml gene IDs and HGNC gene name how to get only HGNC gene names to be included in this new matrix?

Thanks in advance

ADD REPLY
0
Entering edit mode

Hi, I am not understanding your question, exactly.

If you want to convert Ensembl to HGNC, try this:

require(biomaRt)
mart <- useMart("ENSEMBL_MART_ENSEMBL")
mart <- useDataset("hsapiens_gene_ensembl", mart)
annots <- getBM(mart=mart,
  attributes=c("ensembl_gene_id", "hgnc_symbol"),
  filter="ensembl_gene_id",
  values=rownames(matrixRLD),
  uniqueRows=TRUE)

This will give you a data-frame of Ensembl-to-HGNC mappings, which you can then use to concert your gene names in matrixRLD.

ADD REPLY
0
Entering edit mode

Thank you so much, sir. I am just new to this field and sometimes getting confused between functions and arguments, and what should come next after this step, etc.... Anyway, thanks and highly appreciated your quick help. Thanks

ADD REPLY
0
Entering edit mode

Okay, no problem. Please create a new question if you have any more problems.

Best of luck, Kevin

ADD REPLY
0
Entering edit mode

Thanks. just one more question, How to do hierarchical clustering to cluster the transformed RNA-seq counts for a get gene set (x) and how to use sigclust2 on this transformed count matrix? Thank you so much in advance for helping a beginner, highly appreciated

ADD REPLY
0
Entering edit mode

I have posted a lot of clustering and heatmap generation:

I have never used sigclust2, however, it seems to d a very similar thing as pvclust, which bootstraps the dendrogram structure and derives probabilities on the branching. For a quick idea on how to run pvclust, take a look here: A: how to make bootstrapped tree in PVCLUST package with SNP genotyping data?

ADD REPLY
1
Entering edit mode
6.9 years ago

If you want the counts normalized for library size only, not log transformed:

counts(dds, normalized = TRUE)
ADD COMMENT

Login before adding your answer.

Traffic: 1628 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