From 8ce9f3af04cf6beae319663113c7d6724b5bb79a Mon Sep 17 00:00:00 2001 From: Waldir Leoncio Date: Mon, 23 Jan 2023 11:21:16 +0100 Subject: [PATCH 1/3] Translated testFastaData() (#3) --- R/testFastaData.R | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 R/testFastaData.R diff --git a/R/testFastaData.R b/R/testFastaData.R new file mode 100644 index 0000000..ad88256 --- /dev/null +++ b/R/testFastaData.R @@ -0,0 +1,19 @@ +testFastaData <- function(inFile) { + # added by Lu Cheng, 11.11.2012 + if (!exists(inFile, 'file')) { + stop('Fasta file ', inFile, ' does not exist!') + } + + seqs <- load_fasta(inFile) + heds <- colnames(seqs) + ninds <- length(seqs) + + data <- as.matrix(seqs) + newData <- ones(size(data)) * -9 + newData[toupper(data) == 'A'] <- 1 + newData[toupper(data) == 'C'] <- 2 + newData[toupper(data) == 'G'] <- 3 + newData[toupper(data) == 'T'] <- 4 + data <- c(newData, t(1:ninds)) + return(list("ninds" = ninds, "data" = data, "heds" = heds)) +} From 257046dc5f101789c38ccfdadfe928ccd9f15d28 Mon Sep 17 00:00:00 2001 From: Waldir Leoncio Date: Mon, 23 Jan 2023 11:22:01 +0100 Subject: [PATCH 2/3] Fixed synxtax of zeallot call (#3) --- R/dec2bitv.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/dec2bitv.R b/R/dec2bitv.R index db680a8..abe5169 100644 --- a/R/dec2bitv.R +++ b/R/dec2bitv.R @@ -10,7 +10,7 @@ dec2bitv <- function(d, n) { d <- d[] f <- e <- NA - c(f, e) <- matlab2r::log2(max(d)) # How many digits do we need to represent the numbers? - bits <- floor(d * 2 ^ (seq(1 - max(n, e), 0))) %% 2 + c(f, e) %<-% matlab2r::log2(max(d)) # How many digits do we need to represent the numbers? + bits <- floor(d * 2 ^ (seq(1 - max(n, e), 0))) %% 2 return(bits) } From 0f470725990f12259d689eef217134c8b5d870af Mon Sep 17 00:00:00 2001 From: Waldir Leoncio Date: Mon, 23 Jan 2023 11:22:06 +0100 Subject: [PATCH 3/3] Increment version number to 0.0.0.9016 --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 47170d2..2810550 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: rBAPS Title: Bayesian Analysis of Population Structure -Version: 0.0.0.9015 +Version: 0.0.0.9016 Date: 2020-11-09 Authors@R: c(