Last data update: 2014.03.03

R: run PCA to identify functional positions in an alignment
run_between_pcaR Documentation

run PCA to identify functional positions in an alignment

Description

This is a cover function that runs supervised PCA on a matrix that represents an alignment. The matrix can either be a binary matrix (with or without pseudocounts) or one that represents the properties at each position of the alignment

Usage

 run_between_pca(x,z,y)

Arguments

x

Matrix representation of alignment generated by convert_aln_amino

z

Matrix representation of alignment generated by convert_aln_amino or convert_aln_AAP

y

Vector or factor that shows the group representation for each sequence in the alignment

Examples

library(bgafun)
data(LDH)
data(LDH.groups)
#Used to calculate the sequence weights
data(LDH.amino.gapless)
data(LDH.aap.ave)
#Run the analysis
LDH.aap.ave.bga=run_between_pca(LDH.amino.gapless,LDH.aap.ave,LDH.groups)
class(LDH.aap.ave.bga)
#to visualise the results
plot(LDH.aap.ave.bga)

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(bgafun)
Loading required package: made4
Loading required package: ade4
Loading required package: RColorBrewer
Loading required package: gplots

Attaching package: 'gplots'

The following object is masked from 'package:stats':

    lowess

Loading required package: scatterplot3d
Loading required package: seqinr
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/bgafun/run_between_pca.Rd_%03d_medium.png", width=480, height=480)
> ### Name: run_between_pca
> ### Title: run PCA to identify functional positions in an alignment
> ### Aliases: run_between_pca
> ### Keywords: manip
> 
> ### ** Examples
> 
> library(bgafun)
> data(LDH)
> data(LDH.groups)
> #Used to calculate the sequence weights
> data(LDH.amino.gapless)
> data(LDH.aap.ave)
> #Run the analysis
> LDH.aap.ave.bga=run_between_pca(LDH.amino.gapless,LDH.aap.ave,LDH.groups)
> class(LDH.aap.ave.bga)
[1] "pca" "bga"
> #to visualise the results
> plot(LDH.aap.ave.bga)
 [1] 191 192 194 311 376 378 380 384 401 483 485 523 586 587 588 589 590 591 637
[20] 640
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>