Type: Package
Title: Single-Iteration Permutation for Large-Scale Biobank Data
Version: 0.1.0
Description: A single, phenome-wide permutation of large-scale biobank data. When a large number of phenotypes are analyzed in parallel, a single permutation across all phenotypes followed by genetic association analyses of the permuted data enables estimation of false discovery rates (FDRs) across the phenome. These FDR estimates provide a significance criterion for interpreting genetic associations in a biobank context. For the basic permutation of unrelated samples, this package takes a sample-by-variable file with ID, genotypic covariates, phenotypic covariates, and phenotypes as input. For data with related samples, it also takes a file with sample pair-wise identity-by-descent information. The function outputs a permuted sample-by-variable file ready for genome-wide association analysis. See Annis et al. (2021) <doi:10.21203/rs.3.rs-873449/v1> for details.
URL: https://github.com/acannis/SIP
BugReports: https://github.com/acannis/SIP/issues
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Depends: R (≥ 3.5)
Imports: stats, data.table, ggplot2
RoxygenNote: 7.3.3
Suggests: testthat (≥ 3.0.0)
Config/testthat/edition: 3
NeedsCompilation: no
Packaged: 2025-12-02 14:26:37 UTC; mk
Author: Aubrey Annis [aut, cre]
Maintainer: Aubrey Annis <acannis@umich.edu>
Repository: CRAN
Date/Publication: 2025-12-09 08:00:02 UTC

SIP-package internal setup

Description

Declares global variables and imports common functions used throughout the SIP package. This file is executed when the package is loaded.


This function subsets the sample-by-variable dataframe to the "fixed" (i.e., non-permuted) data. This subset should include ID variables, sex, and genotypic covariates.

Description

This function subsets the sample-by-variable dataframe to the "fixed" (i.e., non-permuted) data. This subset should include ID variables, sex, and genotypic covariates.

Usage

get_fixed(df, id.var = id.var, sex.var = sex.var, geno.vars = geno.vars)

Arguments

df

Data frame

id.var, sex.var

String

geno.vars

Character vector

Value

Data frame


This function samples individuals by pairs for permuting phenotype vectors in the paired-permutation function (sipPair.R)

Description

This function samples individuals by pairs for permuting phenotype vectors in the paired-permutation function (sipPair.R)

Usage

get_pairPerm(deglst, rid.vars = rid.vars, ibd.var = ibd.var, seed = seed)

Arguments

deglst

List of data frames

rid.vars

Character vector

ibd.var

String

seed

Number

Value

Data frame


This function recombines the fixed data and permuted data in the paired-permutation function (sipPair.R) into a permuted sample-by-variable data frame.

Description

This function recombines the fixed data and permuted data in the paired-permutation function (sipPair.R) into a permuted sample-by-variable data frame.

Usage

get_pairPermDF(fix.df, perm.df, perm.map, id.var = id.var)

Arguments

fix.df, perm.df, perm.map

Data frames

id.var

String

Value

Data frame


This function recombines the fixed data and permuted data into a permuted sample-by-variable data frame.

Description

This function recombines the fixed data and permuted data into a permuted sample-by-variable data frame.

Usage

get_permDF(fix.df, perm.df, perm.idx)

Arguments

fix.df, perm.df

Data frames

perm.idx

Numeric vector

Value

Data frame


This function samples indices for permuting phenotype vectors in the basic permutation function (sip.R) and for permuting leftover unpaired individuals in the paired-permutation function (sipPair.R).

Description

This function samples indices for permuting phenotype vectors in the basic permutation function (sip.R) and for permuting leftover unpaired individuals in the paired-permutation function (sipPair.R).

Usage

get_permIdx(df, seed = seed)

Arguments

df

Data frame

seed

Number

Value

Numeric vector


This function subsets the sample-by-variable data frame to the permutable data. This subset should include phenotypes and phenotypic covariates.

Description

This function subsets the sample-by-variable data frame to the permutable data. This subset should include phenotypes and phenotypic covariates.

Usage

get_permute(df, id.var = id.var, pheno.vars = pheno.vars)

Arguments

df

Data frame

id.var

String

pheno.vars

Character vector

Value

Data frame


This function infers relatedness categories in the paired-permutation function (sip_pair.R) prior to permutation.

Description

This function infers relatedness categories in the paired-permutation function (sip_pair.R) prior to permutation.

Usage

get_relCat(pairs, rid.vars = rid.vars, ibd.var = ibd.var)

Arguments

pairs

Data frame

rid.vars

Character vector

ibd.var

String

Value

List of data frames


This function pairs individuals in the paired-permutation function (sip_pair.R) into the most highly-related pairs possible.

Description

This function pairs individuals in the paired-permutation function (sip_pair.R) into the most highly-related pairs possible.

Usage

get_relPairs(
  df,
  id.var = id.var,
  rel.df = rel.df,
  rid.vars = rid.vars,
  ibd.var = ibd.var
)

Arguments

df, rel.df

Data frames

id.var, ibd.var

Strings

rid.vars

Character vector

Value

Data frame


This function divides the sample-by-variable data frame into males and females prior to permutation within sexes.

Description

This function divides the sample-by-variable data frame into males and females prior to permutation within sexes.

Usage

get_sexDF(df = df, sex.var = sex.var, sex.val = sex.val)

Arguments

df

Data frame

sex.var

String

sex.val

String or integer

Value

Data frame


This function checks for uneven numbers of individuals within relatedness category and creates a data set for permuting single samples that will not be pair permuted (sip_pair.R).

Description

This function checks for uneven numbers of individuals within relatedness category and creates a data set for permuting single samples that will not be pair permuted (sip_pair.R).

Usage

get_singSamp(df, deglst, id.var = id.var)

Arguments

df

Data frame

deglst

List of data frames

id.var

String

Value

Data frame


This function reorders the permuted sample-by-variable data frame to match the ID order of the primary sample-by-variable data frame.

Description

This function reorders the permuted sample-by-variable data frame to match the ID order of the primary sample-by-variable data frame.

Usage

order_permDF(df = df, perm = perm, id.var = id.var)

Arguments

df, perm

Data frames

id.var

String

Value

Data frame


Phenotype-IBD correlation

Description

This function first calculates the correlation between phenotypes for sample pairs. Then it calculates the correlation between the phenotype correlation and identity-by-descent for the sample pairs. (N.B., Please omit missing values before running this function.)

