Description Usage Arguments Details Examples
View source: R/script - run_snppit.R
Download snppit here: https://github.com/eriqande/snppit Extract the zip-file, rename the "snppit-master" folder to "snppit", and place the folder in the same working directory as this script.
1 2 3 4 5 6 7 | run_snppit(
df_offspring,
df_parents,
projectName = "project1",
overwrite = F,
useGroups = F
)
|
df_offspring |
Data frame contaning offspring ID's and SNP genotypes (see above) |
df_parents |
Data frame containing parent ID's, sex, population, and SNP genotypes (see above) |
projectName |
Optional. A name that will be used for files created during the proces |
overwrite |
Optional. If the script should overwrite any older snppit analysis (or read the old one again instead of re-doing it) |
useGroups |
Optional. If parent grups should be used, only parents within the same group will be considered as parents together. |
Then you're ready! Usually, to run snppit, you need to prepare a specially formatted genpop file with your offspring and parent data SNP data, then run snppit via the command line. This r function saves you some time by doing the genpop formatting and command line stuff for you, in R. All you need to do is to supply the function with two datasets: parents and offspring, and the function will return the resulting parentage analysis ready to use in R.
The function takes two datasets as parameters, one for offspring and one for parents.
Both datasets must be formated as folows:
Individuals as rows
SNP data on columns, one column pr SNP. Important: any column that is not named "ID", (or for parents, "sex" or "population"), will be interpreted as a SNP.
SNP genotype written numerically: 1=homozygous for allele a, 2=heterozygous, 3=homozygous for allele b
One column named "ID" that contains some unique ID for each individual,
Only for parents: One column named "sex" that's either "M" or "F"
Only for parents: One column named "population" that gives that individual's population
Only for parents: One column named "group" that gives the parents spawning group (foursome) must come after "sex"
1 | parentage_data <- run_snppt(offspring, parents, "Project_oct2019")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.