Added process_GenePop_data()

This commit is contained in:
Waldir Leoncio 2024-09-13 13:51:25 +02:00
parent 036ec00bbd
commit 00605016d6

24
R/process_GenePop_data.R Normal file
View file

@ -0,0 +1,24 @@
process_GenePop_data <- function(filename) {
# Pre-processing GenePop data
kunnossa <- testaaGenePopData(filename)
data_popnames <- lueGenePopData(filename)
data <- data_popnames$data
popnames <- data_popnames$popnames
# Processing GenePop data
c <- handleData(data, "genepop")
Z_dist <- newGetDistances(c$newData, c$rowsFromInd)
# Forming and returning pre-processed data
list(
"data" = c$newData,
"rowsFromInd" = c$rowsFromInd,
"alleleCodes" = c$alleleCodes,
"noalle" = c$noalle,
"adjprior" = c$adjprior,
"priorTerm" = c$priorTerm,
"dist" = Z_dist$dist,
"popnames" = popnames,
"Z" = Z_dist$Z
)
}