getIBDproportion: Proportion of Pairs IBD

Description Usage Arguments Value See Also Examples

Description

getIBDproportion() calculates the proportion of pairs inferred IBD at each SNP.

Usage

1
getIBDproportion(ped.genotypes, ibd.matrix, groups = NULL)

Arguments

ped.genotypes

A list containing 2 objects. See the Value description in getGenotypes for more details on this input.

ibd.matrix

A data frame containing the binary IBD information for each SNP and each pair. See the returned Value in getIBDmatrix for more details.

groups

A data frame with 3 columns of information:

  1. Family ID

  2. Isolate ID

  3. Group ID

where, if specified, IBD proportions are calculated for

  1. all pairs of isolates within the same group

  2. all pairwise-group comparisons where isolates belong to different groups

Group ID, for example, can be the geographic regions where the isolates were collected. The default is groups=NULL and IBD proportions will be calculated over all pairs.

Value

A data frame the following 7 columns:

  1. Chromosome (type "character", "numeric" or "integer")

  2. SNP identifiers (type "character")

  3. Genetic map distance (centi morgans, cM) (type "numeric")

  4. Base-pair position (type "integer")

  5. Population (type "character" or "numeric")

  6. Subpopulation (type "character" or "numeric")

  7. Proportion of pairs IBD (type "integer")

where each row describes a unique SNP. The column Population is filled with 1s by default, while Subpopulation contains the group IDs from groups, where the proportion of pairs IBD has been calculated for all isolates belonging to the same group as well as all isolates from different groups. If groups=NULL then Subpopulation will be filled with 1s also. The population columns have been included for plotting purposes. The data frame is headed chr, snp_id, pos_M, pos_bp, pop, subpop and prop_ibd respectively.

See Also

getGenotypes, getIBDmatrix and getIBDiR.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# generate a binary IBD matrix
my_matrix <- getIBDmatrix(ped.genotypes = png_genotypes,
                          ibd.segments = png_ibd)

# calculate the proportion of pairs IBD at each SNP
my_proportion <- getIBDproportion(ped.genotypes = png_genotypes,
                                  ibd.matrix = my_matrix,
                                  groups = NULL)

# creating a stratification dataset
my_groups <- png_genotypes[[1]][,1:3]
my_groups[1:10,"pid"] <- "a"
my_groups[11:25,"pid"] <- "b"
my_groups[26:38,"pid"] <- "c"

my_proportion <- getIBDproportion(ped.genotypes = png_genotypes,
                                  ibd.matrix = my_matrix,
                                  groups = my_groups)

head(my_proportion)

bahlolab/isoRelate documentation built on May 11, 2019, 5:25 p.m.