pca_screeplot: Creates PCA screeplot

View source: R/pca_screeplot.R

pca_screeplotR Documentation

Creates PCA screeplot

Description

Given a PCA structure (result of the centered_pca function), creates a screeplot of the positive eigen values

Usage

  pca_screeplot(pca_struct, filepathroot)

Arguments

pca_struct

An object created by the centered_pca function

filepathroot

The root of the full path name for the output file. If NULL, a "EIGEN.png" file will be created in tempdir(). If not NULL, the filepathroot will have the "_EIGEN.png" extension.

Value

A screeplot of positive eigen values

Author(s)

Antoine GARNIER

Examples

  #File path for output files
  out <- tempdir()
  file <- file.path(out,"test_seq3") 

  #Importing MSA file
  msf <- system.file("msa/toy_align.msf", package = "Bios2cor")
  align <- import.msf(msf)

  #Creating OMES correlation object
  omes <- omes(align, gap_ratio = 0.2)

  #Selecting correlation matrix
  omes <-omes$Zscore

  #Creating PCA object for selected correlation matrix and saving eigen values
  pca <- centered_pca(omes, filepathroot= file, pc= NULL, dec_val= 5, filter = NULL)

  #Plotting scree plot 
  pca_screeplot(pca, file)


Bios2cor documentation built on April 4, 2025, 4:14 a.m.