rename_fids: Rename all the family IDs within the data

View source: R/rename_fids.R

rename_fidsR Documentation

Rename all the family IDs within the data

Description

Rename all the family IDs within the data

Usage

rename_fids(data, fids)

Arguments

data

the data source, which can be:

  • PLINK text data, as created by create_plink_text_data.

  • PLINK binary data, as created by create_plink_bin_data.

  • PLINK2 binary data, as created by create_plink2_bin_data.

  • PLINK text filenames, as created by create_plink_text_filenames.

  • PLINK binary filenames, as created by create_plink_bin_filenames.

  • PLINK2 binary filenames, as created by create_plink2_bin_filenames.

  • data to be used by assoc, as created by create_assoc_data

  • data to be used by assoc_qt, as created by create_assoc_qt_data

fids

one or more family IDs (which are called FIDs in PLINK). Use check_fids to check if the elements of fids are valid.

Value

the data with renamed family IDs

Author(s)

Richèl J.C. Bilderbeek

Examples

# Use PLINK text data
data_before <- create_test_plink_text_data()
new_fids <- as.character(1 + data_before$ped_table$FID)
# the .ped table has the new FIDs
data_after <- rename_fids(
  data = data_before,
  fids = new_fids
)

# Use data used by plink::assoc_qt
data_before <- create_test_assoc_qt_data()
new_fids <- as.character(1 + data_before$data$ped_table$FID)
# the .ped and .phe tables have the new FIDs
data_after <- rename_fids(
  data = data_before,
  fids = new_fids
)

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