This function requires the path to stacks vcf file(s) as input. There are slots for varying the M parameter from 1-8 (as recommended by Paris et al. 2017). After running stacks with each of the M options, plug the output vcf files into this function to calculate the effect of varying M on the number of SNPs/loci built. Plug the output of this function into vis_loci() to visualize the optimal the M parameter for your dataset at the 'R80' cutoff (Paris et al. 2017).

optimize_bigM(
  M1 = NULL,
  M2 = NULL,
  M3 = NULL,
  M4 = NULL,
  M5 = NULL,
  M6 = NULL,
  M7 = NULL,
  M8 = NULL
)

Arguments

M1

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

M2

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

M3

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

M4

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

M5

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

M6

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

M7

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

M8

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

Value

A list containing four summary dataframes, 'snp' showing the number of non-missing SNPs retained in each sample at each m value, 'loci' showing the number of non-missing loci retained in each sample at each m value, 'snp.R80' showing the total number of SNPs retained at an 80% completeness cutoff, and 'loci.R80' showing the total number of polymorphic loci retained at an 80% completeness cutoff.

Examples

optimize_bigM(M1=system.file("extdata","bigM1.vcf.gz",package="RADstackshelpR",mustWork=TRUE))
#> $snp #> var snps #> 1 M1 55 #> 2 M1 19 #> 3 M1 76 #> 4 M1 68 #> 5 M1 82 #> 6 M1 54 #> 7 M1 62 #> 8 M1 78 #> 9 M1 58 #> 10 M1 6 #> 11 M1 36 #> 12 M1 55 #> 13 M1 60 #> 14 M1 43 #> 15 M1 24 #> 16 M1 66 #> 17 M1 71 #> 18 M1 4 #> 19 M1 83 #> #> $loci #> var poly.loci #> 1 M1 55 #> 2 M1 19 #> 3 M1 76 #> 4 M1 68 #> 5 M1 82 #> 6 M1 54 #> 7 M1 62 #> 8 M1 78 #> 9 M1 58 #> 10 M1 6 #> 11 M1 36 #> 12 M1 55 #> 13 M1 60 #> 14 M1 43 #> 15 M1 24 #> 16 M1 66 #> 17 M1 71 #> 18 M1 4 #> 19 M1 83 #> #> $snp.R80 #> var snps.80 #> 1 M1 28 #> #> $loci.R80 #> var poly.loci.80 #> 1 M1 28 #>