diff --git a/man/AlleleFreq.Rd b/man/AlleleFreq.Rd new file mode 100644 index 0000000..395f077 --- /dev/null +++ b/man/AlleleFreq.Rd @@ -0,0 +1,15 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/AlleleFreq.R +\name{AlleleFreq} +\alias{AlleleFreq} +\title{Calculate the major allele} +\usage{ +AlleleFreq(x) +} +\arguments{ +\item{x}{Vector of characters representing alleles} +} +\description{ +sub-function used by genepop_allelefreq +} + diff --git a/man/AlleleFreqLoci.Rd b/man/AlleleFreqLoci.Rd new file mode 100644 index 0000000..1f02055 --- /dev/null +++ b/man/AlleleFreqLoci.Rd @@ -0,0 +1,17 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/AlleleFreqLoci.R +\name{AlleleFreqLoci} +\alias{AlleleFreqLoci} +\title{Calculate allele frequency for a given allele} +\usage{ +AlleleFreqLoci(x, major) +} +\arguments{ +\item{x}{Vector of characters representing alleles} + +\item{major}{is the major allele for a given loci} +} +\description{ +sub-function used by genepop_allelefreq +} + diff --git a/man/GenePopData.Rd b/man/GenePopData.Rd new file mode 100644 index 0000000..a7a0d62 --- /dev/null +++ b/man/GenePopData.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{GenePopData} +\alias{GenePopData} +\title{Documentation for the dataset used inside genepopedit +This dataset contains genomic data coded as 3 digit alleles.} +\format{A data frame with 411 rows and 1 variable: representing a genepop file with +100 Single Nucleotide Polymorphisms (SNPs).} +\source{ +This data has been randomly generated to demonstrate the functionality of genepopedit. +} +\usage{ +GenePopData +} +\description{ +Documentation for the dataset used inside genepopedit +This dataset contains genomic data coded as 3 digit alleles. +} +\details{ +\itemize{ +\item Markers: 100 SNP +\item Populations: 10 +\item Samples: 30 indivuals/population +} +} +\keyword{datasets} + diff --git a/man/Optimfunc.Rd b/man/Optimfunc.Rd new file mode 100644 index 0000000..85099a1 --- /dev/null +++ b/man/Optimfunc.Rd @@ -0,0 +1,15 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/Optimfunc.R +\name{Optimfunc} +\alias{Optimfunc} +\title{Decision matrix for selecting a panel of unlinked loci by Fst} +\usage{ +Optimfunc(x) +} +\arguments{ +\item{x}{Matrix ordered by Loci high (1) to low (n loci) by fst in rows and the number of columns corresponds to the linked loci.} +} +\description{ +Decision matrix for selecting unlinked loci while maximizing Fst. Function is used by genepop_toploci. +} + diff --git a/man/PGDspideR.Rd b/man/PGDspideR.Rd new file mode 100644 index 0000000..9a54eeb --- /dev/null +++ b/man/PGDspideR.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/pgdSpideR.R +\name{PGDspideR} +\alias{PGDspideR} +\title{Execute PGDspider data format conversions in R} +\usage{ +PGDspideR(input, input_format, output, output_format, spid, where.pgdspider) +} +\arguments{ +\item{input}{the full path to the input file.} + +\item{input_format}{what are you converting from (e.g. GENEPOP or PED) these must match the dropdown menus in pgdSpider.} + +\item{output}{the full file path to the desired output. (e.g. GENEPOP or PED) these must match the dropdown menus in pgdSpider.} + +\item{output_format}{what are you converting to (e.g. GENEPOP or PED). This must match the dropdown menus in pgdSpider.} + +\item{spid}{the fill file path to the spid file generated in PGDspider.} + +\item{where.pgdspider}{A file path to the PGDspider installation folder.} +} +\description{ +Function to between file types in R. +} + diff --git a/man/alleleotype_genepop.Rd b/man/alleleotype_genepop.Rd new file mode 100644 index 0000000..005d5f3 --- /dev/null +++ b/man/alleleotype_genepop.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/alleleotype_genepop.R +\name{alleleotype_genepop} +\alias{alleleotype_genepop} +\title{Alleleotype -> GENEPOP format} +\usage{ +alleleotype_genepop(input, numsim = 100, path) +} +\arguments{ +\item{input}{path to input file (csv) containing major allele frequencies. First column is the SNP names and the remaining columsn are the population based allele frequencies from the pooled DNA sample. input can also be a data.frame from the workspace. The column headers of the dataframe must begin with 'Pop' followed by the specified loci names.} + +\item{numsim}{number of simulated individuals per population to be returned.} + +\item{path}{the filepath and filename of output.} +} +\description{ +Simulate individuals using pooled DNA major allele frequencies. Return as GENEPOP formatted data. +} + diff --git a/man/common_string.Rd b/man/common_string.Rd new file mode 100644 index 0000000..bce527b --- /dev/null +++ b/man/common_string.Rd @@ -0,0 +1,15 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/common_string.R +\name{common_string} +\alias{common_string} +\title{Identify common string sequence} +\usage{ +common_string(Vec) +} +\arguments{ +\item{Vec}{A character vector.} +} +\description{ +A function which returns the largest common sequence among a vector of strings. +} + diff --git a/man/filename_check.Rd b/man/filename_check.Rd new file mode 100644 index 0000000..05f256e --- /dev/null +++ b/man/filename_check.Rd @@ -0,0 +1,15 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/filename_check.R +\name{filename_check} +\alias{filename_check} +\title{filename_check} +\usage{ +filename_check(X) +} +\arguments{ +\item{X}{what to check} +} +\description{ +Gets the file name that is specified by GenePop variable. This function is used by various functions of genepopedit and is applied to the Genepop variable. +} + diff --git a/man/genepop_GSIsim.Rd b/man/genepop_GSIsim.Rd new file mode 100644 index 0000000..f357da4 --- /dev/null +++ b/man/genepop_GSIsim.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/genepop_gsisim.R +\name{genepop_GSIsim} +\alias{genepop_GSIsim} +\title{Convert Genepop to GSI sim format.} +\usage{ +genepop_GSIsim(genepop, path) +} +\arguments{ +\item{genepop}{the genepop data to be manipulated. This can be either a file path +or a dataframe read in with tab separation, header=FALSE , quote="", and stringsAsFactors=FALSE. +This will be the standard genepop format with the first n+1 rows corresponding to the n loci names, +or a single comma delimited row of loci names followed by the locus data. Populations are +separated by "Pop". Each individual ID is linked to the locus data by " , " (space, space space) and is read in as +as a single row (character).} + +\item{path}{the filepath and filename of output.} +} +\description{ +Covert from GENEPOP to format required by gsi_sim. Note that output has SampleIDs formated as Population_Population_ID instead of conventioanl Population_ID to fit commong sampleID naming approach of genepopedit into the convention of gsi_sim. +} + diff --git a/man/genepop_ID.Rd b/man/genepop_ID.Rd new file mode 100644 index 0000000..d5310f5 --- /dev/null +++ b/man/genepop_ID.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/genepop_ID.R +\name{genepop_ID} +\alias{genepop_ID} +\title{Add separation ("_") between population name and sample number} +\usage{ +genepop_ID(genepop, path) +} +\arguments{ +\item{genepop}{the genepop data to be manipulated. This can be either a file path +or a dataframe read in with tab separation, header=FALSE , quote="", and stringsAsFactors=FALSE. +This will be the standard genepop format with the first n+1 rows corresponding to the n loci names, +or a single comma delimited row of loci names followed by the locus data. Populations are +separated by "Pop". Each individual ID is linked to the locus data by " , " (space,space space) and is read in as +as a single row (character).} + +\item{path}{the filepath and filename of output.} +} +\description{ +Function to add separation ("_") between population name and sample number +} + diff --git a/man/genepop_allelefreq.Rd b/man/genepop_allelefreq.Rd new file mode 100644 index 0000000..c5a868f --- /dev/null +++ b/man/genepop_allelefreq.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/genepop_allelefreq.R +\name{genepop_allelefreq} +\alias{genepop_allelefreq} +\title{Explore population specific allele frequencies.} +\usage{ +genepop_allelefreq(genepop, popgroup = NULL, wide = FALSE) +} +\arguments{ +\item{genepop}{the genepop data to be manipulated. This can be either a file path +or a dataframe read in with tab separation, header=FALSE , quote="", and stringsAsFactors=FALSE. +This will be the standard genepop format with the first n+1 rows corresponding to the n loci names, +or a single comma delimited row of loci names followed by the locus data. Populations are +separated by "Pop". Each individual ID is linked to the locus data by " , " (space, space space) and is read in as +as a single row (character).} + +\item{popgroup}{population grouping using the "Pop" deliminiter (Default: NULL) or a dataframe or path to a csv. The grouping dataframe should have two columns, the first corresponding to the population name and the second to an aggregation vector of common groups. Each population can only be assigned to one group.} + +\item{wide}{logical specifying whether the allele frequencies should be returned as long (default:FALSE) or wide (TRUE) format. Note that the wide format can be used as the input for alleleotype_genepop to simulate geneotypes.} +} +\description{ +Function returns population derived allele frequencies. +} + diff --git a/man/genepop_assigner.Rd b/man/genepop_assigner.Rd new file mode 100644 index 0000000..ae57dc7 --- /dev/null +++ b/man/genepop_assigner.Rd @@ -0,0 +1,27 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/genepop_assigner.R +\name{genepop_assigner} +\alias{genepop_assigner} +\title{Convert Genepop to assigner format.} +\usage{ +genepop_assigner(genepop, popgroup = NULL, path = NULL) +} +\arguments{ +\item{genepop}{the genepop data to be manipulated. This can be either a file path +or a dataframe read in with tab separation, header=FALSE , quote="", and stringsAsFactors=FALSE. +This will be the standard genepop format with a the first n+1 rows corresponding to the n loci names, +or a single comma delimited row of loci names followed by the locus data. Populations are +separated by "Pop". Each individual ID is linked to the locus data by " , " (space,space space) and is read in as +as a single row (character).} + +\item{popgroup}{if specified (Default: NULL) popgroup is a dataframe or path to a csv. +This dataframe contains two columns. Column 1 corresponds to the population names. These names +should match the individual IDs (e.g. BON_01 , 110110 would be 'BON'). The next column +has the group. These values must be numeric. If groupings are the same as populations then leave as NULL (Default).} + +\item{path}{the filepath and filename of output.} +} +\description{ +Function to convert Genepop to assigner +} + diff --git a/man/genepop_bgc.Rd b/man/genepop_bgc.Rd new file mode 100644 index 0000000..05b978c --- /dev/null +++ b/man/genepop_bgc.Rd @@ -0,0 +1,34 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/genepop_bgc.R +\name{genepop_bgc} +\alias{genepop_bgc} +\title{Convert Genepop to Bayesian Genomic Clines (BGC) format.} +\usage{ +genepop_bgc(genepop, popdef, fname, path) +} +\arguments{ +\item{genepop}{the genepop data to be manipulated. This can be either a file path +or a dataframe read in with tab separation, header=FALSE , quote="", and stringsAsFactors=FALSE. +This will the standard genepop format with a the first n+1 rows corresponding the the n loci names, +or a single comma deliminated row of loci names followed by the locus data. Populations are +separated by "Pop". Each individual ID is linked to the locus data by " , " (space,space space) and is read in as +as a single row (character).} + +\item{popdef}{is a dataframe or path to a csv. +This dataframe contains two columns. Column 1 corresponds to the population names. These names +should match the individual IDs (e.g. BON_01 , 110110 would be 'BON'). The next column +has the grouping classification corresponding to each population +defining parental 1 ("P1") parental 2 ("P2") and admixed ("Admixed") populations. +Note the classifications must be exactly as specified (caps sensitive). If populations are omitted from +this dataframe then they will be omitted from the output files.} + +\item{fname}{collective name assigned to each of the output files for BGC. +e.g. "Lobster_analysis" would result in +"Lobster_analysis_P1.txt","Lobster_analysis_P2.txt", and "Lobster_analysis_Admixed.txt"} + +\item{path}{file path to directory where the BGC files (3) will be saved.} +} +\description{ +Function to convert Genepop to BGC format. +} + diff --git a/man/genepop_colony.Rd b/man/genepop_colony.Rd new file mode 100644 index 0000000..033a485 --- /dev/null +++ b/man/genepop_colony.Rd @@ -0,0 +1,30 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/genepop_colony.R +\name{genepop_colony} +\alias{genepop_colony} +\title{Convert Genepop to Colony format.} +\usage{ +genepop_colony(genepop, where.plink, where.pgdspider, denote.missing = "000", + allocate.pgd.ram = 1, path) +} +\arguments{ +\item{genepop}{the genepop data to be manipulated. This is read in as a complete file path. +This will the standard genepop format with a the first n+1 rows corresponding the the n loci names, +or a single comma deliminated row of loci names followed by the locus data. Populations are +separated by "Pop". Each individual ID is linked to the locus data by " , " (space,space space) and is read in as +as a single row (character).} + +\item{where.plink}{A file path to the PLINK installation folder.} + +\item{where.pgdspider}{A file path to the PGDspider installation folder.} + +\item{denote.missing}{The value that denotes missing data in your input file} + +\item{allocate.pgd.ram}{An integer value in GB to specify the maximum amount of RAM to allocate to PGDspider. The default is 1 GB, which should be sufficient for most analyses.} + +\item{path}{file path to directory where the Colony files (4) will be saved.} +} +\description{ +Function to convert Genepop to Colony format. +} + diff --git a/man/genepop_detective.Rd b/man/genepop_detective.Rd new file mode 100644 index 0000000..489d57d --- /dev/null +++ b/man/genepop_detective.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/genepop_detective.R +\name{genepop_detective} +\alias{genepop_detective} +\title{Explore Genepop data structure.} +\usage{ +genepop_detective(genepop, variable = "Pops") +} +\arguments{ +\item{genepop}{the genepop data to be manipulated. This can be either a file path +or a dataframe read in with tab separation, header=FALSE , quote="", and stringsAsFactors=FALSE. +This will be the standard genepop format with the first n+1 rows corresponding to the n loci names, +or a single comma delimited row of loci names followed by the locus data. Populations are +separated by "Pop". Each individual ID is linked to the locus data by " , " (space, space space) and is read in as +as a single row (character).} + +\item{variable}{data to be returned +Four options \code{default = "Pops"} +"Pops" = vector of population names. +"PopNum" = dataframe of population names and counts. +"Inds" = vector of sample IDs. +"Loci" = vector of Loci. +"Allele" = vector of allele values.} +} +\description{ +Function returns Genepop file meta-data. +} + diff --git a/man/genepop_flattend.Rd b/man/genepop_flattend.Rd new file mode 100644 index 0000000..78f87c7 --- /dev/null +++ b/man/genepop_flattend.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/genepop_flatten.R +\name{genepop_flatten} +\alias{genepop_flatten} +\title{Flatten Genepop to dataframe} +\usage{ +genepop_flatten(genepop) +} +\arguments{ +\item{genepop}{the genepop data to be manipulated. This can be either a file path +or a dataframe read in with tab separation, header=FALSE , quote="", and stringsAsFactors=FALSE. +This will be the standard genepop format with the first n+1 rows corresponding to the n loci names, +or a single comma delimited row of loci names followed by the locus data. Populations are +separated by "Pop". Each individual ID is linked to the locus data by " , " (space,space space) and is read in as +as a single row (character).} +} +\description{ +Convert and return Genepop as flattend dataframe. +} + diff --git a/man/genepop_fstat.Rd b/man/genepop_fstat.Rd new file mode 100644 index 0000000..7541b83 --- /dev/null +++ b/man/genepop_fstat.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/genepop_fstat.R +\name{genepop_fstat} +\alias{genepop_fstat} +\title{Convert Genepop to FSTAT format.} +\usage{ +genepop_fstat(genepop, path = NULL, addworkspace = FALSE) +} +\arguments{ +\item{genepop}{the genepop data to be manipulated. This can be either a file path +or a dataframe read in with tab separation, header=FALSE , quote="", and stringsAsFactors=FALSE. +This will be the standard genepop format with the first n+1 rows corresponding to the n loci names, +or a single comma delimited row of loci names followed by the locus data. Populations are +separated by "Pop". Each individual ID is linked to the locus data by " , " (space,space space) and is read in as +as a single row (character).} + +\item{path}{the filepath and filename of output.} + +\item{addworkspace}{logical statement defining whether the converted data +should be saved as a file specified in the path (default) argument or whether it should be returned to the workspace +if returned to the workspace the object will be called "Output_fstat".} +} +\description{ +Function to convert Genepop to FSTAT +} + diff --git a/man/genepop_newhybrids.Rd b/man/genepop_newhybrids.Rd new file mode 100644 index 0000000..aff020e --- /dev/null +++ b/man/genepop_newhybrids.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/genepop_newhybrids.R +\name{genepop_newhybrids} +\alias{genepop_newhybrids} +\title{Convert Genepop to New Hybrids format.} +\usage{ +genepop_newhybrids(genepop, path = NULL) +} +\arguments{ +\item{genepop}{the genepop data to be manipulated. This can be either a file path +or a dataframe read in with tab separation, header=FALSE , quote="", and stringsAsFactors=FALSE. +This will be the standard genepop format with the first n+1 rows corresponding to the n loci names, +or a single comma delimited row of loci names followed by the locus data. Populations are +separated by "Pop". Each individual ID is linked to the locus data by " , " (space,space space) and is read in as +as a single row (character).} + +\item{path}{the filepath and filename of output.} +} +\description{ +Function to convert Genepop to NewHybrids +} + diff --git a/man/genepop_sample.Rd b/man/genepop_sample.Rd new file mode 100644 index 0000000..3a998de --- /dev/null +++ b/man/genepop_sample.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/genepop_sample.R +\name{genepop_sample} +\alias{genepop_sample} +\title{Randomly sample individuals from Genepop.} +\usage{ +genepop_sample(genepop, nsample) +} +\arguments{ +\item{genepop}{the genepop data to be manipulated. This can be either a file path +or a dataframe read in with tab separation, header=FALSE , quote="", and stringsAsFactors=FALSE. +This will be the standard genepop format with the first n+1 rows corresponding to the n loci names, +or a single comma delimited row of loci names followed by the locus data. Populations are +separated by "Pop". Each individual ID is linked to the locus data by " , " (space,space space) and is read in as +as a single row (character).} + +\item{nsample}{vector or dataframe which defines the random stratified sampling. +If nsample is an integer (e.g. 5) then nsample individuals will be selected from each population. +If nsample is a fraction (0-0.9) then that percentage of individuals will be selected from each population. +If nsample is a dataframe then the number or fraction associated with each population will be sampled. +where the first column is the population and the second is the number to be sampled.} +} +\description{ +Stratified random sample of individuals from a Genepop file. +} + diff --git a/man/genepop_structure.Rd b/man/genepop_structure.Rd new file mode 100644 index 0000000..b631e5a --- /dev/null +++ b/man/genepop_structure.Rd @@ -0,0 +1,27 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/genepop_structure.R +\name{genepop_structure} +\alias{genepop_structure} +\title{Convert Genepop to STRUCTURE format.} +\usage{ +genepop_structure(genepop, popgroup = NULL, path = NULL) +} +\arguments{ +\item{genepop}{the genepop data to be manipulated. This can be either a file path +or a dataframe read in with tab separation, header=FALSE , quote="", and stringsAsFactors=FALSE. +This will be the standard genepop format with the first n+1 rows corresponding to the n loci names, +or a single comma delimited row of loci names followed by the locus data. Populations are +separated by "Pop". Each individual ID is linked to the locus data by " , " (space,space space) and is read in as +as a single row (character).} + +\item{popgroup}{if specified (Default: NULL) popgroup is a dataframe or path to a csv. +This dataframe contains two columns. Column 1 corresponds to the population names. These names +should match the individual IDs (e.g. BON_01 , 110110 would be 'BON'). The next column +has the group. If groupings are the same as populations then leave as NULL (Default).If the input genepop file does not have population and sample ID seperation using ("_") then refer to genepop_ID().} + +\item{path}{the filepath and filename of output.} +} +\description{ +Function to convert Genepop to STRUCTURE +} + diff --git a/man/genepop_toploci.Rd b/man/genepop_toploci.Rd new file mode 100644 index 0000000..4eaad52 --- /dev/null +++ b/man/genepop_toploci.Rd @@ -0,0 +1,35 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/genepop_toploci.R +\name{genepop_toploci} +\alias{genepop_toploci} +\title{Creates a panel of the top n unlinked loci, and exports the list of loci} +\usage{ +genepop_toploci(genepop, where.plink, where.pgdspider, r2.threshold = 0.2, + fst.threshold = 0.05, ld.window = NULL, ldpop = "All", + allocate.pgd.ram = 1, return.workspace = TRUE, save.output = FALSE) +} +\arguments{ +\item{genepop}{A file path to the genepop format file you wish to create your panel from} + +\item{where.plink}{A file path to the PLINK installation folder.} + +\item{where.pgdspider}{A file path to the PGDspider installation folder.} + +\item{r2.threshold}{The minimum r^2 threshold to consider a pair of loci to be in LD} + +\item{fst.threshold}{The minimum FST threshold required to retain a locus} + +\item{ld.window}{Number of adjacent SNPs to compare each SNP against for LD - default is NULL, which translates to a window size of 99999, which essentially asks to compare each SNP against all others} + +\item{ldpop}{A string which populations (default: "All") will be used to calculate linkage disequilibrium. Names must match names returned by genepop_detective().} + +\item{allocate.pgd.ram}{An integer value in GB to specify the maximum amount of RAM to allocate to PGDspider. The default is 1 GB, which should be sufficient for most analyses.} + +\item{return.workspace}{(default: TRUE) Logical query to return the output to the workspace} + +\item{save.output}{Logical query (default: FALSE) to save the output to the same location as the file being analyzed. Each of the outputs of the function will be saved as a separate file with the file name of the orginal data appended with "_Linkages", "Loci_FST", and "Unlinked_Loci_FST" for the pairwise linked loci along with their r^2, all loci with their global Fst, and only the top unlinked loci with their Fst respectively.} +} +\description{ +Extract the genotypes of individuals at the top n (by Fst) unlinked loci. The default threshold of r2>0.2 is employed for assigning 'linked' loci (default for plink). +} + diff --git a/man/genepop_treemix.Rd b/man/genepop_treemix.Rd new file mode 100644 index 0000000..5a585cb --- /dev/null +++ b/man/genepop_treemix.Rd @@ -0,0 +1,31 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/genepop_treemix.R +\name{genepop_treemix} +\alias{genepop_treemix} +\title{Convert a Genepop to input required for phython processing to TREEMIX.} +\usage{ +genepop_treemix(genepop, where.pgdspider, where.plink, allocate.pgd.ram = 1, + keep_inter = FALSE, path) +} +\arguments{ +\item{genepop}{the genepop data to be manipulated. This can be either a file path +or a dataframe read in with tab separation, header=FALSE , quote="", and stringsAsFactors=FALSE. +This will be the standard genepop format with the first n+1 rows corresponding to the n loci names, +or a single comma delimited row of loci names followed by the locus data. Populations are +separated by "Pop". Each individual ID is linked to the locus data by " , " (space,space space) and is read in as +as a single row (character).} + +\item{where.pgdspider}{A file path to the PGDspider installation folder.} + +\item{where.plink}{A file path to the PLINK installation folder.} + +\item{allocate.pgd.ram}{An integer value in GB to specify the maximum amount of RAM to allocate to PGDspider. The default is 1 GB, which should be sufficient for most analyses.} + +\item{keep_inter}{A logical condition statement (default : FALSE) specifying whether to keep the map, ped, and clustering files generated during the conversion.} + +\item{path}{file path to directory where the gzipped Treemix input file will be saved.} +} +\description{ +Convert Genepop to within-clusters binary PED file for TREEMIX. +} + diff --git a/man/genepop_unflatten.Rd b/man/genepop_unflatten.Rd new file mode 100644 index 0000000..d5de2d3 --- /dev/null +++ b/man/genepop_unflatten.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/genepop_unflatten.R +\name{genepop_unflatten} +\alias{genepop_unflatten} +\title{Convert to Genepop format from a flattened dataframe.} +\usage{ +genepop_unflatten(df, path) +} +\arguments{ +\item{df}{dataframe with the first column holding sampleIDs (e.g. BON_01) and the remaining columns holding loci. Column names of loci will be used as loci names in the genepop output. +df must be an object in the workspace.} + +\item{path}{the filepath and filename of output.} +} +\description{ +Function returns Genepop file meta-data. +} + diff --git a/man/insert_vals.Rd b/man/insert_vals.Rd new file mode 100644 index 0000000..6f4e15a --- /dev/null +++ b/man/insert_vals.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/insert_vals.R +\name{insert_vals} +\alias{insert_vals} +\title{Insert values at location} +\usage{ +insert_vals(Vec, breaks, newVal) +} +\arguments{ +\item{Vec}{A data vector where values will be inserted.} + +\item{breaks}{vector of positions where values will be inserted. +Here the output will have length(vec)+length(breaks) rows with the values +specified in 'newVal' positioned at the 'breaks' positions} + +\item{newVal}{values to be inserted} +} +\description{ +Function to insert values at specified positons within a dataframe and-or vector +} + diff --git a/man/majorminor.Rd b/man/majorminor.Rd new file mode 100644 index 0000000..825ad32 --- /dev/null +++ b/man/majorminor.Rd @@ -0,0 +1,17 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/majorminor.R +\name{majorminor} +\alias{majorminor} +\title{Function to convert allele in character format to bgc zygosity format.} +\usage{ +majorminor(Vec, allele_length = 6) +} +\arguments{ +\item{Vec}{Vector of characters representing alleles.} + +\item{allele_length}{The number of characters in an allele (default: 6 e.g. 130120).} +} +\description{ +sub-function used by genepop_bgc +} + diff --git a/man/path_ending.Rd b/man/path_ending.Rd new file mode 100644 index 0000000..f3275fe --- /dev/null +++ b/man/path_ending.Rd @@ -0,0 +1,15 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/path_ending.R +\name{path_ending} +\alias{path_ending} +\title{path_ending} +\usage{ +path_ending(path) +} +\arguments{ +\item{path}{path to check} +} +\description{ +Checks that the paths end in "/" as required +} + diff --git a/man/powermarker_genepop.Rd b/man/powermarker_genepop.Rd new file mode 100644 index 0000000..d4ae0cf --- /dev/null +++ b/man/powermarker_genepop.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/powermarker_genepop.R +\name{powermarker_genepop} +\alias{powermarker_genepop} +\title{Convert Powermarker format to Genepop} +\usage{ +powermarker_genepop(powermarker, missing_data, path, sampleid = TRUE) +} +\arguments{ +\item{powermarker}{the powermarker data to be manipulated. The first column should be the 'POP_ID' column which identifies the populations. +The second column should be 'Sample_ID' which designates the individual sample IDs. The remaining columns contain the locus alleles in the format of 'A/A' etc.} + +\item{missing_data}{The symbol (typically "-", "?", or "9") which will be replaced with 000.} + +\item{path}{the filepath and filename of output.} + +\item{sampleid}{Whether you want the sampleid in your Genepop to be based off the 'Sample_ID' column (TRUE) or the 'POP_ID' column (FALSE) in the powermarker file} +} +\description{ +Function converts Powermarker to standard Genepop format +} + diff --git a/man/subset_genepop.Rd b/man/subset_genepop.Rd new file mode 100644 index 0000000..ac15208 --- /dev/null +++ b/man/subset_genepop.Rd @@ -0,0 +1,39 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/subset_genepop.R +\name{subset_genepop} +\alias{subset_genepop} +\title{Genepop subset loci and populations} +\usage{ +subset_genepop(genepop, subs = NULL, keep = TRUE, spop = NULL, path) +} +\arguments{ +\item{genepop}{the genepop data to be manipulated. This can be either a file path +or a dataframe read in with tab separation, header=FALSE , quote="", and stringsAsFactors=FALSE. +This will be the standard genepop format with the first n+1 rows corresponding to the n loci names, +or a single comma delimited row of loci names followed by the locus data. Populations are +separated by "Pop". Each individual ID is linked to the locus data by " , " (space,space space) and is read in as +as a single row (character).} + +\item{subs}{the loci names of interest or a vector which corresponds to the order of which +they appear in the genepop file. +These can be either the order by which they occur or the exact name of the loci +e.g. subs <-c(1,2,3,4) would return the first 4 loci +& subs <- c("190_56","145_21",456_12") would return loci with defined names.} + +\item{keep}{logical vector which defines whether you want to remove the loci or keep them. +The default is to keep them keep <- TRUE assuming you are removing neutral markers +and only keeping the subs.} + +\item{spop}{is the populations of interest. Note these are specified in the order which they appear in the +original genepop file. i.e. first pop = 1 second pop = 2 +Examples: numeric - spop <- c(1,3,4,7) or +the population ID (alpha-numeric code before the underscore). Here we assume conventional +naming of "Population_sample#" e.g. (Aqua01_05: population Aqua01 & sample #5). + text- spop <- c("Aqua01", "GRR","GHR","TRS").} + +\item{path}{the filepath and filename of output.} +} +\description{ +Function to subset loci and populations +} + diff --git a/man/subset_genepop_aggregate.Rd b/man/subset_genepop_aggregate.Rd new file mode 100644 index 0000000..ba1a870 --- /dev/null +++ b/man/subset_genepop_aggregate.Rd @@ -0,0 +1,40 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/subset_genepop_aggregate.R +\name{subset_genepop_aggregate} +\alias{subset_genepop_aggregate} +\title{Genepop subset, combine, and reorder populations} +\usage{ +subset_genepop_aggregate(genepop, subs = NULL, keep = TRUE, agpopframe, + path) +} +\arguments{ +\item{genepop}{the genepop data to be manipulated. This can be either a file path +or a dataframe read in with tab separation, header=FALSE , quote="", and stringsAsFactors=FALSE. +This will be the standard genepop format with the first n+1 rows corresponding to the n loci names, +or a single comma delimited row of loci names followed by the locus data. Populations are +separated by "Pop". Each individual ID is linked to the locus data by " , " (space,space space) and is read in as +as a single row (character).} + +\item{subs}{the loci names of interest or a vector +subs <- c("190-56","145_21",456_12") would return loci with these defined names.} + +\item{keep}{logical vector which defines whether you want to remove the loci or keep them. +The default is to keep them keep <- TRUE assuming you are removing neutral markers +and only keeping the subs} + +\item{agpopframe}{a dataframe or path to a csv. +This dataframe contains two columns: Column 1 corresponds to the population names. +Here we consider the alpha-numeric characters before the first underscore '_' to be the population name. +so that IDs are "Population_sample#" (e.g. Aqua23_04 = Population Aqua23, individual 4). +These names can be obtained using the genepop_detective function. +The next column has grouping variables. If you don't want to change the grouping just repeat original name. +If the input is a dataframe object from the workspace it must be a data.frame object and therefore will have headers. +e.g. data.frame(Opop=c("AAA","BBB","CCC","DDD","EEE","FFF","GGG"),AgPop=c("Pop1","Pop2","CCC","Pop2","EEE","Pop2","GGG")) +In this case AAA/BBB & DDD/FFF would be clustered together between population flags in genepop.} + +\item{path}{to the output .txt file.} +} +\description{ +Function to cluster populations together and remove specific loci +} + diff --git a/man/subset_genepop_individual.Rd b/man/subset_genepop_individual.Rd new file mode 100644 index 0000000..92dcaae --- /dev/null +++ b/man/subset_genepop_individual.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/subset_genepop_individual.R +\name{subset_genepop_individual} +\alias{subset_genepop_individual} +\title{Genepop remove or keep specific sample IDs} +\usage{ +subset_genepop_individual(genepop, indiv = NULL, keep = FALSE, path) +} +\arguments{ +\item{genepop}{the genepop data to be manipulated. This can be either a file path +or a dataframe read in with tab separation, header=FALSE , quote="", and stringsAsFactors=FALSE. +This will be the standard genepop format with the first n+1 rows corresponding to the n loci names, +or a single comma delimited row of loci names followed by the locus data. Populations are +separated by "Pop". Each individual ID is linked to the locus data by " , " (space,space space) and is read in as +as a single row (character).} + +\item{indiv}{vector sample IDs of interest. +These can be either the order by which they occur or the exact name of the loci +indiv <- \code{c("Pop01_01","Pop03_15","Pop16_02")} would individuals with these sample names.} + +\item{keep}{logical whether to delete sample IDs specified by indiv (default: TRUE) or delete all other IDs.} + +\item{path}{the filepath and filename of output.} +} +\description{ +Function for the manipulation of genopop format SNP datasets +} + diff --git a/man/subset_genepop_rename.Rd b/man/subset_genepop_rename.Rd new file mode 100644 index 0000000..44d85fb --- /dev/null +++ b/man/subset_genepop_rename.Rd @@ -0,0 +1,38 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/subset_genepop_rename.R +\name{subset_genepop_rename} +\alias{subset_genepop_rename} +\title{Genepop subset and rename populations} +\usage{ +subset_genepop_rename(genepop, nameframe, renumber = FALSE, meta = "Pop", + path) +} +\arguments{ +\item{genepop}{the genepop data to be manipulated. This can be either a file path +or a dataframe read in with tab separation, header=FALSE , quote="", and stringsAsFactors=FALSE. +This will be the standard genepop format with the first n+1 rows corresponding to the n loci names, +or a single comma delimited row of loci names followed by the locus data. Populations are +separated by "Pop". Each individual ID is linked to the locus data by " , " (space,space space) and is read in as +as a single row (character).} + +\item{nameframe}{a dataframe or path to a csv and is required for this function. The first column of the dataframe defines the original value +and the second corresponds to the change. If populations (default: meta="populations") are the metadata to be changed +the names should match the individual IDs (e.g. BON_01 , 110110 120120 = 'BON'). The next column +has the new names that you want to change or rename. If you don't want to change the name then just repeat +from column one in that row. This function assumes that each population will have a unique name. Names in this case are +comprised of alpha characters and not numbers. +(e.g. Pop01_01 and Pop02_01 would each be considered 'Pop' for the population name) +e.g. data.frame(Opop=c("BON","BRA","EDN","CRA","MAL","TRY"),Rename=c("BON","BON","EDN","CRA","BON","CRA")).} + +\item{renumber}{is a logical (default=FALSE) defining whether you want to change the sample unique identity +i.e. sample number - BON_01 where 01 is the unique qauntity. If multiple populations are combined this will +prevent two samples from having the same name.} + +\item{meta}{which metadata will be renamed with nameframe. Default is "Pop" for populations, alternative is "Ind" for individuals.} + +\item{path}{the filepath and filename of output.} +} +\description{ +Function for the manipulation of genopop format SNP datasets and renaming of populations +} +