Description Usage Arguments Value Note Examples

Helper function which creates an object containing necessary information to run a simulation of haplotype accumulation for a hypothetical species of interest

1 2 3 |

`N` |
Number of individuals |

`Hstar` |
Number of unique species' haplotypes |

`probs` |
Haplotype frequency distribution vector |

`perms` |
Number of permutations (replications) |

`p` |
Proportion of haplotypes to recover |

`conf.level` |
Desired confidence level for graphical output and interval estimation |

`subsample` |
Is a subsample of haplotype labels desired? |

`prop` |
If subsample = TRUE, the proportion of haplotype labels to subsample |

`num.iters` |
Number of iterations to compute |

`progress` |
Should iteration output be printed to the R console? |

`filename` |
Name of file where simulation results are to be saved |

A list object of class "HAC" with 13 elements that can be passed to `HAC.simrep`

as follows:

`input.seqs` |
Should a FASTA file of aligned/trimmed DNA sequences be inputted? Default is FALSE |

`subset.seqs` |
Should a subsample of DNA sequences be taken? Default is FALSE |

`prop.seqs` |
Proportion of DNA sequences to subsample. Default is NULL |

`prop.haps` |
Proportion of haplotype labels to subsample. Default is NULL (can be altered by user) |

`subset.haps` |
Should a subsample of haplotype labels be taken? Default is NULL (can be altered by user) |

`N` |
Number of individuals. NA by default (provided by user) |

`Hstar` |
Number of unique species' haplotypes. NA by default (provided by user) |

`probs` |
Haplotype frequency distribution vector. NA by default (provided by user) |

`p` |
Proportion of haplotypes to recover. |

`perms` |
Number of permutations (replications). |

`conf.level` |
Desired confidence level for graphical output and interval estimation. |

`num.iters` |
Number of iterations to compute. |

`progress` |
Should iteration output be printed to the R console? Default is TRUE |

`filename` |
Name of file where simulation results are to be saved. |

`N`

must be greater than 1 and greater than or equal to `Hstar`

.

`Hstar`

must be greater than 1.

`probs`

must have a length equal to `Hstar`

and its elements must sum to 1.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ```
## Simulate hypothetical species ##
N <- 100 # total number of sampled individuals
Hstar <- 10 # total number of haplotypes
probs <- rep(1/Hstar, Hstar) # equal haplotype frequency distribution
# outputs a CSV file called "output.csv"
HACSObj <- HACHypothetical(N = N, Hstar = Hstar, probs = probs, filename = "output")
## Simulate hypothetical species - subsampling ##
# subsamples 25% of haplotype labels
HACSObj <- HACHypothetical(N = N, Hstar = Hstar, probs = probs,
perms = 1000, p = 0.95, subsample = TRUE, prop = 0.25,
conf.level = 0.95, filename = "output")
## Simulate hypothetical species and all paramaters changed - subsampling ##
HACSObj <- HACHypothetical(N = N, Hstar = Hstar, probs = probs,
perms = 10000, p = 0.90, subsample = TRUE, prop = 0.15, conf.level = 0.95,
num.iters = 1, filename = "output")
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.