From e8509246ab5880eef7d061677f02a9071cd2d91b Mon Sep 17 00:00:00 2001 From: Zhian Kamvar Date: Tue, 7 Jul 2015 20:36:29 -0700 Subject: [PATCH] Added needed tests for MSNs and misc tests Also, the case change is back, so of course all of the man pages are changed again. --- DESCRIPTION | 2 +- man/Aeut.Rd | 2 +- man/Pinf.Rd | 2 +- man/Pram.Rd | 2 +- man/bitwise.IA.Rd | 2 +- man/bitwise.dist.Rd | 2 +- man/bootgen-class.Rd | 2 +- man/bootgen-methods.Rd | 2 +- man/bruvo.boot.Rd | 2 +- man/bruvo.dist.Rd | 2 +- man/bruvo.msn.Rd | 2 +- man/bruvomat-class.Rd | 2 +- man/bruvomat-methods.Rd | 2 +- man/clonecorrect.Rd | 2 +- man/coercion-methods.Rd | 2 +- man/diss.dist.Rd | 2 +- man/fix_replen.Rd | 2 +- man/genclone-class.Rd | 2 +- man/genclone-method.Rd | 2 +- man/genetic_distance.Rd | 2 +- man/genind2genalex.Rd | 2 +- man/genotype_curve.Rd | 2 +- man/getfile.Rd | 2 +- man/greycurve.Rd | 2 +- man/ia.Rd | 2 +- man/info_table.Rd | 2 +- man/informloci.Rd | 2 +- man/is.clone.Rd | 2 +- man/locus_table.Rd | 2 +- man/missingno.Rd | 2 +- man/mlg.Rd | 2 +- man/mlg.filter.Rd | 2 +- man/mll-method.Rd | 2 +- man/mll.custom.Rd | 2 +- man/mll.reset-method.Rd | 2 +- man/monpop.Rd | 2 +- man/old2new_genclone.Rd | 2 +- man/partial_clone.Rd | 2 +- man/plot_poppr_msn.Rd | 2 +- man/poppr.Rd | 2 +- man/poppr.all.Rd | 2 +- man/poppr.amova.Rd | 2 +- man/poppr.msn.Rd | 2 +- man/poppr_has_parallel.Rd | 2 +- man/popsub.Rd | 2 +- man/private_alleles.Rd | 2 +- man/read.genalex.Rd | 2 +- man/recode_polyploids.Rd | 2 +- man/samp.ia.Rd | 2 +- man/shufflepop.Rd | 2 +- man/snpclone-class.Rd | 2 +- man/snpclone-coercion-methods.Rd | 2 +- man/snpclone-method.Rd | 2 +- man/test_replen.Rd | 2 +- man/win.ia.Rd | 2 +- tests/testthat/test-msn.R | 58 ++++++++++++++++++++++++++++++++ tests/testthat/test-plots.R | 7 ++++ tests/testthat/test-values.R | 9 +++++ 58 files changed, 129 insertions(+), 55 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 06bb041d..172e9154 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: poppr Type: Package Title: Genetic Analysis of Populations with Mixed Reproduction -Version: 1.1.5.99-686 +Version: 1.1.5.99-690 Date: 2015-07-07 Authors@R: c(person(c("Zhian", "N."), "Kamvar", role = c("cre", "aut"), email = "kamvarz@science.oregonstate.edu"), diff --git a/man/Aeut.Rd b/man/Aeut.Rd index 68876791..ccc83e91 100644 --- a/man/Aeut.Rd +++ b/man/Aeut.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/internal.R +% Please edit documentation in R/internal.r \docType{data} \name{Aeut} \alias{Aeut} diff --git a/man/Pinf.Rd b/man/Pinf.Rd index adc9fd67..1ceacd55 100644 --- a/man/Pinf.Rd +++ b/man/Pinf.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/internal.R +% Please edit documentation in R/internal.r \docType{data} \name{Pinf} \alias{Pinf} diff --git a/man/Pram.Rd b/man/Pram.Rd index 21d36be5..f0ec55d1 100644 --- a/man/Pram.Rd +++ b/man/Pram.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/internal.R +% Please edit documentation in R/internal.r \docType{data} \name{Pram} \alias{Pram} diff --git a/man/bitwise.IA.Rd b/man/bitwise.IA.Rd index 2bee5443..b47c2bd9 100644 --- a/man/bitwise.IA.Rd +++ b/man/bitwise.IA.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/bitwise.R +% Please edit documentation in R/bitwise.r \name{bitwise.IA} \alias{bitwise.IA} \title{Calculate the index of association between samples in a genlight object.} diff --git a/man/bitwise.dist.Rd b/man/bitwise.dist.Rd index c4a18c9d..b63f9b15 100644 --- a/man/bitwise.dist.Rd +++ b/man/bitwise.dist.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/bitwise.R +% Please edit documentation in R/bitwise.r \name{bitwise.dist} \alias{bitwise.dist} \title{Calculate a distance matrix comparing samples based on the number of alleles diff --git a/man/bootgen-class.Rd b/man/bootgen-class.Rd index 78c2776a..8d103d98 100644 --- a/man/bootgen-class.Rd +++ b/man/bootgen-class.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/classes.R +% Please edit documentation in R/classes.r \docType{class} \name{bootgen-class} \alias{bootgen-class} diff --git a/man/bootgen-methods.Rd b/man/bootgen-methods.Rd index 8c9a91ca..37909b03 100644 --- a/man/bootgen-methods.Rd +++ b/man/bootgen-methods.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/methods.R +% Please edit documentation in R/methods.r \docType{methods} \name{[,bootgen,ANY,ANY,ANY-method} \alias{$,bootgen-method} diff --git a/man/bruvo.boot.Rd b/man/bruvo.boot.Rd index c164f496..6942744c 100755 --- a/man/bruvo.boot.Rd +++ b/man/bruvo.boot.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/bruvo.R +% Please edit documentation in R/bruvo.r \name{bruvo.boot} \alias{bruvo.boot} \title{Create a tree using Bruvo's Distance with non-parametric bootstrapping.} diff --git a/man/bruvo.dist.Rd b/man/bruvo.dist.Rd index d0c84bc2..0cb32830 100755 --- a/man/bruvo.dist.Rd +++ b/man/bruvo.dist.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/bruvo.R +% Please edit documentation in R/bruvo.r \name{bruvo.dist} \alias{bruvo.dist} \title{Bruvo's distance for microsatellites} diff --git a/man/bruvo.msn.Rd b/man/bruvo.msn.Rd index 1f201ef7..20b22bbc 100644 --- a/man/bruvo.msn.Rd +++ b/man/bruvo.msn.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/bruvo.R +% Please edit documentation in R/bruvo.r \name{bruvo.msn} \alias{bruvo.msn} \alias{msn.bruvo} diff --git a/man/bruvomat-class.Rd b/man/bruvomat-class.Rd index 50ec45a7..d4d7e8f9 100644 --- a/man/bruvomat-class.Rd +++ b/man/bruvomat-class.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/classes.R +% Please edit documentation in R/classes.r \docType{class} \name{bruvomat-class} \alias{bruvomat-class} diff --git a/man/bruvomat-methods.Rd b/man/bruvomat-methods.Rd index afa151a3..f24bee51 100644 --- a/man/bruvomat-methods.Rd +++ b/man/bruvomat-methods.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/methods.R +% Please edit documentation in R/methods.r \docType{methods} \name{initialize,bruvomat-method} \alias{[,bruvomat,ANY,ANY,ANY-method} diff --git a/man/clonecorrect.Rd b/man/clonecorrect.Rd index 2cfb4319..af8dd10c 100755 --- a/man/clonecorrect.Rd +++ b/man/clonecorrect.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/data_subset.R +% Please edit documentation in R/data_subset.r \name{clonecorrect} \alias{clonecorrect} \title{Remove potential bias caused by cloned genotypes in genind or genclone diff --git a/man/coercion-methods.Rd b/man/coercion-methods.Rd index b4164c6f..25812ad8 100644 --- a/man/coercion-methods.Rd +++ b/man/coercion-methods.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/methods.R +% Please edit documentation in R/methods.r \docType{methods} \name{as.genclone} \alias{as.genclone} diff --git a/man/diss.dist.Rd b/man/diss.dist.Rd index 8273969c..df659964 100644 --- a/man/diss.dist.Rd +++ b/man/diss.dist.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/distances.R +% Please edit documentation in R/distances.r \name{diss.dist} \alias{diss.dist} \title{Calculate a distance matrix based on relative dissimilarity} diff --git a/man/fix_replen.Rd b/man/fix_replen.Rd index 7c26bbd6..406a5c01 100644 --- a/man/fix_replen.Rd +++ b/man/fix_replen.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/bruvo.R +% Please edit documentation in R/bruvo.r \name{fix_replen} \alias{fix_replen} \title{Find and fix inconsistent repeat lengths} diff --git a/man/genclone-class.Rd b/man/genclone-class.Rd index 4eeef0d9..d8eea49a 100644 --- a/man/genclone-class.Rd +++ b/man/genclone-class.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/classes.R +% Please edit documentation in R/classes.r \docType{class} \name{genclone-class} \alias{genclone} diff --git a/man/genclone-method.Rd b/man/genclone-method.Rd index 20358650..c967b94a 100644 --- a/man/genclone-method.Rd +++ b/man/genclone-method.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/methods.R +% Please edit documentation in R/methods.r \docType{methods} \name{initialize,genclone-method} \alias{[,genclone,ANY,ANY,ANY-method} diff --git a/man/genetic_distance.Rd b/man/genetic_distance.Rd index 6ec9718c..57fc257e 100644 --- a/man/genetic_distance.Rd +++ b/man/genetic_distance.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/distances.R +% Please edit documentation in R/distances.r \name{nei.dist} \alias{edwards.dist} \alias{nei.dist} diff --git a/man/genind2genalex.Rd b/man/genind2genalex.Rd index cc300686..2b0cd2cd 100755 --- a/man/genind2genalex.Rd +++ b/man/genind2genalex.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/file_handling.R +% Please edit documentation in R/file_handling.r \name{genind2genalex} \alias{genind2genalex} \title{Exporting data from genind objects to genalex formatted *.csv files.} diff --git a/man/genotype_curve.Rd b/man/genotype_curve.Rd index 49ef4852..7279219a 100644 --- a/man/genotype_curve.Rd +++ b/man/genotype_curve.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/visualizations.R +% Please edit documentation in R/visualizations.r \name{genotype_curve} \alias{genotype_curve} \title{Produce a genotype accumulation curve} diff --git a/man/getfile.Rd b/man/getfile.Rd index 687d1963..448ec894 100755 --- a/man/getfile.Rd +++ b/man/getfile.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/file_handling.R +% Please edit documentation in R/file_handling.r \name{getfile} \alias{getfile} \title{Get a file name and path and store them in a list.} diff --git a/man/greycurve.Rd b/man/greycurve.Rd index e10e594c..296940f6 100644 --- a/man/greycurve.Rd +++ b/man/greycurve.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/visualizations.R +% Please edit documentation in R/visualizations.r \name{greycurve} \alias{greycurve} \title{Display a greyscale gradient adjusted to specific parameters} diff --git a/man/ia.Rd b/man/ia.Rd index b854da93..806c7f2a 100755 --- a/man/ia.Rd +++ b/man/ia.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/Index_calculations.R +% Please edit documentation in R/Index_calculations.r \name{ia} \alias{ia} \alias{pair.ia} diff --git a/man/info_table.Rd b/man/info_table.Rd index 75033ddb..4ec4d5d7 100644 --- a/man/info_table.Rd +++ b/man/info_table.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/visualizations.R +% Please edit documentation in R/visualizations.r \name{info_table} \alias{info_table} \title{Create a table summarizing missing data or ploidy information of a genind or diff --git a/man/informloci.Rd b/man/informloci.Rd index fcfe0efb..349e7eed 100644 --- a/man/informloci.Rd +++ b/man/informloci.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/data_subset.R +% Please edit documentation in R/data_subset.r \name{informloci} \alias{informloci} \title{Remove all non-phylogentically informative loci} diff --git a/man/is.clone.Rd b/man/is.clone.Rd index 8ff2698a..46b9c162 100644 --- a/man/is.clone.Rd +++ b/man/is.clone.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/methods.R +% Please edit documentation in R/methods.r \name{is.snpclone} \alias{is.clone} \alias{is.genclone} diff --git a/man/locus_table.Rd b/man/locus_table.Rd index ffd2eddf..01018ffe 100644 --- a/man/locus_table.Rd +++ b/man/locus_table.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/Index_calculations.R +% Please edit documentation in R/Index_calculations.r \name{locus_table} \alias{locus_table} \title{Create a table of summary statistics per locus.} diff --git a/man/missingno.Rd b/man/missingno.Rd index 7e3dd763..96cf3736 100755 --- a/man/missingno.Rd +++ b/man/missingno.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/data_subset.R +% Please edit documentation in R/data_subset.r \name{missingno} \alias{missingno} \title{How to deal with missing data in a genind object.} diff --git a/man/mlg.Rd b/man/mlg.Rd index 1f026838..fb9d9ae9 100755 --- a/man/mlg.Rd +++ b/man/mlg.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/mlg.R +% Please edit documentation in R/mlg.r \name{mlg} \alias{mlg} \alias{mlg.crosspop} diff --git a/man/mlg.filter.Rd b/man/mlg.filter.Rd index 467df001..3240fcd2 100644 --- a/man/mlg.filter.Rd +++ b/man/mlg.filter.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/methods.R +% Please edit documentation in R/methods.r \docType{methods} \name{mlg.filter} \alias{mlg.filter} diff --git a/man/mll-method.Rd b/man/mll-method.Rd index ed0c544a..85c0dbca 100644 --- a/man/mll-method.Rd +++ b/man/mll-method.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/methods.R +% Please edit documentation in R/methods.r \docType{methods} \name{mll} \alias{mll} diff --git a/man/mll.custom.Rd b/man/mll.custom.Rd index b25d409c..2f36a0f8 100644 --- a/man/mll.custom.Rd +++ b/man/mll.custom.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/methods.R +% Please edit documentation in R/methods.r \docType{methods} \name{mll.custom} \alias{mll.custom} diff --git a/man/mll.reset-method.Rd b/man/mll.reset-method.Rd index 75582f5a..c4c5e5e1 100644 --- a/man/mll.reset-method.Rd +++ b/man/mll.reset-method.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/methods.R +% Please edit documentation in R/methods.r \docType{methods} \name{mll.reset} \alias{mll.reset} diff --git a/man/monpop.Rd b/man/monpop.Rd index f9d05d18..d9389e39 100644 --- a/man/monpop.Rd +++ b/man/monpop.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/internal.R +% Please edit documentation in R/internal.r \docType{data} \name{monpop} \alias{monpop} diff --git a/man/old2new_genclone.Rd b/man/old2new_genclone.Rd index 6da53d9c..dfeef61a 100644 --- a/man/old2new_genclone.Rd +++ b/man/old2new_genclone.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/methods.R +% Please edit documentation in R/methods.r \name{old2new_genclone} \alias{old2new_genclone} \title{Convert an old genclone object to a new genclone object} diff --git a/man/partial_clone.Rd b/man/partial_clone.Rd index b3b9f702..b44d4674 100644 --- a/man/partial_clone.Rd +++ b/man/partial_clone.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/internal.R +% Please edit documentation in R/internal.r \docType{data} \name{partial_clone} \alias{old_partial_clone} diff --git a/man/plot_poppr_msn.Rd b/man/plot_poppr_msn.Rd index 39e0cf86..0de164a0 100644 --- a/man/plot_poppr_msn.Rd +++ b/man/plot_poppr_msn.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/visualizations.R +% Please edit documentation in R/visualizations.r \name{plot_poppr_msn} \alias{plot_poppr_msn} \title{Plot minimum spanning networks produced in poppr.} diff --git a/man/poppr.Rd b/man/poppr.Rd index 58e0c595..25b2dbae 100755 --- a/man/poppr.Rd +++ b/man/poppr.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/Index_calculations.R +% Please edit documentation in R/Index_calculations.r \name{poppr} \alias{poppr} \title{Produce a basic summary table for population genetic analyses.} diff --git a/man/poppr.all.Rd b/man/poppr.all.Rd index 92d6d7ff..09589c59 100755 --- a/man/poppr.all.Rd +++ b/man/poppr.all.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/Index_calculations.R +% Please edit documentation in R/Index_calculations.r \name{poppr.all} \alias{poppr.all} \title{Process a list of files with poppr} diff --git a/man/poppr.amova.Rd b/man/poppr.amova.Rd index 6433fb6c..45abbc59 100644 --- a/man/poppr.amova.Rd +++ b/man/poppr.amova.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/amova.R +% Please edit documentation in R/amova.r \name{poppr.amova} \alias{amova} \alias{poppr.amova} diff --git a/man/poppr.msn.Rd b/man/poppr.msn.Rd index 5a73db03..28001fe7 100644 --- a/man/poppr.msn.Rd +++ b/man/poppr.msn.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/visualizations.R +% Please edit documentation in R/visualizations.r \name{poppr.msn} \alias{msn.poppr} \alias{poppr.msn} diff --git a/man/poppr_has_parallel.Rd b/man/poppr_has_parallel.Rd index 03da8e21..a75de4cc 100644 --- a/man/poppr_has_parallel.Rd +++ b/man/poppr_has_parallel.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/bitwise.R +% Please edit documentation in R/bitwise.r \name{poppr_has_parallel} \alias{poppr_has_parallel} \title{Determines whether openMP is support on this system.} diff --git a/man/popsub.Rd b/man/popsub.Rd index 7f957034..7c4653c5 100755 --- a/man/popsub.Rd +++ b/man/popsub.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/data_subset.R +% Please edit documentation in R/data_subset.r \name{popsub} \alias{popsub} \title{Subset a \code{\linkS4class{genclone}} or \code{\linkS4class{genind}} object by population} diff --git a/man/private_alleles.Rd b/man/private_alleles.Rd index dee5fef2..242098d0 100644 --- a/man/private_alleles.Rd +++ b/man/private_alleles.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/Index_calculations.R +% Please edit documentation in R/Index_calculations.r \name{private_alleles} \alias{private_alleles} \title{Tabulate alleles the occur in only one population.} diff --git a/man/read.genalex.Rd b/man/read.genalex.Rd index 791fa56f..807383c2 100755 --- a/man/read.genalex.Rd +++ b/man/read.genalex.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/file_handling.R +% Please edit documentation in R/file_handling.r \name{read.genalex} \alias{read.genalex} \title{Importing data from genalex formatted *.csv files.} diff --git a/man/recode_polyploids.Rd b/man/recode_polyploids.Rd index ed7aac62..7504dab8 100644 --- a/man/recode_polyploids.Rd +++ b/man/recode_polyploids.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/data_subset.R +% Please edit documentation in R/data_subset.r \name{recode_polyploids} \alias{recode_polyploids} \title{Recode polyploid microsatellite data for use in frequency based statistics.} diff --git a/man/samp.ia.Rd b/man/samp.ia.Rd index fa595977..8edcf4d3 100644 --- a/man/samp.ia.Rd +++ b/man/samp.ia.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/bitwise.R +% Please edit documentation in R/bitwise.r \name{samp.ia} \alias{samp.ia} \title{Calculate random samples of the index of association for genlight objects.} diff --git a/man/shufflepop.Rd b/man/shufflepop.Rd index 40b373ad..34e8c5e0 100755 --- a/man/shufflepop.Rd +++ b/man/shufflepop.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/sample_schemes.R +% Please edit documentation in R/sample_schemes.r \name{shufflepop} \alias{shufflepop} \title{Shuffle individuals in a \code{\linkS4class{genclone}} or diff --git a/man/snpclone-class.Rd b/man/snpclone-class.Rd index fb1f06b6..edd186ae 100644 --- a/man/snpclone-class.Rd +++ b/man/snpclone-class.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/classes.R +% Please edit documentation in R/classes.r \docType{class} \name{snpclone-class} \alias{snpclone} diff --git a/man/snpclone-coercion-methods.Rd b/man/snpclone-coercion-methods.Rd index 2ec3e2f0..f71ee7e0 100644 --- a/man/snpclone-coercion-methods.Rd +++ b/man/snpclone-coercion-methods.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/methods.R +% Please edit documentation in R/methods.r \docType{methods} \name{as.snpclone} \alias{as.snpclone} diff --git a/man/snpclone-method.Rd b/man/snpclone-method.Rd index c7cb3329..ad4895bc 100644 --- a/man/snpclone-method.Rd +++ b/man/snpclone-method.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/methods.R +% Please edit documentation in R/methods.r \docType{methods} \name{[,snpclone,ANY,ANY,ANY-method} \alias{[,snpclone,ANY,ANY,ANY-method} diff --git a/man/test_replen.Rd b/man/test_replen.Rd index 1695f6e4..4b4d3a7e 100644 --- a/man/test_replen.Rd +++ b/man/test_replen.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/bruvo.R +% Please edit documentation in R/bruvo.r \name{test_replen} \alias{test_replen} \title{Test repeat length consistency.} diff --git a/man/win.ia.Rd b/man/win.ia.Rd index 4335e778..d12d2a5f 100644 --- a/man/win.ia.Rd +++ b/man/win.ia.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/bitwise.R +% Please edit documentation in R/bitwise.r \name{win.ia} \alias{win.ia} \title{Calculate windows of the index of association for genlight objects.} diff --git a/tests/testthat/test-msn.R b/tests/testthat/test-msn.R index f23a4b58..f63e072f 100644 --- a/tests/testthat/test-msn.R +++ b/tests/testthat/test-msn.R @@ -143,9 +143,67 @@ test_that("Minimum spanning networks can properly account for tied edges", { }) +test_that("Minimum spanning networks also collapse MLGs", { + skip_on_cran() + gend <- as.genclone(gend) + gend_single <- as.genclone(gend_single) + gend_bruvo <- bruvo.dist(gend, replen = c(1, 1)) + + gmsnt <- bruvo.msn(gend, replen = c(1, 1), threshold = 0.15) + pgmsnt <- poppr.msn(gend, distmat = gend_bruvo, threshold = 0.15) + + expect_identical(igraph::V(gmsnt$graph)$pie, igraph::V(pgmsnt$graph)$pie) + expect_identical(igraph::E(gmsnt$graph)$weight, igraph::E(pgmsnt$graph)$weight) + + gmsn <- bruvo.msn(gend, replen = c(1, 1), showplot = FALSE) + pgmsn <- poppr.msn(gend, distmat = gend_bruvo, showplot = FALSE) + + expect_identical(igraph::V(gmsn$graph)$pie, igraph::V(pgmsn$graph)$pie) + expect_identical(igraph::E(gmsn$graph)$weight, igraph::E(pgmsn$graph)$weight) + + expect_equal(length(igraph::V(gmsnt$graph)), 2) + expect_equal(length(igraph::V(gmsn$graph)), 4) + + sgmsnt <- bruvo.msn(gend_single, replen = c(1, 1), threshold = 0.15) + psgmsnt <- poppr.msn(gend_single, distmat = gend_bruvo, threshold = 0.15) + + expect_identical(igraph::V(sgmsnt$graph)$pie, igraph::V(psgmsnt$graph)$pie) + expect_identical(igraph::E(sgmsnt$graph)$weight, igraph::E(psgmsnt$graph)$weight) + + sgmsn <- bruvo.msn(gend_single, replen = c(1, 1), showplot = FALSE) + psgmsn <- poppr.msn(gend_single, distmat = gend_bruvo, showplot = FALSE) + + expect_identical(igraph::V(sgmsn$graph)$pie, igraph::V(psgmsn$graph)$pie) + expect_identical(igraph::E(sgmsn$graph)$weight, igraph::E(psgmsn$graph)$weight) + + expect_equal(length(igraph::V(sgmsnt$graph)), 2) + expect_equal(length(igraph::V(sgmsn$graph)), 4) + + expect_output(plot_poppr_msn(gend, gmsnt, palette = "cm.colors"), "") + expect_output(plot_poppr_msn(gend_single, sgmsnt, palette = "cm.colors"), "") +}) + data("partial_clone") pc <- as.genclone(partial_clone) + +test_that("Minimum spanning networks can subset populations", { + bpc <- bruvo.dist(pc, replen = rep(1, 10)) + bmsn <- bruvo.msn(pc, replen = rep(1, 10), showplot = FALSE) + pmsn <- poppr.msn(pc, bpc, showplot = FALSE) + expect_identical(ucl(bmsn), ucl(pmsn)) + + bmsn12 <- bruvo.msn(pc, replen = rep(1, 10), sublist = 1:2, showplot = FALSE) + pmsn12 <- poppr.msn(pc, bpc, sublist = 1:2, showplot = FALSE) + expect_identical(ucl(bmsn12), ucl(pmsn12)) + + bmsn1 <- bruvo.msn(pc, replen = rep(1, 10), sublist = 1, showplot = FALSE) + pmsn1 <- poppr.msn(pc, bpc, sublist = 1, showplot = FALSE) + expect_identical(ucl(bmsn1), ucl(pmsn1)) + +}) + + mll.custom(pc) <- LETTERS[mll(pc)] mll.levels(pc)[mll.levels(pc) == "Q"] <- "M" mll(pc) <- "custom" diff --git a/tests/testthat/test-plots.R b/tests/testthat/test-plots.R index 46e208ff..ddc1282d 100644 --- a/tests/testthat/test-plots.R +++ b/tests/testthat/test-plots.R @@ -145,5 +145,12 @@ test_that("diversity_ci produces boxplots for rarefaction", { expect_output(ciplot$layers[[1]], "geom_boxplot") expect_output(ciplot$layers[[2]], "geom_point") expect_output(ciplot$facet, "facet_wrap\\(Index\\)") +}) + +test_that("greycurve produces plots", { + skip_on_cran() + expect_output(greycurve(), "") + expect_output(greycurve(scalebar = TRUE), "") + expect_output(greycurve(1:100), "") }) \ No newline at end of file diff --git a/tests/testthat/test-values.R b/tests/testthat/test-values.R index 31ed83a1..c2d1a311 100644 --- a/tests/testthat/test-values.R +++ b/tests/testthat/test-values.R @@ -210,6 +210,15 @@ test_that("fix_replen works as expected", { expect_true(all(floor(nanfix)[!nantest] == 1)) }) +test_that("fix_replen throws errors for weird replens", { + skip_on_cran() + data(partial_clone) + expect_warning(fix_replen(partial_clone, rep(10, 10)), paste(locNames(partial_clone), collapse = ", ")) + expect_warning(fix_replen(partial_clone, rep(10, 10), fix_some = FALSE), "Original repeat lengths are being returned") + expect_warning(fix_replen(partial_clone, rep(2, 10)), "The repeat lengths for Locus_2, Locus_7, Locus_9 are not consistent.") + expect_warning(fix_replen(partial_clone, rep(2, 10)), "Repeat lengths with some modification are being returned: Locus_3") +}) + test_that("poppr_has_parallel returns something logical", { expect_is(poppr_has_parallel(), "logical") }) \ No newline at end of file