Usage

phenotype_IBD_correlation(
  df = NULL,
  rel.df = NULL,
  id.var = NULL,
  rid.vars = NULL,
  ibd.var = NULL,
  pheno.vars = NULL
)

Arguments

df, rel.df

Data frame

id.var, ibd.var

Strings

pheno.vars, rid.vars

Character vectors

Details

The function requires the following inputs:

1) A sample-by-variable data frame with sample ID and phenotypes. Columns should include an individual ID variable and phenotype names.

2) A string identifying the ID variable name (e.g., id.var="ID").

3) A vector of phenotype names. (e.g., pheno.vars=c("PHENO1","PHENO2",...)).

4) A relatedness data frame containing identity-by-descent (IBD) for pairs of individuals in the sample-by-variable data frame Column names should include two ID variables and an IBD variable.

5) A vector of the 2 ID variable names in the relatedness data frame. (e.g., rid.vars=c("ID1","ID2")).

6) A string identifying the IBD variable name (e.g., ibd.var="PropIBD").

Value

Correlation

Examples


phenotype_IBD_correlation(df = sipPair_exampleData,
rel.df = sipPair_relatednessData, id.var = "IID",
rid.vars = c("IID1","IID2"), ibd.var = "PropIBD",
pheno.vars = paste0("PHENO",1:300))

phenotype_IBD_correlation(df = sipPair_exampleData[
sipPair_exampleData$IID %in% unlist(sipPair_relatednessData[1:100,c("IID1",
"IID2")]),], rel.df = sipPair_relatednessData[1:100,], id.var = "IID",
rid.vars = c("IID1","IID2"), ibd.var = "PropIBD",
pheno.vars = paste0("PHENO",1:300))


Phenotype correlation plot

Description

This function returns a plot showing correlation between phenotypes. (N.B., please omit missing values before running this function.)

Usage

plot_phenotype_correlations(df = NULL, pheno.vars = NULL)

Arguments

df

Data frame

pheno.vars

Character vector

Details

The function requires the following inputs:

1) A sample-by-variable data frame with phenotypes. Column names should include phenotype names.

2) A vector of phenotype names. (e.g., pheno.vars=c("PHENO1","PHENO2",...)).

Value

Plot

Examples

plot_phenotype_correlations(df = sip_exampleData,
pheno.vars = paste0("PHENO",1:500))

Single-iteration permutation for large-scale biobank data

Description

This function performs the basic permutation for permuting phenotype vectors in biobank data.

Usage

sip(
  df = NULL,
  id.var = NULL,
  sex.var = NULL,
  male.val = NULL,
  female.val = NULL,
  geno.vars = NULL,
  within.sex = TRUE,
  seed = NULL
)

Arguments

df

Data frame

id.var, sex.var

Strings

male.val, female.val

Strings or integers

geno.vars

Character vectors

within.sex

Boolean, defaults to TRUE

seed

Number

Details

The function requires the following inputs:

1) A sample-by-variable dataframe with phenotypes and covariates. Column names should include an ID variable, sex variable, genotypic covariate names, phenotypic covariate names, and phenotype names. (N.B. a secondary ID variable can be included in the genotypic covariate names.)

2) A string identifying the ID variable name (e.g., id.var="ID").

3) A vector of genotypic covariates (e.g., geno.vars=c("ID2","Batch","PC1","PC2",...)).

4) Optional: within.sex = FALSE. Default is within.sex = TRUE and will permute males and females separately.

5) If within.sex = TRUE (the default), a string identifying the sex variable name (e.g., sex.var="Inferred_Sex").

6) If within.sex = TRUE (the default), male and female values in the sex vector (e.g., male.val=1, female.val=2).

7) Optional: a seed for sampling. If a seed is not provided, one will be chosen randomly during the sampling process (e.g., seed=123).

8) N.B. Any column names not specified in (2)-(6) are assumed to be phenotypes or phenotypic covariates.

Value

Data frame

Examples

sip(df = sip_exampleData, id.var = "IID", sex.var = "SEX", male.val = 1,
female.val = 2, geno.vars = c("FID","ANCESTRY","BATCH",paste0("PC",1:4)))

Single-iteration paired permutation phenotype and covariate data

Description

A sample-by-variable data frame with IDs, covariates, and phenotypes as column names.

Usage

sipPair_exampleData

Format

A data frame with 10,000 rows and 309 variables:

FID

Family ID.

IID

Individual ID.

BATCH

Genotyping batch.

SEX

Sample biological sex.

AGE

Sample age.

PC1

Genetic principal component 1.

PC2

Genetic principal component 2.

PC3

Genetic principal component 3.

PC4

Genetic principal component 4.

PHENO1

Simulated phenotype 1.

PHENO2

Simulated phenotype 2.

PHENO3

Simulated phenotype 3.

PHENO4

Simulated phenotype 4.

PHENO5

Simulated phenotype 5.

PHENO6

Simulated phenotype 6.

PHENO7

Simulated phenotype 7.

PHENO8

Simulated phenotype 8.

PHENO9

Simulated phenotype 9.

PHENO10

Simulated phenotype 10.

PHENO11

Simulated phenotype 11.

PHENO12

Simulated phenotype 12.

PHENO13

Simulated phenotype 13.

PHENO14

Simulated phenotype 14.

PHENO15

Simulated phenotype 15.

PHENO16

Simulated phenotype 16.

PHENO17

Simulated phenotype 17.

PHENO18

Simulated phenotype 18.

PHENO19

Simulated phenotype 19.

PHENO20

Simulated phenotype 20.

PHENO21

Simulated phenotype 21.

PHENO22

Simulated phenotype 22.

PHENO23

Simulated phenotype 23.

PHENO24

Simulated phenotype 24.

PHENO25

Simulated phenotype 25.

PHENO26

Simulated phenotype 26.

PHENO27

Simulated phenotype 27.

PHENO28

Simulated phenotype 28.

PHENO29

Simulated phenotype 29.

PHENO30

Simulated phenotype 30.

PHENO31

Simulated phenotype 31.

PHENO32

Simulated phenotype 32.

PHENO33

Simulated phenotype 33.

PHENO34

Simulated phenotype 34.

PHENO35

Simulated phenotype 35.

PHENO36

Simulated phenotype 36.

PHENO37

