Description Usage Arguments Value Feature data format See Also Examples
Adds to an existing plot a track which displays 'features'
(e.g. genes, indels, primer sequences etc) using coloured shapes. Note that
you must have initialised the circular plot (by
gmovizInitialise
first).
1 2 3 4 5 |
feature_data |
A data frame or GRanges containing the 'features' to plot.
Please see below for a detailed description of these
columns, and |
flipped_sector |
A vector of sectors that will have their genomic position (x values) reversed (ascending in anti-clockwise direction, as opposed to the usual ascending in a clock-wise direction). |
feature_label_cutoff |
To enhance readability when the shapes are
small, those labels belonging to features smaller than
|
track_height |
The height (proportion of the circle) taken up by
each track of features. The default value of |
feature_label_size |
Size of the feature labels. |
label_track_height |
Size of the track on which to plot the labels. |
coverage_rectangle, coverage_data |
If, when initialising the graph you
have used coverage_rectangleangle AND you want to plot features on the
outermost track (track 0), please fill these in the same as in your
|
internal |
For internal use only. |
feature_outline |
Should a black outline be drawn around the feature
shape? (It is recommended to set this to |
Adds a 'feature' track to an existing plot.
The feature data GRanges contains four metadata columns:
A character string which will be used to label the feature. It is suggested to keep this label relatively short, if possible.
A character string of a colour to use. Supports hex colours (e.g. #000000) and named R colours (e.g. red).
The shape that will be used to represent the feature:
'rectangle'
'forward_arrow'
'reverse_arrow'
'upwards_triangle'
(out of the circle).
'downwards_triangle'
(into the circle).
It is suggested to use
'forward_arrow'
for genes on the forward strand and
'reverse_arrow'
for genes on the reverse strand.
The index of the track on which to plot the feature:
0 represents the outermost track, where the ideogram rectangles that represent sequences/chromosomes are plotted.
1 is the conventional (default) track on which to plot a feature.
2, 3 and so on are further into the centre of the circle.
It is strongly recommended to keep the tracks below 3, otherwise there may not be enough space in the circle to fit them all.
These columns are all optional. If you don't supply them, then default values will be added as follows:
''
a colour allocated from rich_colours
'rectangle'
1
featureDiagram
for a function that, while
slightly less flexible, generates an entire visualisation in one go. Also
getFeatures
for a function that can read the feature data in
from a .gff file.
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 | ## plasmid map
plasmid_ideogram <- data.frame(chr='plasmid', start=0, end=2500)
plasmid_features <- GRanges(seqnames=rep('plasmid', 4),
ranges=IRanges(start=c(0, 451, 901, 1700), end=c(450, 900, 1400, 2200)),
colour = c('#d44a9f', '#4a91d4', '#7ad44a', '#d49d4a'),
label = c('promoter', 'gene', 'GFP', 'ampR'),
shape = c('rectangle', 'forward_arrow', 'forward_arrow', 'reverse_arrow'),
track = rep(1, 4))
## for a simple case like this you might as well use the featureDiagram
## function because it's only 1 function call, whereas here we need two:
gmovizInitialise(plasmid_ideogram)
drawFeatureTrack(plasmid_features)
## however the drawFeatureTrack function allows more flexibility e.g. if you
## want to add features to a plot containing numerical data for example:
## data
scatter_data <- GRanges(rep('plasmid', 50),
IRanges(start=sample(1:3000, 50), width=2),
scatter=rnorm(50, mean=4, sd=1))
## plotting
gmovizInitialise(plasmid_ideogram)
drawScatterplotTrack(plot_data=scatter_data)
drawFeatureTrack(plasmid_features, track_height = 0.15)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.