multipleInsertionDiagram: Display multiple insertion events around a genome

Description Usage Arguments Value Warning See Also Examples

View source: R/gmoviz.R

Description

Generates a diagram which displays multiple insertion events (as displayed using the insertionDiagram function) around a central genome

Usage

1
2
3
4
5
multipleInsertionDiagram(insertion_data, genome_ideogram_data,
  either_side = "default", track_height = 0.15, style = 1,
  colour_set = nice_colours, coverage_rectangle = NULL,
  coverage_data = NULL, label_data = NULL, label_colour = "black",
  label_size = 1, xaxis_spacing = "start_end")

Arguments

insertion_data

A GRanges or data frame describing each of the insertion events. Please see insertionDiagram for a detailed description of the format.

genome_ideogram_data

Either a GRanges representing regions of interest or a data frame in bed format (containing the chr, start and end columns). If you want to read in data from file, please see the getIdeogramData function.

either_side

How much extra of the genome should be shown around the insertion site. See insertionDiagram for a description of the different ways you can specify either_side, but note that for this function you need to supply either one value (which will apply to all of the events) or a named list of values (with one element per event. The names should be the names of the insertion _NOT_ the names of the chromosomes).

track_height

The height (vertical distance around the circle) that will be taken up by this track. Should be a number between 0 (none) and 1 (entire circle) that will apply to all of the events.

style

How the original sequence and insertions are positioned around the circle (style 1, 2, 3 or 4). Please see the examples of the insertionDiagram function or the vignette for what each of these options look like. This should be either a single value (which will apply to all of the events) or a named vector of values (with one element per event).

colour_set

The set of colours that will be used to create the diagram. For simplicity, it isn't possible to specify precisely the colour of each sector and link in the diagram (but you can easily edit them by saving the diagram in a vectorised format and opening it in any vector graphics editing program). See colourSets for the built-in gmoviz colour sets or make your own (should be a vector of hex colours; must have a length greater than or equal to the number of rows of genome_ideogram_data)

coverage_rectangle

A vector containing the name(s) of any sector(s) that you would like to depict as 'coverage rectangles': filled in shapes that are a plot of the coverage data over that sector. See the example below or the vignette for an example of this.

coverage_data

A GRanges (or data frame) containing the coverage data to plot for those sectors in coverage_rectangle. To read this data in from a BAM file, please see the getCoverage function.

label_data

Data frame or GRanges containing the labels. If a GRanges, label should be a metadata column containing the character strings of the labels. type and colour can also be used to store additional information about the type (e.g. 'gene' or 'promoter') and colour of the label. This information can be used to colour code the labels by supplying the colour column as the label_colour parameter. Data frames should additionally include the chr, start, end which dictate the position of the label.

label_colour

Colour of the labels, can be either a single value (applied to all labels) or a vector with the same length as the number of labels (for colour-coding).

label_size

Size of the labels.

xaxis_spacing

Space between the x axis labels, in degrees. Alternatively, the string 'start_end' will place a label at the start and end of each sector only. Accepts only a single value which will be applied to all events.

Value

Generates an image of the multiple insertion events provided.

Warning

Due to space limitations, it isn't possible to display more than 8 events or more than 3 events in the same quarter of the circle. If you have more events than this, please consider splitting them across two or more figures.

See Also

insertionDiagram for a function which generates the figures for each of the individual events and gmovizInitialise for the function which draws the central genome

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
## the data
ideogram_data <- GRanges(
seqnames=paste0('chr', 1:6), ranges=IRanges(start=rep(0, 6),
 end=rep(12000, 6)))
insertion_data <- GRanges(
seqnames = c('chr1', 'chr5'),
ranges = IRanges(start = c(4000, 2000), end = c(4100, 2200)),
name = c('ins1', 'ins5'), length = c(100, 200))

## the plot
multipleInsertionDiagram(insertion_data=insertion_data,
                         genome_ideogram_data=ideogram_data)
## with coverage and labels
example_labels <- GRanges(seqnames=c('chr1', 'chr5'),
                          ranges=IRanges(start=c(4000, 2000),
                          end=c(4120, 2200)),
                          label=c('Gene A', 'Gene B'),
                          colour=c('red', 'blue'))

example_coverage <- GRanges(
seqnames = c(rep('chr1', 100), rep('chr5', 100)),
ranges = IRanges(start=c(seq(4000, 4099, length.out=100),
                         seq(2000, 2199, length.out=100)),
                 end=c(seq(4001, 4100, length.out=100),
                       seq(2001, 2200, length.out=100))),
                 coverage=c(runif(100, 0, 25), runif(100, 0, 15)))
multipleInsertionDiagram(insertion_data=insertion_data,
                         genome_ideogram_data=ideogram_data,
                         label_data=example_labels,
                         label_colour=example_labels$colour,
                         coverage_rectangle=c('chr1', 'chr5'),
                         coverage_data=example_coverage)
## changing either_side and style
either_side_GRange <- GRanges('chr5', IRanges(1000, 3200))
multipleInsertionDiagram(insertion_data=insertion_data,
                         genome_ideogram_data=ideogram_data,
                         style=c('ins1'=1, 'ins5'=4),
                         either_side=list('ins1'=500,
                                            'ins5'=either_side_GRange))

gmoviz documentation built on Nov. 8, 2020, 5:41 p.m.