Simulated phenotype 37.

PHENO38

Simulated phenotype 38.

PHENO39

Simulated phenotype 39.

PHENO40

Simulated phenotype 40.

PHENO41

Simulated phenotype 41.

PHENO42

Simulated phenotype 42.

PHENO43

Simulated phenotype 43.

PHENO44

Simulated phenotype 44.

PHENO45

Simulated phenotype 45.

PHENO46

Simulated phenotype 46.

PHENO47

Simulated phenotype 47.

PHENO48

Simulated phenotype 48.

PHENO49

Simulated phenotype 49.

PHENO50

Simulated phenotype 50.

PHENO51

Simulated phenotype 51.

PHENO52

Simulated phenotype 52.

PHENO53

Simulated phenotype 53.

PHENO54

Simulated phenotype 54.

PHENO55

Simulated phenotype 55.

PHENO56

Simulated phenotype 56.

PHENO57

Simulated phenotype 57.

PHENO58

Simulated phenotype 58.

PHENO59

Simulated phenotype 59.

PHENO60

Simulated phenotype 60.

PHENO61

Simulated phenotype 61.

PHENO62

Simulated phenotype 62.

PHENO63

Simulated phenotype 63.

PHENO64

Simulated phenotype 64.

PHENO65

Simulated phenotype 65.

PHENO66

Simulated phenotype 66.

PHENO67

Simulated phenotype 67.

PHENO68

Simulated phenotype 68.

PHENO69

Simulated phenotype 69.

PHENO70

Simulated phenotype 70.

PHENO71

Simulated phenotype 71.

PHENO72

Simulated phenotype 72.

PHENO73

Simulated phenotype 73.

PHENO74

Simulated phenotype 74.

PHENO75

Simulated phenotype 75.

PHENO76

Simulated phenotype 76.

PHENO77

Simulated phenotype 77.

PHENO78

Simulated phenotype 78.

PHENO79

Simulated phenotype 79.

PHENO80

Simulated phenotype 80.

PHENO81

Simulated phenotype 81.

PHENO82

Simulated phenotype 82.

PHENO83

Simulated phenotype 83.

PHENO84

Simulated phenotype 84.

PHENO85

Simulated phenotype 85.

PHENO86

Simulated phenotype 86.

PHENO87

Simulated phenotype 87.

PHENO88

Simulated phenotype 88.

PHENO89

Simulated phenotype 89.

PHENO90

Simulated phenotype 90.

PHENO91

Simulated phenotype 91.

PHENO92

Simulated phenotype 92.

PHENO93

Simulated phenotype 93.

PHENO94

Simulated phenotype 94.

PHENO95

Simulated phenotype 95.

PHENO96

Simulated phenotype 96.

PHENO97

Simulated phenotype 97.

PHENO98

Simulated phenotype 98.

PHENO99

Simulated phenotype 99.

PHENO100

Simulated phenotype 100.

PHENO101

Simulated phenotype 101.

PHENO102

Simulated phenotype 102.

PHENO103

Simulated phenotype 103.

PHENO104

Simulated phenotype 104.

PHENO105

Simulated phenotype 105.

PHENO106

Simulated phenotype 106.

PHENO107

Simulated phenotype 107.

PHENO108

Simulated phenotype 108.

PHENO109

Simulated phenotype 109.

PHENO110

Simulated phenotype 110.

PHENO111

Simulated phenotype 111.

PHENO112

Simulated phenotype 112.

PHENO113

Simulated phenotype 113.

PHENO114

Simulated phenotype 114.

PHENO115

Simulated phenotype 115.

PHENO116

Simulated phenotype 116.

PHENO117

Simulated phenotype 117.

PHENO118

Simulated phenotype 118.

PHENO119

Simulated phenotype 119.

PHENO120

Simulated phenotype 120.

PHENO121

Simulated phenotype 121.

PHENO122

Simulated phenotype 122.

PHENO123

Simulated phenotype 123.

PHENO124

Simulated phenotype 124.

PHENO125

Simulated phenotype 125.

PHENO126

Simulated phenotype 126.

PHENO127

Simulated phenotype 127.

PHENO128

Simulated phenotype 128.

PHENO129

Simulated phenotype 129.

PHENO130

Simulated phenotype 130.

PHENO131

Simulated phenotype 131.

PHENO132

Simulated phenotype 132.

PHENO133

Simulated phenotype 133.

PHENO134

Simulated phenotype 134.

PHENO135

Simulated phenotype 135.

PHENO136

Simulated phenotype 136.

PHENO137

Simulated phenotype 137.

PHENO138

Simulated phenotype 138.

PHENO139

Simulated phenotype 139.

PHENO140

Simulated phenotype 140.

PHENO141

Simulated phenotype 141.

PHENO142

Simulated phenotype 142.

PHENO143

Simulated phenotype 143.

PHENO144

Simulated phenotype 144.

PHENO145

Simulated phenotype 145.

PHENO146

Simulated phenotype 146.

PHENO147

Simulated phenotype 147.

PHENO148

Simulated phenotype 148.

PHENO149

Simulated phenotype 149.

PHENO150

Simulated phenotype 150.

PHENO151

Simulated phenotype 151.

PHENO152

Simulated phenotype 152.

PHENO153

Simulated phenotype 153.

PHENO154

Simulated phenotype 154.

PHENO155

Simulated phenotype 155.

PHENO156

Simulated phenotype 156.

PHENO157

Simulated phenotype 157.

PHENO158

Simulated phenotype 158.

PHENO159

Simulated phenotype 159.

PHENO160

Simulated phenotype 160.

PHENO161

Simulated phenotype 161.

PHENO162

Simulated phenotype 162.

PHENO163

Simulated phenotype 163.

PHENO164

Simulated phenotype 164.

PHENO165

Simulated phenotype 165.

PHENO166

Simulated phenotype 166.

PHENO167

Simulated phenotype 167.

PHENO168

Simulated phenotype 168.

PHENO169

Simulated phenotype 169.

PHENO170

Simulated phenotype 170.

PHENO171

Simulated phenotype 171.

PHENO172

Simulated phenotype 172.

PHENO173

Simulated phenotype 173.

PHENO174

Simulated phenotype 174.

PHENO175

Simulated phenotype 175.

PHENO176

Simulated phenotype 176.

PHENO177

Simulated phenotype 177.

