View source: R/mhap_transform.R
Takes a long genotype dataframe and transforms it to be the initial format
required for different genetic analysis programs.
Current options for genetic analysis programs include:
CKMRsim, rubias, snppit(?), franz(?), adegenet,
structure (?), WHAT ELSE DO PEOPLE COMMONLY USE HERE....
The 2columnformat_haplotype
is a standard wide dataframe that has 2 columns
per locus with 1 row per sample. Missing data is coded as NA
The 2columnformat_numeric
has haplotypes coded as integers, it returns a list
of dataframes, the first being the 2 column format named 'data', and the second dataframe
(named 'key') is the key for haplotype to integer conversion done within the function.
The 'adegenet_2col' produces a dataframe to be passed into 'adegenet::df2genind'
1 | mhap_transform(long_genos, program, metadata = NULL)
|
long_genos |
dataframe of filtered haplotypes. This is the output from the "filter_raw_microhap_data" function. |
program |
The program you want to create an input file for. This could be 'CKMRsim', 'rubias', 'franz', '2columnformat_haplotype', '2columnformat_numeric', 'adegenet_2col'ADD OTHERS HERE. |
metadata |
Not required. If supplied, metadata will be joined to genotype data before the output file is written. For franz, metadata must be in the following order: indiv.ID, birth_year, death_year, sex. Sex is M, F or ? (for unknown). For rubias, metadata is in the following order: indiv.ID, sample_type, repunit, collection (for details see 'vignette("rubias-overview")') |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.