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
            Current Approaches to Protein Sequencing
            by seqadmin


            Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
            04-04-2024, 04:25 PM
          • seqadmin
            Strategies for Sequencing Challenging Samples
            by seqadmin


            Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
            03-22-2024, 06:39 AM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by seqadmin, 04-11-2024, 12:08 PM
          0 responses
          28 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 04-10-2024, 10:19 PM
          0 responses
          31 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 04-10-2024, 09:21 AM
          0 responses
          27 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 04-04-2024, 09:00 AM
          0 responses
          52 views
          0 likes
          Last Post seqadmin  
          Working...
          X