parser: Parse the GPA log output

View source: R/log_parser.R

parserR Documentation

Parse the GPA log output

Description

This function parse log output (analysis.log file) from the SlicerMorph's GPA (General Procrustes analysis) module output.Parser saves everything necessary, including the output files as well as raw coordinates, in a large R object. These output files are shown in the analysis.log file. For details: please see https://github.com/SlicerMorph/Tutorials/blob/main/GPA_3/README.md Note: if the coordinate system of the fcsv files are not LPS (i.e., "0"), the signs of the x and y coordinates will be flipped

Usage

parser(file = NULL, forceLPS = FALSE)

Arguments

file

An object that points to the location of the analysis.log file, either by hard coding the path or interactively via the function "file.choose()"

forceLPS

The forceLPS determines if the landmark coordinates stored in .fcsv files should be converted into LPS format in case if they are not. For details of this parameter, please refer to the help file of read.markups.fcsv().

Value

A list that contains every output of the GPA module.
The output contains:

  • $input.path = Unix style path to input folder with landmark files

  • $output.path = Unix stype path to the output folder created by GPA

  • $files = files included in the analysis

  • $format = format of landmark files ("fcsv" or "mrk.json")

  • $no.LM = number of landmarks original

  • $skipped = If any landmark is omitted in GPA (TRUE/FALSE)

  • $skippedLM = Indices of skipped LMs (created only if $skipped=TRUE)

  • $scale = are data scaled by centroid sizes (TRUE/FALSE)

  • $MeanShape = filename that contains mean shape coordinates calculated by GPA (csv format)

  • $eigenvalues = filename that contains eigenvalues as calculated by PCA in the SlicerMorph GPA (csv format)

  • $eigenvectors = filename that contains eigenvectors as calculated by PCA in the SlicerMorph GPA (csv format)

  • $OutputData = filename that contains procrustes distances, centroid sizes and procrustes aligned coordinates as calculated by the SlicerMorph GPA (csv format)

  • $$pcScores = filename that contains individal PC scores of specimens as calculated by PCA in the SlicerMorph GPA (csv format)

  • $ID = list of specimen identifiers (obtained from file names)

  • $LM = 3D landmark array that contains the 3D raw coordinates as inputed to the SlicerMorph GPA module

  • $semi = If any landmarks are tagged as semi-landmarks (TRUE/FALSE)

  • $semiLM = indices of LMs tagged as semi-landmarks (created only if $semi==TRUE)

Examples

SM.log.file <- file.choose()
SM.log <- parser(SM.log.file. forceLPS = TRUE)
head(SM.log)

chz31/SlicerMorphR documentation built on Feb. 10, 2023, 11:56 p.m.