PHENO178

Simulated phenotype 178.

PHENO179

Simulated phenotype 179.

PHENO180

Simulated phenotype 180.

PHENO181

Simulated phenotype 181.

PHENO182

Simulated phenotype 182.

PHENO183

Simulated phenotype 183.

PHENO184

Simulated phenotype 184.

PHENO185

Simulated phenotype 185.

PHENO186

Simulated phenotype 186.

PHENO187

Simulated phenotype 187.

PHENO188

Simulated phenotype 188.

PHENO189

Simulated phenotype 189.

PHENO190

Simulated phenotype 190.

PHENO191

Simulated phenotype 191.

PHENO192

Simulated phenotype 192.

PHENO193

Simulated phenotype 193.

PHENO194

Simulated phenotype 194.

PHENO195

Simulated phenotype 195.

PHENO196

Simulated phenotype 196.

PHENO197

Simulated phenotype 197.

PHENO198

Simulated phenotype 198.

PHENO199

Simulated phenotype 199.

PHENO200

Simulated phenotype 200.

PHENO201

Simulated phenotype 201.

PHENO202

Simulated phenotype 202.

PHENO203

Simulated phenotype 203.

PHENO204

Simulated phenotype 204.

PHENO205

Simulated phenotype 205.

PHENO206

Simulated phenotype 206.

PHENO207

Simulated phenotype 207.

PHENO208

Simulated phenotype 208.

PHENO209

Simulated phenotype 209.

PHENO210

Simulated phenotype 210.

PHENO211

Simulated phenotype 211.

PHENO212

Simulated phenotype 212.

PHENO213

Simulated phenotype 213.

PHENO214

Simulated phenotype 214.

PHENO215

Simulated phenotype 215.

PHENO216

Simulated phenotype 216.

PHENO217

Simulated phenotype 217.

PHENO218

Simulated phenotype 218.

PHENO219

Simulated phenotype 219.

PHENO220

Simulated phenotype 220.

PHENO221

Simulated phenotype 221.

PHENO222

Simulated phenotype 222.

PHENO223

Simulated phenotype 223.

PHENO224

Simulated phenotype 224.

PHENO225

Simulated phenotype 225.

PHENO226

Simulated phenotype 226.

PHENO227

Simulated phenotype 227.

PHENO228

Simulated phenotype 228.

PHENO229

Simulated phenotype 229.

PHENO230

Simulated phenotype 230.

PHENO231

Simulated phenotype 231.

PHENO232

Simulated phenotype 232.

PHENO233

Simulated phenotype 233.

PHENO234

Simulated phenotype 234.

PHENO235

Simulated phenotype 235.

PHENO236

Simulated phenotype 236.

PHENO237

Simulated phenotype 237.

PHENO238

Simulated phenotype 238.

PHENO239

Simulated phenotype 239.

PHENO240

Simulated phenotype 240.

PHENO241

Simulated phenotype 241.

PHENO242

Simulated phenotype 242.

PHENO243

Simulated phenotype 243.

PHENO244

Simulated phenotype 244.

PHENO245

Simulated phenotype 245.

PHENO246

Simulated phenotype 246.

PHENO247

Simulated phenotype 247.

PHENO248

Simulated phenotype 248.

PHENO249

Simulated phenotype 249.

PHENO250

Simulated phenotype 250.

PHENO251

Simulated phenotype 251.

PHENO252

Simulated phenotype 252.

PHENO253

Simulated phenotype 253.

PHENO254

Simulated phenotype 254.

PHENO255

Simulated phenotype 255.

PHENO256

Simulated phenotype 256.

PHENO257

Simulated phenotype 257.

PHENO258

Simulated phenotype 258.

PHENO259

Simulated phenotype 259.

PHENO260

Simulated phenotype 260.

PHENO261

Simulated phenotype 261.

PHENO262

Simulated phenotype 262.

PHENO263

Simulated phenotype 263.

PHENO264

Simulated phenotype 264.

PHENO265

Simulated phenotype 265.

PHENO266

Simulated phenotype 266.

PHENO267

Simulated phenotype 267.

PHENO268

Simulated phenotype 268.

PHENO269

Simulated phenotype 269.

PHENO270

Simulated phenotype 270.

PHENO271

Simulated phenotype 271.

PHENO272

Simulated phenotype 272.

PHENO273

Simulated phenotype 273.

PHENO274

Simulated phenotype 274.

PHENO275

Simulated phenotype 275.

PHENO276

Simulated phenotype 276.

PHENO277

Simulated phenotype 277.

PHENO278

Simulated phenotype 278.

PHENO279

Simulated phenotype 279.

PHENO280

Simulated phenotype 280.

PHENO281

Simulated phenotype 281.

PHENO282

Simulated phenotype 282.

PHENO283

Simulated phenotype 283.

PHENO284

Simulated phenotype 284.

PHENO285

Simulated phenotype 285.

PHENO286

Simulated phenotype 286.

PHENO287

Simulated phenotype 287.

PHENO288

Simulated phenotype 288.

PHENO289

Simulated phenotype 289.

PHENO290

Simulated phenotype 290.

PHENO291

Simulated phenotype 291.

PHENO292

Simulated phenotype 292.

PHENO293

Simulated phenotype 293.

PHENO294

Simulated phenotype 294.

PHENO295

Simulated phenotype 295.

PHENO296

Simulated phenotype 296.

PHENO297

Simulated phenotype 297.

PHENO298

Simulated phenotype 298.

PHENO299

Simulated phenotype 299.

PHENO300

Simulated phenotype 300.

Source

<https://doi.org/10.21203/rs.3.rs-873449/v1>


Single-iteration paired permutation relatedness data

Description

A sample-by-variable data frame with IDs and identity-by-descent data between samples.

Usage

sipPair_relatednessData

Format

A data frame with 9886 rows and 4 variables:

IID1

Individual ID for one sample.

IID2

Iindividual ID for a second sample.

PropIBD

Identity-by-descent proportion of genome shared between the two samples.

Source

<https://doi.org/10.21203/rs.3.rs-873449/v1>


Single-iteration permutation phenotype and covariate data

Description

A sample-by-variable data frame with IDs, covariates, and phenotypes as column names.

Usage

sip_exampleData

Format

A data frame with 10,000 rows and 511 variables:

FID

Family ID.

IID

Individual ID.

