diff --git a/tests/testthat/_snaps/ped_to_legdf.md b/tests/testthat/_snaps/ped_to_legdf.md index 217543b..6fb44d1 100644 --- a/tests/testthat/_snaps/ped_to_legdf.md +++ b/tests/testthat/_snaps/ped_to_legdf.md @@ -4,104 +4,104 @@ lst Output $df - id x0 y0 x1 y1 type fill border angle - 1 titles 0.2000000 0 NA NA text black NA - 2 titles 4.4770595 0 NA NA text black NA - 3 titles 9.2009283 0 NA NA text black NA - 4 titles 14.9391751 0 NA NA text black NA - 5 titles 20.6170422 0 NA NA text black NA - 6 sex 0.0000000 2 NA NA square_1_1 white black NA - 7 sex 0.0000000 4 NA NA circle_1_1 white black NA - 8 sex_label 1.2000000 2 NA NA text black NA - 9 sex_label 1.2000000 4 NA NA text black NA - 10 border 4.2770595 2 NA NA square_1_1 white black NA - 11 border 4.2770595 4 NA NA square_1_1 white green NA - 12 border_label 5.4770595 2 NA NA text black NA - 13 border_label 5.4770595 4 NA NA text black NA - 14 aff_bkg_1_0 9.0009283 2 NA NA square_1_1 white black NA - 15 aff_bkg_1_1 9.0009283 4 NA NA square_1_1 white black NA - 16 aff_bkg_1_NA 9.0009283 6 NA NA square_1_1 white black NA - 17 affected_1_0 9.0009283 2 NA NA square_3_1 white black NA - 18 affected_1_1 9.0009283 4 NA NA square_3_1 red black NA - 19 affected_1_NA 9.0009283 6 NA NA square_3_1 grey black NA - 20 affected_label_1_0 10.2009283 2 NA NA text black NA - 21 affected_label_1_1 10.2009283 4 NA NA text black NA - 22 affected_label_1_NA 10.2009283 6 NA NA text black NA - 23 aff_bkg_2_0 14.7391751 2 NA NA square_1_1 white black NA - 24 aff_bkg_2_1 14.7391751 4 NA NA square_1_1 white black NA - 25 affected_2_0 14.7391751 2 NA NA square_3_2 white black NA - 26 affected_2_1 14.7391751 4 NA NA square_3_2 red black NA - 27 affected_label_2_0 15.9391751 2 NA NA text black NA - 28 affected_label_2_1 15.9391751 4 NA NA text black NA - 29 aff_bkg_3_1 20.4170422 2 NA NA square_1_1 white black NA - 30 aff_bkg_3_2 20.4170422 4 NA NA square_1_1 white black NA - 31 aff_bkg_3_3 20.4170422 6 NA NA square_1_1 white black NA - 32 aff_bkg_3_4 20.4170422 8 NA NA square_1_1 white black NA - 33 aff_bkg_3_5 20.4170422 10 NA NA square_1_1 white black NA - 34 aff_bkg_3_6 20.4170422 12 NA NA square_1_1 white black NA - 35 affected_3_1 20.4170422 2 NA NA square_3_3 #FFFFFF black NA - 36 affected_3_2 20.4170422 4 NA NA square_3_3 #9AB1C4 black NA - 37 affected_3_3 20.4170422 6 NA NA square_3_3 #36648B black NA - 38 affected_3_4 20.4170422 8 NA NA square_3_3 #FFC0CB black NA - 39 affected_3_5 20.4170422 10 NA NA square_3_3 #CF70DD black NA - 40 affected_3_6 20.4170422 12 NA NA square_3_3 #A020F0 black NA - 41 affected_label_3_1 21.6170422 2 NA NA text black NA - 42 affected_label_3_2 21.6170422 4 NA NA text black NA - 43 affected_label_3_3 21.6170422 6 NA NA text black NA - 44 affected_label_3_4 21.6170422 8 NA NA text black NA - 45 affected_label_3_5 21.6170422 10 NA NA text black NA - 46 affected_label_3_6 21.6170422 12 NA NA text black NA - 47 max_lim 0.0000000 0 NA NA text black NA - 48 max_lim 27.6912336 12 NA NA text black NA - density cex label tips adjx adjy - 1 NA 1.2 Sex 0 1 - 2 NA 1.2 Border 0 1 - 3 NA 1.2 affection 0 1 - 4 NA 1.2 avail 0 1 - 5 NA 1.2 val_num 0 1 - 6 NA 0.5 NA NA - 7 NA 0.5 NA NA - 8 NA 0.8 Male 0 1 - 9 NA 0.8 Female 0 1 - 10 NA 0.5 NA NA - 11 NA 0.5 NA NA - 12 NA 0.8 Non Available 0 1 - 13 NA 0.8 Available 0 1 - 14 NA 0.5 NA NA - 15 NA 0.5 NA NA - 16 NA 0.5 NA NA - 17 NA 0.5 NA NA - 18 NA 0.5 NA NA - 19 NA 0.5 NA NA - 20 NA 0.8 Healthy <= to 0.5 0 1 - 21 NA 0.8 Affected > to 0.5 0 1 - 22 NA 0.8 NA 0 1 - 23 NA 0.5 NA NA - 24 NA 0.5 NA NA - 25 NA 0.5 NA NA - 26 NA 0.5 NA NA - 27 NA 0.8 Healthy are FALSE 0 1 - 28 NA 0.8 Affected are TRUE 0 1 - 29 NA 0.5 NA NA - 30 NA 0.5 NA NA - 31 NA 0.5 NA NA - 32 NA 0.5 NA NA - 33 NA 0.5 NA NA - 34 NA 0.5 NA NA - 35 NA 0.5 NA NA - 36 NA 0.5 NA NA - 37 NA 0.5 NA NA - 38 NA 0.5 NA NA - 39 NA 0.5 NA NA - 40 NA 0.5 NA NA - 41 NA 0.8 Healthy <= to 115 : [101,106] 0 1 - 42 NA 0.8 Healthy <= to 115 : (106,110] 0 1 - 43 NA 0.8 Healthy <= to 115 : (110,115] 0 1 - 44 NA 0.8 Affected > to 115 : [116,124] 0 1 - 45 NA 0.8 Affected > to 115 : (124,133] 0 1 - 46 NA 0.8 Affected > to 115 : (133,141] 0 1 - 47 NA NA 0 1 - 48 NA NA 0 1 + id x0 y0 x1 y1 type fill border + 1 titles 0.0000000 0.00000000 NA NA text black + 2 titles 2.0692353 0.00000000 NA NA text black + 3 titles 4.1533643 0.00000000 NA NA text black + 4 titles 6.2713058 0.00000000 NA NA text black + 5 titles 8.3872347 0.00000000 NA NA text black + 6 sex 0.0000000 0.83333333 NA NA square_1_1 white black + 7 sex 0.0000000 2.16666667 NA NA circle_1_1 white black + 8 sex_label 1.0000000 1.33333333 NA NA text black + 9 sex_label 1.0000000 2.66666667 NA NA text black + 10 border 2.0692353 0.83333333 NA NA square_1_1 white black + 11 border 2.0692353 2.16666667 NA NA square_1_1 white green + 12 border_label 3.0692353 1.33333333 NA NA text black + 13 border_label 3.0692353 2.66666667 NA NA text black + 14 aff_bkg_1_0 4.1533643 0.83333333 NA NA square_1_1 white black + 15 aff_bkg_1_1 4.1533643 2.16666667 NA NA square_1_1 white black + 16 aff_bkg_1_NA 4.1533643 3.50000000 NA NA square_1_1 white black + 17 affected_1_0 4.1533643 0.83333333 NA NA square_3_1 white black + 18 affected_1_1 4.1533643 2.16666667 NA NA square_3_1 red black + 19 affected_1_NA 4.1533643 3.50000000 NA NA square_3_1 grey black + 20 affected_label_1_0 5.1533643 1.33333333 NA NA text black + 21 affected_label_1_1 5.1533643 2.66666667 NA NA text black + 22 affected_label_1_NA 5.1533643 4.00000000 NA NA text black + 23 aff_bkg_2_0 6.2713058 0.83333333 NA NA square_1_1 white black + 24 aff_bkg_2_1 6.2713058 2.16666667 NA NA square_1_1 white black + 25 affected_2_0 6.2713058 0.83333333 NA NA square_3_2 white black + 26 affected_2_1 6.2713058 2.16666667 NA NA square_3_2 red black + 27 affected_label_2_0 7.2713058 1.33333333 NA NA text black + 28 affected_label_2_1 7.2713058 2.66666667 NA NA text black + 29 aff_bkg_3_1 8.3872347 0.83333333 NA NA square_1_1 white black + 30 aff_bkg_3_2 8.3872347 2.16666667 NA NA square_1_1 white black + 31 aff_bkg_3_3 8.3872347 3.50000000 NA NA square_1_1 white black + 32 aff_bkg_3_4 8.3872347 4.83333333 NA NA square_1_1 white black + 33 aff_bkg_3_5 8.3872347 6.16666667 NA NA square_1_1 white black + 34 aff_bkg_3_6 8.3872347 7.50000000 NA NA square_1_1 white black + 35 affected_3_1 8.3872347 0.83333333 NA NA square_3_3 #FFFFFF black + 36 affected_3_2 8.3872347 2.16666667 NA NA square_3_3 #9AB1C4 black + 37 affected_3_3 8.3872347 3.50000000 NA NA square_3_3 #36648B black + 38 affected_3_4 8.3872347 4.83333333 NA NA square_3_3 #FFC0CB black + 39 affected_3_5 8.3872347 6.16666667 NA NA square_3_3 #CF70DD black + 40 affected_3_6 8.3872347 7.50000000 NA NA square_3_3 #A020F0 black + 41 affected_label_3_1 9.3872347 1.33333333 NA NA text black + 42 affected_label_3_2 9.3872347 2.66666667 NA NA text black + 43 affected_label_3_3 9.3872347 4.00000000 NA NA text black + 44 affected_label_3_4 9.3872347 5.33333333 NA NA text black + 45 affected_label_3_5 9.3872347 6.66666667 NA NA text black + 46 affected_label_3_6 9.3872347 8.00000000 NA NA text black + 47 max_lim 0.0000000 0.00000000 NA NA text black + 48 max_lim 8.3872347 8.00000000 NA NA text black + angle density cex label tips adjx adjy + 1 NA NA 1.2 Sex 0 1 + 2 NA NA 1.2 Border 0 1 + 3 NA NA 1.2 affection 0 1 + 4 NA NA 1.2 avail 0 1 + 5 NA NA 1.2 val_num 0 1 + 6 NA NA 0.5 NA NA + 7 NA NA 0.5 NA NA + 8 NA NA 0.8 Male 0 1 + 9 NA NA 0.8 Female 0 1 + 10 NA NA 0.5 NA NA + 11 NA NA 0.5 NA NA + 12 NA NA 0.8 Non Available 0 1 + 13 NA NA 0.8 Available 0 1 + 14 NA NA 0.5 NA NA + 15 NA NA 0.5 NA NA + 16 NA NA 0.5 NA NA + 17 NA NA 0.5 NA NA + 18 NA NA 0.5 NA NA + 19 NA NA 0.5 NA NA + 20 NA NA 0.8 Healthy <= to 0.5 0 1 + 21 NA NA 0.8 Affected > to 0.5 0 1 + 22 NA NA 0.8 NA 0 1 + 23 NA NA 0.5 NA NA + 24 NA NA 0.5 NA NA + 25 NA NA 0.5 NA NA + 26 NA NA 0.5 NA NA + 27 NA NA 0.8 Healthy are FALSE 0 1 + 28 NA NA 0.8 Affected are TRUE 0 1 + 29 NA NA 0.5 NA NA + 30 NA NA 0.5 NA NA + 31 NA NA 0.5 NA NA + 32 NA NA 0.5 NA NA + 33 NA NA 0.5 NA NA + 34 NA NA 0.5 NA NA + 35 NA NA 0.5 NA NA + 36 NA NA 0.5 NA NA + 37 NA NA 0.5 NA NA + 38 NA NA 0.5 NA NA + 39 NA NA 0.5 NA NA + 40 NA NA 0.5 NA NA + 41 NA NA 0.8 Healthy <= to 115 : [101,106] 0 1 + 42 NA NA 0.8 Healthy <= to 115 : (106,110] 0 1 + 43 NA NA 0.8 Healthy <= to 115 : (110,115] 0 1 + 44 NA NA 0.8 Affected > to 115 : [116,124] 0 1 + 45 NA NA 0.8 Affected > to 115 : (124,133] 0 1 + 46 NA NA 0.8 Affected > to 115 : (133,141] 0 1 + 47 NA NA NA 0 1 + 48 NA NA NA 0 1 $par_usr $par_usr$boxh @@ -114,7 +114,7 @@ [1] 0.8 $par_usr$usr - [1] 0.000000 27.691234 0.000000 12.000000 + [1] 0.0000000 9.3872347 0.0000000 8.0000000 diff --git a/tests/testthat/_snaps/ped_to_legdf/legend-alone.svg b/tests/testthat/_snaps/ped_to_legdf/legend-alone.svg index 3433d0e..389bb8d 100644 --- a/tests/testthat/_snaps/ped_to_legdf/legend-alone.svg +++ b/tests/testthat/_snaps/ped_to_legdf/legend-alone.svg @@ -25,51 +25,51 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - -Sex -Border -affection -avail -val_num -Male -Female -Non Available -Available -Healthy <= to 0.5 -Affected > to 0.5 -NA -Healthy are FALSE -Affected are TRUE -Healthy <= to 115 : [101,106] -Healthy <= to 115 : (106,110] -Healthy <= to 115 : (110,115] -Affected > to 115 : [116,124] -Affected > to 115 : (124,133] -Affected > to 115 : (133,141] + + + + + + + + + + + + + + + + + + + + + + + + + + +Sex +Border +affection +avail +val_num +Male +Female +Non Available +Available +Healthy <= to 0.5 +Affected > to 0.5 +NA +Healthy are FALSE +Affected are TRUE +Healthy <= to 115 : [101,106] +Healthy <= to 115 : (106,110] +Healthy <= to 115 : (110,115] +Affected > to 115 : [116,124] +Affected > to 115 : (124,133] +Affected > to 115 : (133,141] diff --git a/tests/testthat/_snaps/ped_to_legdf/plot-with-legend.svg b/tests/testthat/_snaps/ped_to_legdf/plot-with-legend.svg index 3b21628..7f46e32 100644 --- a/tests/testthat/_snaps/ped_to_legdf/plot-with-legend.svg +++ b/tests/testthat/_snaps/ped_to_legdf/plot-with-legend.svg @@ -18,305 +18,322 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -1_135 -1_101 -1_109 -1_121 -1_136 -1_102 -1_110 -1_122 -1_103 -1_111 -1_123 -1_104 -1_112 -1_124 -1_137 -1_114 -1_127 -1_138 -1_139 -1_128 -1_105 -1_140 -1_125 -1_106 -1_141 -1_126 -1_107 -1_114 -1_129 -1_108 -1_115 -1_130 -1_112 -1_131 -1_118 -1_132 -1_117 -1_133 -1_116 -1_134 -1_119 -1_120 - - - - - - - - - - - - - - - - - - - - - - - - - - -Sex -Border -affection -avail -val_num -Male -Female -Non Available -Available -Healthy <= to 0.5 -Affected > to 0.5 -NA -Healthy are FALSE -Affected are TRUE -Healthy <= to 115 : [101,106] -Healthy <= to 115 : (106,110] -Healthy <= to 115 : (110,115] -Affected > to 115 : [116,124] -Affected > to 115 : (124,133] -Affected > to 115 : (133,141] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +1_135 +1_101 +1_109 +1_121 +1_136 +1_102 +1_110 +1_122 +1_103 +1_111 +1_123 +1_104 +1_112 +1_124 +1_137 +1_114 +1_127 +1_138 +1_139 +1_128 +1_105 +1_140 +1_125 +1_106 +1_141 +1_126 +1_107 +1_114 +1_129 +1_108 +1_115 +1_130 +1_112 +1_131 +1_118 +1_132 +1_117 +1_133 +1_116 +1_134 +1_119 +1_120 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Sex +Border +affection +avail +val_num +Male +Female +Non Available +Available +Healthy <= to 0.5 +Affected > to 0.5 +NA +Healthy are FALSE +Affected are TRUE +Healthy <= to 115 : [101,106] +Healthy <= to 115 : (106,110] +Healthy <= to 115 : (110,115] +Affected > to 115 : [116,124] +Affected > to 115 : (124,133] +Affected > to 115 : (133,141] diff --git a/tests/testthat/_snaps/windows-4.4/app/ped_shiny-001-Ped_F2_K3_T_IAll_SF1.png b/tests/testthat/_snaps/windows-4.4/app/ped_shiny-001-Ped_F2_K3_T_IAll_SF1.png new file mode 100644 index 0000000..d4ddfa4 Binary files /dev/null and b/tests/testthat/_snaps/windows-4.4/app/ped_shiny-001-Ped_F2_K3_T_IAll_SF1.png differ diff --git a/tests/testthat/_snaps/windows-4.4/app/ped_shiny-002-Ped_F1_K2_I1_121-1_131_SF2.csv b/tests/testthat/_snaps/windows-4.4/app/ped_shiny-002-Ped_F1_K2_I1_121-1_131_SF2.csv new file mode 100644 index 0000000..0480d34 --- /dev/null +++ b/tests/testthat/_snaps/windows-4.4/app/ped_shiny-002-Ped_F1_K2_I1_121-1_131_SF2.csv @@ -0,0 +1,10 @@ +"";"id";"dadid";"momid";"sex";"famid";"steril";"status";"avail";"affected";"useful";"kin";"isinf";"num_child_tot";"num_child_dir";"num_child_ind";"family";"indId";"fatherId";"motherId";"gender";"affection";"available";"num";"error";"sterilisation";"vitalStatus";"affection_mods";"avail_mods" +"2_105";"2_105";NA;NA;"male";"2";NA;NA;FALSE;NA;TRUE;3;FALSE;1;1;0;"1";"105";NA;NA;1;NA;0;6;NA;NA;NA;NA;0 +"2_106";"2_106";NA;NA;"female";"2";NA;NA;FALSE;NA;TRUE;3;FALSE;1;1;0;"1";"106";NA;NA;2;NA;0;1;NA;NA;NA;NA;0 +"2_119";"2_119";"2_105";"2_106";"male";"2";NA;NA;TRUE;TRUE;TRUE;2;FALSE;5;5;0;"1";"119";"105";"106";1;1;1;6;NA;NA;NA;1;1 +"2_120";"2_120";NA;NA;"female";"2";NA;NA;FALSE;FALSE;TRUE;2;FALSE;5;5;0;"1";"120";"107";"108";2;0;0;2;NA;NA;NA;0;0 +"2_130";"2_130";"2_119";"2_120";"male";"2";NA;NA;TRUE;FALSE;TRUE;2;FALSE;0;0;0;"1";"130";"119";"120";1;0;1;3;NA;NA;NA;0;1 +"2_131";"2_131";"2_119";"2_120";"male";"2";NA;NA;FALSE;TRUE;TRUE;1;TRUE;0;0;0;"1";"131";"119";"120";1;1;0;1;NA;NA;NA;1;0 +"2_132";"2_132";"2_119";"2_120";"male";"2";NA;NA;FALSE;FALSE;TRUE;2;FALSE;0;0;0;"1";"132";"119";"120";1;0;0;0;NA;NA;NA;0;0 +"2_133";"2_133";"2_119";"2_120";"female";"2";NA;NA;TRUE;FALSE;TRUE;2;FALSE;0;0;0;"1";"133";"119";"120";2;0;1;2;NA;NA;NA;0;1 +"2_134";"2_134";"2_119";"2_120";"female";"2";NA;NA;FALSE;TRUE;TRUE;2;FALSE;0;0;0;"1";"134";"119";"120";2;1;0;4;NA;NA;NA;1;0 diff --git a/tests/testthat/test-ped_to_legdf.R b/tests/testthat/test-ped_to_legdf.R index 2c51d37..0a8c017 100644 --- a/tests/testthat/test-ped_to_legdf.R +++ b/tests/testthat/test-ped_to_legdf.R @@ -37,8 +37,8 @@ test_that("Pedigree legend works", { vdiffr::expect_doppelganger("Legend alone", function() { suppressWarnings(plot_legend( - ped, boxh = 0.07, boxw = 0.07, cex = 0.8, - leg_loc = c(0, 1.2, 0, 0.9), adjx = 0.5, adjy = 0.04 + ped, boxh = 0.07, boxw = 0.07, cex = 0.7, + leg_loc = c(0, 0.9, 0, 0.9), adjx = 0, adjy = 0 )) } ) @@ -48,8 +48,10 @@ test_that("Pedigree legend works", { suppressWarnings(plot( ped[!is.na(famid(ped(ped)))], cex = 0.8, symbolsize = 1.5, aff_mark = FALSE, - legend = TRUE, leg_cex = 0.6, leg_symbolsize = 0.4, - leg_loc = c(7, 16, 1, 1.8) + legend = TRUE, leg_cex = 0.8, leg_symbolsize = 0.01, + leg_loc = c(0, 0.8, 0, 0.25), + ped_par = list(oma = c(12, 1, 1, 1), mar = rep(0, 4)), + leg_par = list(oma = c(1, 1, 1, 1), mar = rep(0, 4)) )) } )