Fixed several linting issues

This commit is contained in:
Waldir Leoncio 2022-07-28 15:47:36 +02:00
parent 66d0f0c730
commit 835ac7e6b9
28 changed files with 180 additions and 175 deletions

View file

@ -46,7 +46,6 @@ test_that("type convertions behave like on Matlab", {
expect_equal(proportion2str(0.4), "0.40")
expect_equal(proportion2str(0.89), "0.89")
expect_equal(proportion2str(-0.4), "0.0-40") # also bugged in original
# TODO: fix after release, as long as it doesn't break anything else
})
test_that("computeRows behaves like on Matlab", {

View file

@ -1,11 +1,7 @@
context("Auxiliary functions to greedyMix")
# Defining the relative path to current inst -----------------------------------
if (interactive()) {
path_inst <- "../../inst/ext"
} else {
path_inst <- system.file("ext", "", package = "rBAPS")
}
path_inst <- system.file("ext", "", package = "rBAPS")
# Reading datasets -------------------------------------------------------------
baps_diploid <- read.delim(
@ -50,7 +46,6 @@ df_bam <- greedyMix(
data = file.path(path_inst, "bam_example.bam"),
format = "BAM",
)
# TODO #19: add example reading Genpop
test_that("Files are imported correctly", {
expect_equal(dim(df_fasta), c(5, 99))
expect_equal(dim(df_vcf), c(variants = 2, fix_cols = 8, gt_cols = 3))

View file

@ -15,7 +15,7 @@ test_that("Auxiliary functions work properly", {
expect_equal(
getPopDistancesByKL(x2),
list(
Z = matrix(c(c(1, 101:198), c(2:100), rep(0, 99)), nrow = 99, ncol = 3),
Z = matrix(c(c(1, 101:198), 2:100, rep(0, 99)), nrow = 99, ncol = 3),
distances = as.matrix(rep(0, 4950))
)
)
@ -27,7 +27,7 @@ test_that("Auxiliary functions work properly", {
rows = matrix(c(1: 3, 1: 3), 3),
alleleCodes = matrix(c(1, 4, 9, 2, 5, 8), 3),
noalle = matrix(c(3, 3), 1),
adjprior = matrix(rep(3/9, 6), 3),
adjprior = matrix(rep(3 / 9, 6), 3),
priorTerm = 5.9125
)
expect_equal(handlePopData(x3), y3, tol = 1e-4)