ANCESTRY

Sample ancestry.

SEX

Sample biological sex.

AGE

Sample age.

BATCH

Genotyping batch.

STUDY

Study contributing sample data.

PC1

Genetic principal component 1.

PC2

Genetic principal component 2.

PC3

Genetic principal component 3.

PC4

Genetic principal component 4.

PHENO1

Simulated phenotype 1.

PHENO2

Simulated phenotype 2.

PHENO3

Simulated phenotype 3.

PHENO4

Simulated phenotype 4.

PHENO5

Simulated phenotype 5.

PHENO6

Simulated phenotype 6.

PHENO7

Simulated phenotype 7.

PHENO8

Simulated phenotype 8.

PHENO9

Simulated phenotype 9.

PHENO10

Simulated phenotype 10.

PHENO11

Simulated phenotype 11.

PHENO12

Simulated phenotype 12.

PHENO13

Simulated phenotype 13.

PHENO14

Simulated phenotype 14.

PHENO15

Simulated phenotype 15.

PHENO16

Simulated phenotype 16.

PHENO17

Simulated phenotype 17.

PHENO18

Simulated phenotype 18.

PHENO19

Simulated phenotype 19.

PHENO20

Simulated phenotype 20.

PHENO21

Simulated phenotype 21.

PHENO22

Simulated phenotype 22.

PHENO23

Simulated phenotype 23.

PHENO24

Simulated phenotype 24.

PHENO25

Simulated phenotype 25.

PHENO26

Simulated phenotype 26.

PHENO27

Simulated phenotype 27.

PHENO28

Simulated phenotype 28.

PHENO29

Simulated phenotype 29.

PHENO30

Simulated phenotype 30.

PHENO31

Simulated phenotype 31.

PHENO32

Simulated phenotype 32.

PHENO33

Simulated phenotype 33.

PHENO34

Simulated phenotype 34.

PHENO35

Simulated phenotype 35.

PHENO36

Simulated phenotype 36.

PHENO37

Simulated phenotype 37.

PHENO38

Simulated phenotype 38.

PHENO39

Simulated phenotype 39.

PHENO40

Simulated phenotype 40.

PHENO41

Simulated phenotype 41.

PHENO42

Simulated phenotype 42.

PHENO43

Simulated phenotype 43.

PHENO44

Simulated phenotype 44.

PHENO45

Simulated phenotype 45.

PHENO46

Simulated phenotype 46.

PHENO47

Simulated phenotype 47.

PHENO48

Simulated phenotype 48.

PHENO49

Simulated phenotype 49.

PHENO50

Simulated phenotype 50.

PHENO51

Simulated phenotype 51.

PHENO52

Simulated phenotype 52.

PHENO53

Simulated phenotype 53.

PHENO54

Simulated phenotype 54.

PHENO55

Simulated phenotype 55.

PHENO56

Simulated phenotype 56.

PHENO57

Simulated phenotype 57.

PHENO58

Simulated phenotype 58.

PHENO59

Simulated phenotype 59.

PHENO60

Simulated phenotype 60.

PHENO61

Simulated phenotype 61.

PHENO62

Simulated phenotype 62.

PHENO63

Simulated phenotype 63.

PHENO64

Simulated phenotype 64.

PHENO65

Simulated phenotype 65.

PHENO66

Simulated phenotype 66.

PHENO67

Simulated phenotype 67.

PHENO68

Simulated phenotype 68.

PHENO69

Simulated phenotype 69.

PHENO70

Simulated phenotype 70.

PHENO71

Simulated phenotype 71.

PHENO72

Simulated phenotype 72.

PHENO73

Simulated phenotype 73.

PHENO74

Simulated phenotype 74.

PHENO75

Simulated phenotype 75.

PHENO76

Simulated phenotype 76.

PHENO77

Simulated phenotype 77.

PHENO78

Simulated phenotype 78.

PHENO79

Simulated phenotype 79.

PHENO80

Simulated phenotype 80.

PHENO81

Simulated phenotype 81.

PHENO82

Simulated phenotype 82.

PHENO83

Simulated phenotype 83.

PHENO84

Simulated phenotype 84.

PHENO85

Simulated phenotype 85.

PHENO86

Simulated phenotype 86.

PHENO87

Simulated phenotype 87.

PHENO88

Simulated phenotype 88.

PHENO89

Simulated phenotype 89.

PHENO90

Simulated phenotype 90.

PHENO91

Simulated phenotype 91.

PHENO92

Simulated phenotype 92.

PHENO93

Simulated phenotype 93.

PHENO94

Simulated phenotype 94.

PHENO95

Simulated phenotype 95.

PHENO96

Simulated phenotype 96.

PHENO97

Simulated phenotype 97.

PHENO98

Simulated phenotype 98.

PHENO99

Simulated phenotype 99.

PHENO100

Simulated phenotype 100.

PHENO101

Simulated phenotype 101.

PHENO102

Simulated phenotype 102.

PHENO103

Simulated phenotype 103.

PHENO104

Simulated phenotype 104.

PHENO105

Simulated phenotype 105.

PHENO106

Simulated phenotype 106.

PHENO107

Simulated phenotype 107.

PHENO108

Simulated phenotype 108.

PHENO109

Simulated phenotype 109.

PHENO110

Simulated phenotype 110.

PHENO111

Simulated phenotype 111.

PHENO112

Simulated phenotype 112.

PHENO113

Simulated phenotype 113.

PHENO114

Simulated phenotype 114.

PHENO115

Simulated phenotype 115.

PHENO116

Simulated phenotype 116.

PHENO117

Simulated phenotype 117.

PHENO118

Simulated phenotype 118.

PHENO119

Simulated phenotype 119.

PHENO120

Simulated phenotype 120.

PHENO121

Simulated phenotype 121.

PHENO122

Simulated phenotype 122.

PHENO123

Simulated phenotype 123.

PHENO124

Simulated phenotype 124.

PHENO125

Simulated phenotype 125.

PHENO126

Simulated phenotype 126.

PHENO127

Simulated phenotype 127.

PHENO128

Simulated phenotype 128.

PHENO129

Simulated phenotype 129.

PHENO130

Simulated phenotype 130.

PHENO131

Simulated phenotype 131.

PHENO132

Simulated phenotype 132.

PHENO133

Simulated phenotype 133.

PHENO134

