Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to get variation of each component in function plotPCA(DEseq)?

    Hello all,

    I have the question regarding to the attached figure in this question: http://seqanswers.com/forums/showthr...hlight=plotPCA

    How to get those percentage from each component? I have used the DESeq function plotPCA.

    Here is the simplified code that I used:
    cdsFullBlind = estimateDispersions( cdsFull, method = "blind" )
    vsdFull = varianceStabilizingTransformation( cdsFullBlind )
    print(plotPCA(vsdFull, intgroup=c("condition", "genotype")))

    Thanks a lot!
    Attached Files
    Last edited by xuenjun1; 09-10-2014, 11:21 AM.

  • #2
    From the code for plotPCA:
    Code:
    rv = rowVars(exprs(x))
      select = order(rv, decreasing=TRUE)[seq_len(ntop)]
      pca = prcomp(t(exprs(x)[select,]))
    ntop defaults to 500 and "x" would be vsdFull in your example.

    Comment


    • #3
      Originally posted by dpryan View Post
      From the code for plotPCA:
      Code:
      rv = rowVars(exprs(x))
        select = order(rv, decreasing=TRUE)[seq_len(ntop)]
        pca = prcomp(t(exprs(x)[select,]))
      ntop defaults to 500 and "x" would be vsdFull in your example.
      Thanks a lot!

      I just run and got this result
      summary(pca)
      Importance of components:
      PC1 PC2 PC3 PC4 PC5 PC6 PC7 PC8
      Standard deviation 91.3001 52.8806 26.28177 14.80544 12.35189 10.68246 9.35059 8.70695
      Proportion of Variance 0.6469 0.2170 0.05361 0.01701 0.01184 0.00886 0.00679 0.00588
      Cumulative Proportion 0.6469 0.8639 0.91755 0.93456 0.94640 0.95526 0.96204 0.96793
      PC9 PC10 PC11 PC12 PC13 PC14 PC15 PC16 PC17
      Standard deviation 7.61892 7.45351 7.31581 7.00614 6.63956 6.42668 6.28243 6.10567 5.91024
      Proportion of Variance 0.00451 0.00431 0.00415 0.00381 0.00342 0.00321 0.00306 0.00289 0.00271
      Cumulative Proportion 0.97243 0.97674 0.98090 0.98471 0.98813 0.99133 0.99440 0.99729 1.00000
      PC18
      Standard deviation 5.395e-14
      Proportion of Variance 0.000e+00
      Cumulative Proportion 1.000e+00

      I guess the Proportion of Variance of PC1 and PC2 are the percentage that I want? And one more question, is the plotPCA output PC1 and PC2 in the attached figure corresponding to the first two components out of 18 PCs? Thanks a lot again.

      Comment


      • #4
        Yes, the proportion of the variance is what you want. PC1 and PC2 are from pca$x (the summary function you used doesn't show you everything in the pca object).

        Comment


        • #5
          Just as a note for other who may come across this post, I tried to use the above code with DESeq2 version 1.6.1, and got an error of
          rv = rowVars(exprs(vsd))
          Error in (function (classes, fdef, mtable) :
          unable to find an inherited method for function ‘exprs’ for signature ‘"SummarizedExperiment
          And at least for the version of DESeq2 I am using, the expression is actually obtained by using:
          rv = rowVars(assay(vsd)
          Then everything else works as expected.

          /Posting this in case someone else google-finds this post and then gets the error I did/

          Comment

          Latest Articles

          Collapse

          • seqadmin
            Recent Advances in Sequencing Analysis Tools
            by seqadmin


            The sequencing world is rapidly changing due to declining costs, enhanced accuracies, and the advent of newer, cutting-edge instruments. Equally important to these developments are improvements in sequencing analysis, a process that converts vast amounts of raw data into a comprehensible and meaningful form. This complex task requires expertise and the right analysis tools. In this article, we highlight the progress and innovation in sequencing analysis by reviewing several of the...
            05-06-2024, 07:48 AM
          • seqadmin
            Essential Discoveries and Tools in Epitranscriptomics
            by seqadmin




            The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
            04-22-2024, 07:01 AM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by seqadmin, Today, 07:03 AM
          0 responses
          10 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 05-10-2024, 06:35 AM
          0 responses
          29 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 05-09-2024, 02:46 PM
          0 responses
          37 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 05-07-2024, 06:57 AM
          0 responses
          31 views
          0 likes
          Last Post seqadmin  
          Working...
          X