plotIBDiR: Plot iR Statistics

Description Usage Arguments See Also Examples

Description

plotIBDiR() plots the -log10 (p-values) used to assess the significance of excess IBD sharing.

Usage

1
2
3
4
5
6
plotIBDiR(ibd.iR, interval = NULL, annotation.genes = NULL,
  annotation.genes.color = NULL, highlight.genes = NULL,
  highlight.genes.labels = TRUE, highlight.genes.color = NULL,
  highlight.genes.alpha = 0.1, point.size = 1, point.color = NULL,
  add.rug = FALSE, plot.title = NULL, add.legend = FALSE,
  facet.label = TRUE, facet.scales = "fixed")

Arguments

ibd.iR

A data frame containing the iR summary statistics for each SNP. See the returned Value in getIBDiR for more details. If multiple subpopulations are specified (column name "subpop") then the iR statistics for each subpopulation will be plotted on a separate facet in the figure (see http://docs.ggplot2.org/current/facet_grid.html on faceting). If there are many subpopulations (>8) it may be better to plot subsets of the subpopulations as apposed to all subpopulations in a single figure. If multiple populations (column name "pop") are specified then only the first population will be included in the figure. Genomic locations of annotation genes can be included in the figure and specific intervals can be highlighted.

interval

A vector of length 3 containing the genomic locations of a specific region to plot. This vector should contain the chromosome ID, the start of the interval in base-pairs and the end of the interval in base-pairs; in this order respectively. The default is interval=NULL which will plot iR statistics over all chromosomes in ibd.iR.

annotation.genes

A data frame containing information on annotation genes to be included in the figure. This data frame must have at least 5 columns of information:

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

  2. Gene name (type "character")

  3. Start location of the gene in base-pairs (type "numeric" or "integer")

  4. End location of the gene in base-pairs (type "numeric" or "integer")

  5. Gene strand (+ or -) (type "character")

annotation.genes must contain the following headers chr, name, start, end and strand. This data frame does not have to be in a specific order, however it must contain all of the above information with respective labels. The default is annotation.genes=NULL.

annotation.genes.color

A vector of characters or numeric values containing the two colors according to gene stand (positive (+) or negative (-))

highlight.genes

A data frame containing information of genes or regions to highlight. The data frame must have at least 4 columns of information:

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

  2. Gene name (type "character")

  3. Start location of the gene in base-pairs (type "numeric" or "integer")

  4. End location of the gene in base-pairs (type "numeric" or "integer")

highlight.genes should contain the following headers chr, name, start and end. This data frame does not have to be in a specific order, however it must contain all of the above information with respective labels. The default is highlight.genes=NULL.

highlight.genes.labels

Logical. Whether to include gene names as labels in the figure. The default is highlight.genes.labels=FALSE.

highlight.genes.color

Character string or numeric value. A single color that will be used to highlight a region/gene. The default is highlight.genes.color=NULL.

highlight.genes.alpha

Numeric. A single value between 0 and 1 indicating the gene color transparency. The default is highlight.genes.alpha=0.1.

point.size

Numeric. The size of the points in the figures. The default is point.size=1.

point.color

A vector of characters or numeric values denoting the color of points to be plotted. If there are multiple subpopulations then the number of colors specified should equal the number of subpopulations. The default is point.color=NULL which will use isoRelate default colors.

add.rug

Logical. Whether to include SNP positions as a rug in the figure. The default is add.rug=FALSE

plot.title

A character string of a title to be added to the figure The default is plot.title=NULL which does not add a title to the plot.

add.legend

Logical. Whether a legend containing subpopulation information should be plotted. The default is add.legend=FALSE.

facet.label

Logical. Whether to include facet labels if multiple subpopulations (column name "subpop") are specified.

facet.scales

A character string of either "fixed", "free", "free_x" or "free_y" specifying the facet axis-scales. The default is facet.scales="fixed"

See Also

getIBDiR

Examples

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

# calculate the significance of IBD sharing
my_iR <- getIBDiR(ped.genotypes = png_genotypes,
                  ibd.matrix = my_matrix,
                  groups = NULL)

# plot the iR statistics
plotIBDiR(ibd.iR = my_iR,
          interval = NULL,
          annotation.genes = NULL,
          annotation.genes.color = NULL,
          highlight.genes = NULL,
          highlight.genes.labels = FALSE,
          highlight.genes.color = NULL,
          highlight.genes.alpha = 0.1,
          point.size = 1,
          point.color = NULL,
          add.rug = FALSE,
          plot.title = "Significance of IBD sharing",
          add.legend = FALSE,
          facet.label = TRUE,
          facet.scales = "fixed")

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