plinkr: plinkr: An R interface to 'PLINK'.

plinkrR Documentation

plinkr: An R interface to PLINK.

Description

plinkr is an R interface to PLINK.

Details

plinkr allows the user to install, run and uninstall (multiple versions of) PLINK. Also PLINK output files can be read, modified within R and saved to PLINK-conforming files

This is a list of functions to install or uninstall (multiple versions of) PLINK:

  • check_plink_is_installed: check if PLINK is installed, stop if not

  • is_plink_installed: determine if PLINK is installed, yes/no

  • get_plink_version: get the version of PLINK

  • install_plinks: install PLINKs

  • uninstall_plinks: uninstall PLINKs

This is a list of functions to run or with with (multiple versions of) PLINK:

  • run_plink: run PLINK

This is a list of higher-level functions, that use PLINK in the back

  • assoc: do an association with a binary/case-control trait

  • assoc_qt: do an association with a quantitative trait

This is a list of functions to read PLINK and PLINK2 files:

  • read_plink_assoc_file: read a PLINK .assoc file

  • read_plink_log_file: read a PLINK .log file

  • read_plink_map_file: read a PLINK .map file

  • read_plink_ped_file: read a PLINK .ped file

  • read_plink_phe_file: read a PLINK phenotype file

  • read_plink_qassoc_file: read a PLINK .qassoc file

  • read_plink_simfreq_file: read a PLINK .simfreq file

This is a list of functions to convert PLINK and PLINK2 files:

  • convert_plink_bin_files_to_plink_text_files: Convert the PLINK binary .bed, .bim and .fam files to their equivalent plain-text/non-binary .map and .ped files

  • convert_plink_text_files_to_plink_bin_files: Convert the PLINK plain-text/non-binary .map and .ped files to their equivalent binary .bed, .bim and .fam files

  • make_bed: Convert the (non-binary) .map and .ped files to their binary .bed, .bim and .fam equivalents

This is a list of functions to save PLINK and PLINK2 files:

  • save_map_table: save a genetic mapping table to a PLINK .map file

  • save_ped_table: save a pedigree table to a PLINK .ped file

  • save_phe_table: save a phenotype table to a PLINK phenotype file

This is a list of functions to get simple/example/testing files and data structures:

  • create_demo_assoc_data: create dara to demonstrate a binary/case-control trait analysis

  • create_demo_assoc_qt_data: create data to demonstrate a quantitative trait analysis

  • create_demo_map_table: create a genetic map to demonstrate an association analysis, for both binary/case-control traits as well as quantitative trait

  • create_demo_ped_table: create a pedigree table to demonstrate an association analysis, for both binary/case-control traits as well as quantitative trait

  • create_demo_phe_table: create a phenotype map to demonstrate a quantitative trait analysis

  • get_plink_example_filename: get the path to an example file as supplied by PLINK

  • get_plink_example_filenames: get a list of example filenames supplied by PLINK

  • get_plinkr_filename: get the path to an example file as supplied by plinkr

  • get_plinkr_filenames: get a list of example filenames supplied by plinkr

  • get_test_map_table: get a test genetic mapping table

  • get_test_ped_table: get a test pedigree table

Author(s)

Richèl J.C. Bilderbeek

Examples

if (is_plink_installed()) {

  # Use the PLINK v1.9 example files
  ped_filename <- get_plink_example_filename("toy.ped")
  map_filename <- get_plink_example_filename("toy.map")

  # Do a case-control association
  run_plink(
    args = c(
     "--ped", ped_filename,
     "--map", map_filename
    )
  )

  # Read the results
  read_plink_log_file("plink.log")

  # Delete the created files
  file.remove("plink.bed")
  file.remove("plink.fam")
  file.remove("plink.log")
}

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