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
            Advancing Precision Medicine for Rare Diseases in Children
            by seqadmin




            Many organizations study rare diseases, but few have a mission as impactful as Rady Children’s Institute for Genomic Medicine (RCIGM). “We are all about changing outcomes for children,” explained Dr. Stephen Kingsmore, President and CEO of the group. The institute’s initial goal was to provide rapid diagnoses for critically ill children and shorten their diagnostic odyssey, a term used to describe the long and arduous process it takes patients to obtain an accurate...
            12-16-2024, 07:57 AM
          • seqadmin
            Recent Advances in Sequencing Technologies
            by seqadmin



            Innovations in next-generation sequencing technologies and techniques are driving more precise and comprehensive exploration of complex biological systems. Current advancements include improved accessibility for long-read sequencing and significant progress in single-cell and 3D genomics. This article explores some of the most impactful developments in the field over the past year.

            Long-Read Sequencing
            Long-read sequencing has seen remarkable advancements,...
            12-02-2024, 01:49 PM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by seqadmin, 12-17-2024, 10:28 AM
          0 responses
          33 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 12-13-2024, 08:24 AM
          0 responses
          49 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 12-12-2024, 07:41 AM
          0 responses
          34 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 12-11-2024, 07:45 AM
          0 responses
          46 views
          0 likes
          Last Post seqadmin  
          Working...
          X