has_plink2_bin_files: Determine if using 'base_input_filename' there are 'PLINK'...

View source: R/has_plink2_bin_files.R

has_plink2_bin_filesR Documentation

Determine if using base_input_filename there are PLINK binary files

Description

Determine if using base_input_filename there are PLINK binary files.

Usage

has_plink2_bin_files(base_input_filename)

Arguments

base_input_filename

the base of the filenames that are used as input for PLINK/PLINK2

Details

This is done by searching the PLINK binary files at:

  • base_input_filename.bed

  • base_input_filename.bim

  • base_input_filename.fam

If these files exist, this function returns TRUE

Value

TRUE if the PLINK text files exist

Note

  • the PLINK text files are not tested for validity

  • it is not checked if a log file is present

Author(s)

Richèl J.C. Bilderbeek

Examples

# FALSE on PLINK v1.7 testing text data
has_plink2_bin_files(
  tools::file_path_sans_ext(get_plinkr_filename("test_v1_7.map"))
)
# FALSE on PLINK binary data
has_plink2_bin_files(
  tools::file_path_sans_ext(
    get_plinkr_filename("test_v1_7_after_make-bed.bed")
  )
)
# TRUE on PLINK2 binary data
has_plink2_bin_files(
  tools::file_path_sans_ext(
    get_plinkr_filename("toy_v1_9_after_make-bed_after_make-pgen.pgen")
  )
)

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