determineNonOverlapGenelayers: Non-overlapping gene layers for plotting

Description Usage Arguments Details Value Author(s)

View source: R/HLP_genelabels_plot.R

Description

Determine gene layers for plotting of genes in regional plot without overlap

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
determineNonOverlapGenelayers(
  gr,
  ystart = 0,
  ysize = 1,
  minDistance = 0.1,
  gene_name_column = NULL,
  prot_domain_column = NULL,
  scale.factor = 1,
  units = "user",
  sortGeneStart = FALSE
)

Arguments

gr

GRanges object containing gene coordinates.

ystart

numeric start y-coordinate for first layer.

ysize

numeric added to each new layer.

minDistance

numeric minimum distance for two genes to be considered as non-overlapping. If minDistance < 1, it is interpreted as ratio of the width of the full gr object.

gene_name_column

character giving column name of gene names in gr. If not NULL, overlapping gene names are considered additionally to gene coordinates.

prot_domain_column

character giving column name in gr with logical values indicating genes to be plotted with protein domains. For those, needed space in layer below the respective gene layer is considered when determining non-overlapping gene layers. Omitted if NULL.

scale.factor

numeric scale factor as used in regionalplot.genelabels. Required to determine character extension of gene names (if gene_name_column is not NULL).

units

character indicating units for strwidth-function, either "user", "inches" or "figure". Measurements in "user" units are only available after plot.new has been called. Required to determine character extension of gene names (if gene_name_column is not NULL).

sortGeneStart

logical. If TRUE, gene levels are sorted according to minimum start coordinate. Useful to keep free space for legend in a plot.

Details

This is a help function for regional plots. For a given set of genes, the functions determines separate layers necessary to plot the genes without overlapping.

Value

GRanges object with column ypos added to meta data.

Author(s)

Frank Ruehle


frankRuehle/systemsbio documentation built on Sept. 14, 2020, 1:18 a.m.