Learn R Programming

Bios2cor (version 1.2)

create_pcafile: Creates a file of coordinates in PCA space

Description

Given an object of class 'pca' (result of the centered_pca function), stores the coordinates of each element in the PC space in a txt file

Usage

create_pcafile(
    pca_struct,
    entropy= NULL,
    filepath,
    top_positions= 10,
    top_pca1= NULL,
    top_pca2= NULL
  )

Arguments

pca_struct

An object created by the centered_pca function

entropy

An object created by the entropy or the rotamer_entropy function

filepath

The full path name of the output file where all coordinates on all components are stored

top_positions

An integer corresponding to the number of elements with highest coordinates on the first or on second principal component that will be save if top_pca1 or top_pca2 are not FALSE. DEFAULT is 10

top_pca1

The full path name of the output file where the PC1 and PC2 coordinates of the elements with top PC1 coordinates are saved

top_pca2

The full path name of the output file where the PC1 and PC2 coordinates of the elements with top PC2 coordinates are saved

Value

returns a file containing the coordinates of each element in PC space and, optionally, top elements on PC1 or PC2 with their coordinates on PC1 and PC2

Details

The object returned by the centered_pca function contains coordinates in the PC space for each element. Each line of the pca file will contain the name of the current element and its coordinates. Any line that contains NaN value for X, Y or Z coordinates will be ignored. Optionally, the function also returns the top 'top_positions' elements with highest absolute coordinates on PC1 and PC2

Examples

Run this code
# NOT RUN {
   msf <- system.file("msa/toy_align.msf", package = "Bios2cor")
  align <- import.msf(msf)

  #Creating OMES object
  omes <- omes(align,fileHelix= NULL , diag= 0, fileCSV= NULL, gap_val= 0.8, z_score= TRUE)
  omes <-omes$normalized

  pca <- centered_pca(omes, m = NULL, pc= NULL, dec_val= 5,eigenvalues_csv= NULL)
   
  create_pcafile(pca, entropy = NULL,"pca_results.txt",10,"pc1.txt","pc2.txt")
  
# }

Run the code above in your browser using DataLab