Simulated phenotype 134.

PHENO135

Simulated phenotype 135.

PHENO136

Simulated phenotype 136.

PHENO137

Simulated phenotype 137.

PHENO138

Simulated phenotype 138.

PHENO139

Simulated phenotype 139.

PHENO140

Simulated phenotype 140.

PHENO141

Simulated phenotype 141.

PHENO142

Simulated phenotype 142.

PHENO143

Simulated phenotype 143.

PHENO144

Simulated phenotype 144.

PHENO145

Simulated phenotype 145.

PHENO146

Simulated phenotype 146.

PHENO147

Simulated phenotype 147.

PHENO148

Simulated phenotype 148.

PHENO149

Simulated phenotype 149.

PHENO150

Simulated phenotype 150.

PHENO151

Simulated phenotype 151.

PHENO152

Simulated phenotype 152.

PHENO153

Simulated phenotype 153.

PHENO154

Simulated phenotype 154.

PHENO155

Simulated phenotype 155.

PHENO156

Simulated phenotype 156.

PHENO157

Simulated phenotype 157.

PHENO158

Simulated phenotype 158.

PHENO159

Simulated phenotype 159.

PHENO160

Simulated phenotype 160.

PHENO161

Simulated phenotype 161.

PHENO162

Simulated phenotype 162.

PHENO163

Simulated phenotype 163.

PHENO164

Simulated phenotype 164.

PHENO165

Simulated phenotype 165.

PHENO166

Simulated phenotype 166.

PHENO167

Simulated phenotype 167.

PHENO168

Simulated phenotype 168.

PHENO169

Simulated phenotype 169.

PHENO170

Simulated phenotype 170.

PHENO171

Simulated phenotype 171.

PHENO172

Simulated phenotype 172.

PHENO173

Simulated phenotype 173.

PHENO174

Simulated phenotype 174.

PHENO175

Simulated phenotype 175.

PHENO176

Simulated phenotype 176.

PHENO177

Simulated phenotype 177.

PHENO178

Simulated phenotype 178.

PHENO179

Simulated phenotype 179.

PHENO180

Simulated phenotype 180.

PHENO181

Simulated phenotype 181.

PHENO182

Simulated phenotype 182.

PHENO183

Simulated phenotype 183.

PHENO184

Simulated phenotype 184.

PHENO185

Simulated phenotype 185.

PHENO186

Simulated phenotype 186.

PHENO187

Simulated phenotype 187.

PHENO188

Simulated phenotype 188.

PHENO189

Simulated phenotype 189.

PHENO190

Simulated phenotype 190.

PHENO191

Simulated phenotype 191.

PHENO192

Simulated phenotype 192.

PHENO193

Simulated phenotype 193.

PHENO194

Simulated phenotype 194.

PHENO195

Simulated phenotype 195.

PHENO196

Simulated phenotype 196.

PHENO197

Simulated phenotype 197.

PHENO198

Simulated phenotype 198.

PHENO199

Simulated phenotype 199.

PHENO200

Simulated phenotype 200.

PHENO201

Simulated phenotype 201.

PHENO202

Simulated phenotype 202.

PHENO203

Simulated phenotype 203.

PHENO204

Simulated phenotype 204.

PHENO205

Simulated phenotype 205.

PHENO206

Simulated phenotype 206.

PHENO207

Simulated phenotype 207.

PHENO208

Simulated phenotype 208.

PHENO209

Simulated phenotype 209.

PHENO210

Simulated phenotype 210.

PHENO211

Simulated phenotype 211.

PHENO212

Simulated phenotype 212.

PHENO213

Simulated phenotype 213.

PHENO214

Simulated phenotype 214.

PHENO215

Simulated phenotype 215.

PHENO216

Simulated phenotype 216.

PHENO217

Simulated phenotype 217.

PHENO218

Simulated phenotype 218.

PHENO219

Simulated phenotype 219.

PHENO220

Simulated phenotype 220.

PHENO221

Simulated phenotype 221.

PHENO222

Simulated phenotype 222.

PHENO223

Simulated phenotype 223.

PHENO224

Simulated phenotype 224.

PHENO225

Simulated phenotype 225.

PHENO226

Simulated phenotype 226.

PHENO227

Simulated phenotype 227.

PHENO228

Simulated phenotype 228.

PHENO229

Simulated phenotype 229.

PHENO230

Simulated phenotype 230.

PHENO231

Simulated phenotype 231.

PHENO232

Simulated phenotype 232.

PHENO233

Simulated phenotype 233.

PHENO234

Simulated phenotype 234.

PHENO235

Simulated phenotype 235.

PHENO236

Simulated phenotype 236.

PHENO237

Simulated phenotype 237.

PHENO238

Simulated phenotype 238.

PHENO239

Simulated phenotype 239.

PHENO240

Simulated phenotype 240.

PHENO241

Simulated phenotype 241.

PHENO242

Simulated phenotype 242.

PHENO243

Simulated phenotype 243.

PHENO244

Simulated phenotype 244.

PHENO245

Simulated phenotype 245.

PHENO246

Simulated phenotype 246.

PHENO247

Simulated phenotype 247.

PHENO248

Simulated phenotype 248.

PHENO249

Simulated phenotype 249.

PHENO250

Simulated phenotype 250.

PHENO251

Simulated phenotype 251.

PHENO252

Simulated phenotype 252.

PHENO253

Simulated phenotype 253.

PHENO254

Simulated phenotype 254.

PHENO255

Simulated phenotype 255.

PHENO256

Simulated phenotype 256.

PHENO257

Simulated phenotype 257.

PHENO258

Simulated phenotype 258.

PHENO259

Simulated phenotype 259.

PHENO260

Simulated phenotype 260.

PHENO261

Simulated phenotype 261.

PHENO262

Simulated phenotype 262.

PHENO263

Simulated phenotype 263.

PHENO264

Simulated phenotype 264.

PHENO265

Simulated phenotype 265.

PHENO266

Simulated phenotype 266.

PHENO267

Simulated phenotype 267.

PHENO268

Simulated phenotype 268.

PHENO269

Simulated phenotype 269.

PHENO270

Simulated phenotype 270.

PHENO271

Simulated phenotype 271.

PHENO272

Simulated phenotype 272.

PHENO273

Simulated phenotype 273.

PHENO274

Simulated phenotype 274.

PHENO275

