convert_plink_text_data_to_plink_bin_data: Convert the 'PLINK' text data to 'PLINK' binary data

View source: R/convert_plink_text_data_to_plink_bin_data.R

convert_plink_text_data_to_plink_bin_dataR Documentation

Description

Convert the PLINK text data to PLINK binary data.

Usage

convert_plink_text_data_to_plink_bin_data(
  plink_text_data,
  plink_options = create_plink_v1_9_options(),
  verbose = FALSE
)

Arguments

plink_text_data

the genetic and phenotypic data for PLINK to work on, in PLINK text format, as created by create_plink_text_data.

plink_options

options to run PLINK, as created by create_plink_options

verbose

the verbosity of a function. Set to TRUE for more output. Use check_verbose to detect if this argument is valid.

Value

the same list that was used as input, except that the following elements

  • ped_table (see check_ped_table)

  • map_table (see check_map_table)

are replaced by:

  • bim_table (see check_bim_table)

  • fam_table (see check_fam_table)

  • bed_table (see check_bed_table)

The other list elements are left as-is.

Author(s)

Richèl J.C. Bilderbeek

See Also

these are the functions to convert between the PLINK and PLINK2 formats:

  • To convert from PLINK1 text data

    • to PLINK1 binary data: use convert_plink_text_data_to_plink_bin_data

    • to PLINK2 binary data, use convert_plink_text_data_to_plink2_bin_data

  • To convert from PLINK1 binary data

    • to PLINK text data, use convert_plink_bin_data_to_plink_text_data

    • to PLINK2 binary data, use convert_plink_bin_data_to_plink2_bin_data

  • To convert from PLINK2 binary data

    • to PLINK text data, use convert_plink2_bin_data_to_plink_text_data

    • to PLINK binary data, use convert_plink2_bin_data_to_plink_bin_data

Examples

if (is_on_ci()) {
  if (is_plink_installed(plink_options = create_plink_v1_9_options())) {

    # Use testing data
    convert_plink_text_data_to_plink_bin_data(
      plink_text_data = create_test_plink_text_data()
    )

    # Use simulated data
    assoc_qt_data <- create_demo_assoc_qt_data()
    # Is PLINK text data
    is_plink_text_data(assoc_qt_data$data)
    assoc_qt_data$data <- convert_plink_text_data_to_plink_bin_data(
      assoc_qt_data$data
    )
    is_plink_bin_data(assoc_qt_data$data)
  }
}

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