create_test_plink_text_data: Create PLINK text data for testing

View source: R/create_test_plink_text_data.R

create_test_plink_text_dataR Documentation

Description

Create PLINK text data for testing

Usage

create_test_plink_text_data(
  ped_table = get_test_ped_table(),
  map_table = get_test_map_table()
)

Arguments

ped_table

a 'pedigree' table.

A ped_table is a tibble with these columns:

  • FID The family ID

  • IID Within-family ID (cannot be zero)

  • within_family_id_father Within-family ID of father (0 if father isn't in dataset)

  • within_family_id_mother Within-family ID of mother (0 if mother isn't in dataset)

  • sex_code Sex code (1 = male, 2 = female, 0 = unknown)

  • case_control_code Case control code (1 = control, 2 = case, 9/0/non-numeric = missing data if case/control)

  • snv_[x][y] Nucleotide for the xth variant for haplotype y (y is either a or b) in the .map file (0 = no call)

The FID and IID column names match the PLINK names, see https://www.cog-genomics.org/plink/1.9/input#pheno.

Use read_plink_ped_file to read a PLINK .ped file. Use check_ped_table to test if a pedigree table is valid.

map_table

a genetic mapping table.

A map_table is a tibble with the following columns:

  • CHR: the chromosome code or contig name. The chromosome number cannot exceed 95 (https://www.cog-genomics.org/plink/1.9/input#chr_set)

  • SNP: Variant identifier

  • position_cm: Position in morgans or centimorgans. This value is optional. Zeroes denote it is unused

  • BP: Base-pair coordinat

Use read_plink_map_file to read a PLINK .map file. Use check_map_table to test if a genetic mapping table is valid.

Details

These is the same tables as can be obtained by reading the PLINK v1.7 example files called test.ped and test.map.

Author(s)

Richèl J.C. Bilderbeek

Examples

data <- create_test_plink_text_data()
is_plink_text_data(data)
is_plink_bin_data(data)
is_plink2_bin_data(data)

richelbilderbeek/plinkr documentation built on March 25, 2024, 3:18 p.m.