Simulated phenotype 275.

PHENO276

Simulated phenotype 276.

PHENO277

Simulated phenotype 277.

PHENO278

Simulated phenotype 278.

PHENO279

Simulated phenotype 279.

PHENO280

Simulated phenotype 280.

PHENO281

Simulated phenotype 281.

PHENO282

Simulated phenotype 282.

PHENO283

Simulated phenotype 283.

PHENO284

Simulated phenotype 284.

PHENO285

Simulated phenotype 285.

PHENO286

Simulated phenotype 286.

PHENO287

Simulated phenotype 287.

PHENO288

Simulated phenotype 288.

PHENO289

Simulated phenotype 289.

PHENO290

Simulated phenotype 290.

PHENO291

Simulated phenotype 291.

PHENO292

Simulated phenotype 292.

PHENO293

Simulated phenotype 293.

PHENO294

Simulated phenotype 294.

PHENO295

Simulated phenotype 295.

PHENO296

Simulated phenotype 296.

PHENO297

Simulated phenotype 297.

PHENO298

Simulated phenotype 298.

PHENO299

Simulated phenotype 299.

PHENO300

Simulated phenotype 300.

PHENO301

Simulated phenotype 301.

PHENO302

Simulated phenotype 302.

PHENO303

Simulated phenotype 303.

PHENO304

Simulated phenotype 304.

PHENO305

Simulated phenotype 305.

PHENO306

Simulated phenotype 306.

PHENO307

Simulated phenotype 307.

PHENO308

Simulated phenotype 308.

PHENO309

Simulated phenotype 309.

PHENO310

Simulated phenotype 310.

PHENO311

Simulated phenotype 311.

PHENO312

Simulated phenotype 312.

PHENO313

Simulated phenotype 313.

PHENO314

Simulated phenotype 314.

PHENO315

Simulated phenotype 315.

PHENO316

Simulated phenotype 316.

PHENO317

Simulated phenotype 317.

PHENO318

Simulated phenotype 318.

PHENO319

Simulated phenotype 319.

PHENO320

Simulated phenotype 320.

PHENO321

Simulated phenotype 321.

PHENO322

Simulated phenotype 322.

PHENO323

Simulated phenotype 323.

PHENO324

Simulated phenotype 324.

PHENO325

Simulated phenotype 325.

PHENO326

Simulated phenotype 326.

PHENO327

Simulated phenotype 327.

PHENO328

Simulated phenotype 328.

PHENO329

Simulated phenotype 329.

PHENO330

Simulated phenotype 330.

PHENO331

Simulated phenotype 331.

PHENO332

Simulated phenotype 332.

PHENO333

Simulated phenotype 333.

PHENO334

Simulated phenotype 334.

PHENO335

Simulated phenotype 335.

PHENO336

Simulated phenotype 336.

PHENO337

Simulated phenotype 337.

PHENO338

Simulated phenotype 338.

PHENO339

Simulated phenotype 339.

PHENO340

Simulated phenotype 340.

PHENO341

Simulated phenotype 341.

PHENO342

Simulated phenotype 342.

PHENO343

Simulated phenotype 343.

PHENO344

Simulated phenotype 344.

PHENO345

Simulated phenotype 345.

PHENO346

Simulated phenotype 346.

PHENO347

Simulated phenotype 347.

PHENO348

Simulated phenotype 348.

PHENO349

Simulated phenotype 349.

PHENO350

Simulated phenotype 350.

PHENO351

Simulated phenotype 351.

PHENO352

Simulated phenotype 352.

PHENO353

Simulated phenotype 353.

PHENO354

Simulated phenotype 354.

PHENO355

Simulated phenotype 355.

PHENO356

Simulated phenotype 356.

PHENO357

Simulated phenotype 357.

PHENO358

Simulated phenotype 358.

PHENO359

Simulated phenotype 359.

PHENO360

Simulated phenotype 360.

PHENO361

Simulated phenotype 361.

PHENO362

Simulated phenotype 362.

PHENO363

Simulated phenotype 363.

PHENO364

Simulated phenotype 364.

PHENO365

Simulated phenotype 365.

PHENO366

Simulated phenotype 366.

PHENO367

Simulated phenotype 367.

PHENO368

Simulated phenotype 368.

PHENO369

Simulated phenotype 369.

PHENO370

Simulated phenotype 370.

PHENO371

Simulated phenotype 371.

PHENO372

Simulated phenotype 372.

PHENO373

Simulated phenotype 373.

PHENO374

Simulated phenotype 374.

PHENO375

Simulated phenotype 375.

PHENO376

Simulated phenotype 376.

PHENO377

Simulated phenotype 377.

PHENO378

Simulated phenotype 378.

PHENO379

Simulated phenotype 379.

PHENO380

Simulated phenotype 380.

PHENO381

Simulated phenotype 381.

PHENO382

Simulated phenotype 382.

PHENO383

Simulated phenotype 383.

PHENO384

Simulated phenotype 384.

PHENO385

Simulated phenotype 385.

PHENO386

Simulated phenotype 386.

PHENO387

Simulated phenotype 387.

PHENO388

Simulated phenotype 388.

PHENO389

Simulated phenotype 389.

PHENO390

Simulated phenotype 390.

PHENO391

Simulated phenotype 391.

PHENO392

Simulated phenotype 392.

PHENO393

Simulated phenotype 393.

PHENO394

Simulated phenotype 394.

PHENO395

Simulated phenotype 395.

PHENO396

Simulated phenotype 396.

PHENO397

Simulated phenotype 397.

PHENO398

Simulated phenotype 398.

PHENO399

Simulated phenotype 399.

PHENO400

Simulated phenotype 400.

PHENO401

Simulated phenotype 401.

PHENO402

Simulated phenotype 402.

PHENO403

Simulated phenotype 403.

PHENO404

Simulated phenotype 404.

PHENO405

Simulated phenotype 405.

PHENO406

Simulated phenotype 406.

PHENO407

Simulated phenotype 407.

PHENO408

Simulated phenotype 408.

PHENO409

Simulated phenotype 409.

PHENO410

Simulated phenotype 410.

PHENO411

Simulated phenotype 411.

PHENO412

Simulated phenotype 412.

PHENO413

Simulated phenotype 413.

PHENO414

Simulated phenotype 414.

PHENO415

Simulated phenotype 415.

