Last data update: 2014.03.03

R: Specialized PCA Plot
GSEPD_PCA_SpecR Documentation

Specialized PCA Plot

Description

After processing the pipeline, users may want to have further PCA figures generated. This function takes a completed GSEPD object and generates informative figures. This function includes parameters to specify a particular GO-Term of interest.

Usage

GSEPD_PCA_Spec(GSEPD, GOT, MDATA = NULL)

Arguments

GSEPD

The master GSEPD object, post-processed.

GOT

The GO-Term you'd like to specifically analyse. It should be found in the .MERGE file.

MDATA

Optionally, pass in the .MERGE dataset, if missing, we'll try to read the already-processed file from the output directory. This option exists because reading that file repeatedly is quite slow, so you're recommended to read it in once in advance if you intend on making more than one GO-Term specific plot.

Value

No return value. Generates files.

Note

This function uses either princomp() or prcomp() as neccesary, depending on sample count vs gene count.

See Also

GSEPD_PCA_Plot

Examples

  data("IlluminaBodymap")
  data("IlluminaBodymapMeta")
  set.seed(1000) #fixed randomness
  isoform_ids <- Name_to_RefSeq(c("HIF1A","EGFR","MYH7","CD33","BRCA2"))
  rows_of_interest <- unique( c( isoform_ids ,
                                 sample(rownames(IlluminaBodymap),
                                        size=500,replace=FALSE)))
  G <- GSEPD_INIT(Output_Folder="OUT",
                finalCounts=round(IlluminaBodymap[rows_of_interest , ]),
                sampleMeta=IlluminaBodymapMeta,
                COLORS=c("green","black","red"))
  G <- GSEPD_ChangeConditions( G, c("A","B")) #set testing groups first!    
  G <- GSEPD_Process( G ) #have to have processed results to plot them
  
  GOT <- "GO:0012345" # specify a GO Term you'd like to review
  
  #it should be present in the MERGE file.
  MergeFile <- list.files(G$Output_Folder, pattern="MERGE")[1]
  MDATA<-read.csv(sprintf("%s%s%s", G$Output_Folder, .Platform$file.sep, MergeFile),
      as.is=TRUE,header=TRUE)
      
  GOT=MDATA$category[1] #choose a GO term that is definitely in the output data.
  
  GSEPD_PCA_Spec(G, GOT,MDATA=MDATA) 

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(rgsepd)
Loading required package: DESeq2
Loading required package: S4Vectors
Loading required package: stats4
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
    rbind, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit


Attaching package: 'S4Vectors'

The following objects are masked from 'package:base':

    colMeans, colSums, expand.grid, rowMeans, rowSums

Loading required package: IRanges
Loading required package: GenomicRanges
Loading required package: GenomeInfoDb
Loading required package: SummarizedExperiment
Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: goseq
Loading required package: BiasedUrn
Loading required package: geneLenDataBase


Loading R/GSEPD 1.4.2
Building human gene name caches
'select()' returned 1:1 mapping between keys and columns
'select()' returned 1:1 mapping between keys and columns
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/rgsepd/GSEPD_PCA_Spec.Rd_%03d_medium.png", width=480, height=480)
> ### Name: GSEPD_PCA_Spec
> ### Title: Specialized PCA Plot
> ### Aliases: GSEPD_PCA_Spec
> 
> ### ** Examples
> 
>   data("IlluminaBodymap")
>   data("IlluminaBodymapMeta")
>   set.seed(1000) #fixed randomness
>   isoform_ids <- Name_to_RefSeq(c("HIF1A","EGFR","MYH7","CD33","BRCA2"))
>   rows_of_interest <- unique( c( isoform_ids ,
+                                  sample(rownames(IlluminaBodymap),
+                                         size=500,replace=FALSE)))
>   G <- GSEPD_INIT(Output_Folder="OUT",
+                 finalCounts=round(IlluminaBodymap[rows_of_interest , ]),
+                 sampleMeta=IlluminaBodymapMeta,
+                 COLORS=c("green","black","red"))
Keeping rows with counts (458 of 505)
>   G <- GSEPD_ChangeConditions( G, c("A","B")) #set testing groups first!    
>   G <- GSEPD_Process( G ) #have to have processed results to plot them
converting counts to integer mode
Would generate OUT/DESEQ.counts.Ax4.Bx8.csv, but one is already present.
Generating OUT/GSEPD.HMA.Ax4.Bx8.csv, overwriting previous existing version.
All Done!
>   
>   GOT <- "GO:0012345" # specify a GO Term you'd like to review
>   
>   #it should be present in the MERGE file.
>   MergeFile <- list.files(G$Output_Folder, pattern="MERGE")[1]
>   MDATA<-read.csv(sprintf("%s%s%s", G$Output_Folder, .Platform$file.sep, MergeFile),
+       as.is=TRUE,header=TRUE)
>       
>   GOT=MDATA$category[1] #choose a GO term that is definitely in the output data.
>   
>   GSEPD_PCA_Spec(G, GOT,MDATA=MDATA) 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>