new.IBD {CrypticIBDcheck}R Documentation

Create a data structure suitable for input to IBDcheck


Create a data structure suitable for input to IBDcheck. This is a wrapper function for the constructor function IBD that creates the object. The wrapper provides basic checks of the input and creates the and data frames required for an IBD object.


new.IBD(, Chromosome, Position, popsam, Gen_loc=NULL, 
        pvalue_HWE=NULL, subids=NULL, ...)


A snp.matrix object containing the genotypes. Rows correspond to subjects and columns correspond to SNPs.


a vector containing the chromosome numbers of the SNPs


a vector of physical map positions


A logical vector indicating whether each subject can be considered part of a random sample (TRUE) or not (FALSE). See Details for more information. Only those subjects for which popsam==TRUE are used for estimating conditional IBS probabilities and fitting LD models.


A vector of genetic map positions in centiMorgans. If NULL (the default), they will be inferred using the function SNPgenmap.


A vector of p-values from tests of Hardy-Weinberg proportions for each SNP. If NULL (the default), they will be filled in using all population sample subjects (popsam==TRUE) in


a vector of subject IDs


additional arguments to be passed to the constructor IBD


The arguments, Chromosome, Position and popsam are required. Only subjects with popsam==TRUE are used for estimating conditional IBS probabilities and fitting LD models; those with popsam==FALSE are excluded. A typical use of popsam is to exclude cases when the data are from case control study of a rare disease, where cases are oversampled relative to their frequency in the population but controls may be regarded as a population sample.

If Gen_loc is missing it is inferred from Position by the SNPgenmap function. Currently SNPgenmap assumes physical map positions are on build 36 of the human genome. If subids is missing, the row names of are used as subject identifiers.


An object of class IBD. See the help file for the constructor function IBD for details.


Annick Joelle Nembot-Simo, Jinko Graham and Brad McNeney

See Also



popsam<-Nhlsim$csct==0 #controls

## Not run: 
# Read PLINK-formatted data via the read.snps.pedfile() function of the 
# chopsticks package 
# [source(""); biocLite("chopsticks") to install]
# Assume PLINK data is in files mydata.ped and
mydata = read.snps.pedfile("mydata.ped")
# mydata is now a list with elements mydata$, mydata$ and 
# mydata$ Chromosome number and physical position of the SNPs 
# are in mydata$$chromosome and mydata$$position, respectively.

## End(Not run)

[Package CrypticIBDcheck version 0.3-3 Index]