PHENO416

Simulated phenotype 416.

PHENO417

Simulated phenotype 417.

PHENO418

Simulated phenotype 418.

PHENO419

Simulated phenotype 419.

PHENO420

Simulated phenotype 420.

PHENO421

Simulated phenotype 421.

PHENO422

Simulated phenotype 422.

PHENO423

Simulated phenotype 423.

PHENO424

Simulated phenotype 424.

PHENO425

Simulated phenotype 425.

PHENO426

Simulated phenotype 426.

PHENO427

Simulated phenotype 427.

PHENO428

Simulated phenotype 428.

PHENO429

Simulated phenotype 429.

PHENO430

Simulated phenotype 430.

PHENO431

Simulated phenotype 431.

PHENO432

Simulated phenotype 432.

PHENO433

Simulated phenotype 433.

PHENO434

Simulated phenotype 434.

PHENO435

Simulated phenotype 435.

PHENO436

Simulated phenotype 436.

PHENO437

Simulated phenotype 437.

PHENO438

Simulated phenotype 438.

PHENO439

Simulated phenotype 439.

PHENO440

Simulated phenotype 440.

PHENO441

Simulated phenotype 441.

PHENO442

Simulated phenotype 442.

PHENO443

Simulated phenotype 443.

PHENO444

Simulated phenotype 444.

PHENO445

Simulated phenotype 445.

PHENO446

Simulated phenotype 446.

PHENO447

Simulated phenotype 447.

PHENO448

Simulated phenotype 448.

PHENO449

Simulated phenotype 449.

PHENO450

Simulated phenotype 450.

PHENO451

Simulated phenotype 451.

PHENO452

Simulated phenotype 452.

PHENO453

Simulated phenotype 453.

PHENO454

Simulated phenotype 454.

PHENO455

Simulated phenotype 455.

PHENO456

Simulated phenotype 456.

PHENO457

Simulated phenotype 457.

PHENO458

Simulated phenotype 458.

PHENO459

Simulated phenotype 459.

PHENO460

Simulated phenotype 460.

PHENO461

Simulated phenotype 461.

PHENO462

Simulated phenotype 462.

PHENO463

Simulated phenotype 463.

PHENO464

Simulated phenotype 464.

PHENO465

Simulated phenotype 465.

PHENO466

Simulated phenotype 466.

PHENO467

Simulated phenotype 467.

PHENO468

Simulated phenotype 468.

PHENO469

Simulated phenotype 469.

PHENO470

Simulated phenotype 470.

PHENO471

Simulated phenotype 471.

PHENO472

Simulated phenotype 472.

PHENO473

Simulated phenotype 473.

PHENO474

Simulated phenotype 474.

PHENO475

Simulated phenotype 475.

PHENO476

Simulated phenotype 476.

PHENO477

Simulated phenotype 477.

PHENO478

Simulated phenotype 478.

PHENO479

Simulated phenotype 479.

PHENO480

Simulated phenotype 480.

PHENO481

Simulated phenotype 481.

PHENO482

Simulated phenotype 482.

PHENO483

Simulated phenotype 483.

PHENO484

Simulated phenotype 484.

PHENO485

Simulated phenotype 485.

PHENO486

Simulated phenotype 486.

PHENO487

Simulated phenotype 487.

PHENO488

Simulated phenotype 488.

PHENO489

Simulated phenotype 489.

PHENO490

Simulated phenotype 490.

PHENO491

Simulated phenotype 491.

PHENO492

Simulated phenotype 492.

PHENO493

Simulated phenotype 493.

PHENO494

Simulated phenotype 494.

PHENO495

Simulated phenotype 495.

PHENO496

Simulated phenotype 496.

PHENO497

Simulated phenotype 497.

PHENO498

Simulated phenotype 498.

PHENO499

Simulated phenotype 499.

PHENO500

Simulated phenotype 500.

Source

<https://doi.org/10.21203/rs.3.rs-873449/v1>


Single-iteration paired permutation for large-scale biobank data with relatedness

Description

# This function performs paired permutation for permuting phenotype vectors among related individuals in biobank data.

Usage

sip_pair(
  df = NULL,
  id.var = NULL,
  sex.var = NULL,
  male.val = NULL,
  female.val = NULL,
  geno.vars = NULL,
  within.sex = TRUE,
  seed = NULL,
  rel.df = NULL,
  rid.vars = NULL,
  ibd.var = NULL
)

Arguments

df, rel.df

Data frame

id.var, sex.var, ibd.var

Strings

male.val, female.val

Strings or integers

geno.vars, rid.vars

Character vectors

within.sex

Boolean, defaults to TRUE

seed

Number

Details

The function requires the following inputs:

1) A sample-by-variable data frame with phenotypes and covariates. Column names should include an ID variable, sex variable, genotypic covariate names, phenotypic covariate names, and phenotype names. (N.B. a secondary ID variable can be included in the genotypic covariate names.)

2) A string identifying the ID variable name (e.g., id.var="ID").

3) A vector of genotypic covariates (e.g., geno.vars=c("ID2","Batch","PC1","PC2",...)).

4) A relatedness data frame containing identity-by-descent (IBD) for pairs of individuals in the sample-by-variable data frame. Column names should include two ID variables and an IBD variable.

5) A vector of the 2 ID variable names in the relatedness data frame. (e.g., rid.vars=c("ID1","ID2")).

6) A string identifying the IBD variable name (e.g., ibd.var="PropIBD").

7) Optional: within.sex = FALSE. Default is within.sex = TRUE and will permute males and females separately.

8) If within.sex = TRUE (the default), a string identifying the sex variable name (e.g., sex.var="Inferred_Sex").

9) If within.sex = TRUE (the default), male and female values in the sex vector (e.g., male.val=1, female.val=2).

10) Optional: a seed for sampling. If a seed is not provided, one will be chosen randomly during the sampling process (e.g., seed=123).

11) N.B. Any column names not specified in (2)-(9) are assumed to be phenotypes or phenotypic covariates.

Value

Data frame

Examples

sip_pair(df = sipPair_exampleData, id.var = "IID",
sex.var = "SEX", male.val = "M", female.val = "F",
geno.vars = c("FID","BATCH",paste0("PC",1:4)),
rel.df = sipPair_relatednessData, rid.vars=c("IID1","IID2"),
ibd.var="PropIBD")