plotIBDsegments: Plot IBD Segments

Description Usage Arguments See Also Examples

Description

plotIBDsegments() plots IBD segments for pairs across the genome. IBD segments are depicted by colored blocks.

Usage

1
2
3
4
5
6
7
plotIBDsegments(ped.genotypes, ibd.segments, 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,
  segment.height = 0.5, segment.color = NULL, number.per.page = NULL,
  fid.label = TRUE, iid.label = TRUE, ylabel.size = 9, add.rug = FALSE,
  plot.title = NULL, add.legend = TRUE)

Arguments

ped.genotypes

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

ibd.segments

A data frame containing the IBD segments inferred from pairs of isolates See the returned value in getIBDsegments for more details.

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 the segments over all chromosomes.

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 representing 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.

segment.height

A numeric value giving the hight of IBD segment blocks, such that 0 < segment.height <= 1. The default is segment.height=0.5.

segment.color

A vector of characters or numeric values denoting the color of the segments to be plotted. Two colors must be specified, one for segments with 1 allele IBD and one for segments with 2 alleles IBD.

number.per.page

A numeric value indicating the maximum number of IBD pairs to plot in a single graphics window. The default is number.per.page=NULL which will plot all IBD pairs in a single window. This may not be ideal when there are many IBD pairs. If number.per.page is set, it is recommended to plot the output to a file as opposed to the R plotting window.

fid.label

Logical. If fid.label=TRUE, family IDs will be included in the y-axis labels; otherwise family IDs will be omitted. The default is add.fid.name=TRUE.

iid.label

Logical. If iid.label=TRUE, isolate IDs will be included in the y-axis labels; otherwise isolate IDs will be omitted. The default is add.iid.name=TRUE.

ylabel.size

A numeric value indicating the size of the y-axis labels if drawn. The default is ylabel.size=9.

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. If add.legend=TRUE, a legend specifying the IBD status (1 allele IBD or 2 alleles IBD) will be included. The default is add.legend=TRUE.

See Also

getGenotypes and getIBDsegments.

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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# plot IBD segments
plotIBDsegments(ped.genotypes = png_genotypes,
                ibd.segments = png_ibd,
                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,
                segment.height = 0.6,
                number.per.page = NULL,
                fid.label = FALSE,
                iid.label = FALSE,
                ylabel.size = 9,
                add.rug = FALSE,
                plot.title = "Distribution of IBD segments in PNG",
                add.legend = TRUE,
                segment.color = NULL)

# plot IBD segments over an interval: chromosome 7: 350000 - 550000
plotIBDsegments(ped.genotypes = png_genotypes,
                ibd.segments = png_ibd,
                interval = c("Pf3D7_07_v3",350000,550000),
                annotation.genes = annotation_genes,
                annotation.genes.color = NULL,
                highlight.genes = highlight_genes,
                highlight.genes.labels = FALSE,
                highlight.genes.color = NULL,
                highlight.genes.alpha = 0.1,
                segment.height = 0.8,
                number.per.page = NULL,
                fid.label = FALSE,
                iid.label = FALSE,
                ylabel.size = 9,
                add.rug = TRUE,
                plot.title = "Distribution of IBD segments in PNG",
                add.legend = TRUE,
                segment.color = c("purple","green"))

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