This function requires the path to stacks vcf file(s) as input. There are slots for varying the n parameter across M-1, M, and M-1 (as recommended by Paris et al. 2017). After running stacks with each of the n options, plug the output vcf files into this function to visualize the effect of varying m on number of SNPs and loci built to recognize which value optimizes the n parameter for your dataset at the 'R80' cutoff (Paris et al. 2017).

optimize_n(nequalsMminus1 = NULL, nequalsM = NULL, nequalsMplus1 = NULL)

Arguments

nequalsMminus1

Path to the input vcf file for a run when n=M-1

nequalsM

Path to the input vcf file for a run when n=M

nequalsMplus1

Path to the input vcf file for a run when n=M+1

Value

A dataframe showing the number of SNPs and loci retained across filtering levels for each n value

Examples

optimize_n(nequalsM = system.file("extdata","nequalsm.vcf.gz",package="RADstackshelpR",mustWork=TRUE))
#> $snp #> var snps #> 1 n=M 32 #> 2 n=M 8 #> 3 n=M 40 #> 4 n=M 40 #> 5 n=M 39 #> 6 n=M 29 #> 7 n=M 32 #> 8 n=M 39 #> 9 n=M 31 #> 10 n=M 4 #> 11 n=M 18 #> 12 n=M 33 #> 13 n=M 38 #> 14 n=M 22 #> 15 n=M 9 #> 16 n=M 34 #> 17 n=M 38 #> 18 n=M 1 #> 19 n=M 41 #> #> $loci #> var poly.loci #> 1 n=M 32 #> 2 n=M 8 #> 3 n=M 40 #> 4 n=M 40 #> 5 n=M 39 #> 6 n=M 29 #> 7 n=M 32 #> 8 n=M 39 #> 9 n=M 31 #> 10 n=M 4 #> 11 n=M 18 #> 12 n=M 33 #> 13 n=M 38 #> 14 n=M 22 #> 15 n=M 9 #> 16 n=M 34 #> 17 n=M 38 #> 18 n=M 1 #> 19 n=M 41 #> #> $snp.R80 #> var snps.80 #> 1 n=M 17 #> #> $loci.R80 #> var poly.loci.80 #> 1 n=M 17 #>