parseselect: Parse the keep/remove/extract/exclude/chr options

Description Usage Arguments Details Value

View source: R/parseselect.R

Description

Parse the keep/remove/extract/exclude/chr options

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
parseselect(
  bfile,
  extract = NULL,
  exclude = NULL,
  keep = NULL,
  remove = NULL,
  chr = NULL,
  export = FALSE,
  order.important = FALSE
)

Arguments

bfile

plink file stem

extract

SNPs to extract

exclude

SNPs to exclude

keep

samples to keep

remove

samples to remove

chr

a vector of chromosomes

export

Logical. Whether to include the bim and/or fam data in the returned object.

order.important

Logical. Whether to strictly enforce that the order of extract and/or keep must match with bim or fam, respectively.

Details

keep and remove can take one of three formats:

  1. A logical vector indicating which indivduals to keep/remove,

  2. A data.frame with two columns giving the FID and IID of the indivdiuals to keep/remove (matching those in the .fam file), or

  3. A character scalar giving the text file with the FID/IID.

Note that these files should not contain headers.

extract and exclude can be of format type (1) or (3) describe above, or a character vector of SNP ids (matching those in the .bim file).

Value

A list containing:

keep

Either NULL or a logical vector of which individuals to keep

extract

Either NULL or a logical vector of which SNPs to extract

N

Number of rows in the PLINK bfile

P

Number of columns in the PLINK bfile

n

Number of rows in the PLINK bfile after keep

p

Number of columns in the PLINK bfile after extract

bfile

File path to bfile stub

bimfile

File path to bim file

famfile

File path to fam file

bim

Either NULL or a data frame of bim data

fam

Either NULL or a data frame of fam data


tshmak/lassosum documentation built on Sept. 24, 2020, 9:41 a.m.