Learn R Programming

genio (version 1.0.9)

ind_to_fam: Convert an eigenstrat IND tibble into a plink FAM tibble

Description

This function takes an existing IND tibble and creates a FAM tibble with the same information and dummy values for missing data. In particular, the output FAM tibble will contain these columns with these contents:

fam:

IND label

id:

IND id

pat:

0 (missing paternal ID)

mat:

0 (missing maternal ID)

sex:

IND sex converted to plink integer codes via sex_to_int

peno:

0 (missing phenotype)

As IND tibbles only contain the three columns listed above, there is no loss of information.

Usage

ind_to_fam(ind)

Arguments

ind

The input eigenstrat IND tibble to convert.

Value

A plink FAM tibble.

See Also

sex_to_int

Eigenstrat IND format reference: https://github.com/DReichLab/EIG/tree/master/CONVERTF

Plink FAM format reference: https://www.cog-genomics.org/plink/1.9/formats#fam

Examples

Run this code
# NOT RUN {
# create a sample IND tibble
library(tibble)
ind <- tibble(
  id = 1:3,
  sex = c('U', 'M', 'F'),
  label = c(1, 1, 2)
)
# convert to FAM
fam <- ind_to_fam(ind)
# inspect:
fam

# }

Run the code above in your browser using DataLab