assignSiteAlleles: Extract site information

Description Usage Arguments Value Examples

View source: R/homoplasyFinder.R

Description

This function will gather information about each of the positions reported in the results table outputted by homoplasyFinder

Usage

1
assignSiteAlleles(results, fastaFile)

Arguments

results

A data.frame object produced by reading in the homoplasyFinder output file produced by runHomoplasyFinderInJava or runHomoplasyFinderJarTool

fastaFile

The full path to a FASTA formatted nucleotide sequence alignment. Defaults to "Not provided"

Value

A list containing information about each site reported in the results table

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Find the FASTA and tree files attached to package
fastaFile <- system.file("extdata", "example.fasta", package = "homoplasyFinder")
treeFile <- system.file("extdata", "example.tree", package = "homoplasyFinder")

# Get the current working directory
workingDirectory <- paste0(getwd(), "/")

# Run the HomoplasyFinder java code
inconsistentPositions <- runHomoplasyFinderInJava(treeFile, fastaFile, path=workingDirectory)

# Get the current date
date <- format(Sys.Date(), "%d-%m-%y")
 
# Read in the output table
resultsFile <- paste0(workingDirectory, "consistencyIndexReport_", date, ".txt")
results <- read.table(resultsFile, header=TRUE, sep="\t", stringsAsFactors=FALSE)

# Get the site information
siteInfo <- assignSiteAlleles(results, fastaFile)

# Get the information for the first site
siteInfo[[1]]

JosephCrispell/homoplasyFinder documentation built on June 7, 2021, 11 a.m.