This function reads a data.frame passed to dfChrSize with columns: chrName (mono/holo) and
shortArmSize and longArmSize for monocentrics or a column chrSize for holocentrics and produces a plot of idiograms. If more
than one species, a column named OTU is needed.
Optionally, it reads another data.frame passed to dfMarkPos with the position of
marks (sites). Examples: markposDFs. Another data.frame for mark characteristics
can be used dfMarkColor or a character vector passed to mycolors
plotIdiograms( dfChrSize, defaultFontFamily, revOTUs = FALSE,
karHeight = 2, karHeiSpace = 2.5, karSepar = TRUE, amoSepar = 9,
addMissingOTUAfter = NA, missOTUspacings = 0, n = 50, notes,
notesTextSize = 0.4, notesPos = 0.5, propWidth = FALSE, MbThreshold = 10000,
threshold = 35, MbUnit = "Mb", yTitle = "m", specialyTitle = "cM",
specialOTUNames = "", addOTUName = TRUE, OTUTextSize = 1, OTUfont, OTUfamily,
OTUasNote = FALSE, orderBySize = TRUE, chrId = "original", indexIdTextSize = 1,
distTextChr = 1, groupUp = FALSE, chromatids = TRUE, arrowsBothChrt = TRUE,
holocenNotAsChromatids = FALSE, excHoloFrArrToSide = FALSE, xModifier,
xModMonoHoloRate, chrWidth = 0.5, chrSpacing = 0.5, specialChrWidth = 0.3,
specialChrSpacing = 0.7, chrColor = "gray", chrBorderColor,
centromereSize = NA, cenColor, fixCenBorder, roundedCen = TRUE, squareness = 4,
lwd.chr = 0.5, lwd.cM, dfMarkPos, dfCenMarks, defaultStyleMark = "square",
markDistType = "beg", protruding = 0.2, origin = "b", cMBeginCenter = FALSE,
arrowhead = 0.3, shrinkArrow = 0.3333, arrowheadWidthShrink = 0.1,
arrowsToSide = TRUE, dfMarkColor, mycolors, borderOfWhiteMarks = TRUE,
colorBorderMark, lwd.mimicCen, defCenStyleCol, pattern = "", legend = "aside",
remSimiMarkLeg = FALSE, bannedMarkName, legendWidth = 1.7, legendHeight = NA,
markLabelSize = 1, markLabelSpacer = 1, legendYcoord = 0, chrIndex = "both",
morpho = "both", nameChrIndexPos = 2, karIndex = TRUE, karIndexPos = 0.5,
ruler = TRUE, rulerPos = 0, rulerPosMod = 0, ruler.tck = -0.02,
rulerNumberPos = 0.5, rulerNumberSize = 1, rulerInterval, rulerIntervalcM,
rulerIntervalMb, ceilingFactor = 0, ylabline = 0, rulerTitleSize = 1,
xlimLeftMod = 1, xlimRightMod = 2, ylimBotMod = 0.2, ylimTopMod = 0.2,
callPlot = TRUE, asp = 1, circularPlot = FALSE, shrinkFactor = 0.9,
separFactor = 1.5, labelSpacing = 0.7, labelOutwards = FALSE,
chrLabelSpacing = 0.5, radius = 0.5, rotation = 0.5, useOneDot = TRUE,
circleCenter = 1, circleCenterY = 1, OTUlabelSpacing = 0.3, OTUsrt = 0,
OTUplacing = "first", OTULabelSpacerx = 0, OTULabelSpacery = 0,
OTUcentered = TRUE, OTUjustif = 0, OTUlegendHeight = NA, roundness, ...
)mandatory data.frame, with columns: OTU (optional), chrName (mandatory),
shortArmSize, longArmSize for monocen. or chrSize for holocen.
character. use this as the font family. No default value.
boolean, The order of species is the one in the main
data.frame, use TRUE to reverse
numeric, vertical size of karyotypes. See also karHeiSpace. Defaults to 2
numeric, vertical size of karyotypes including spacing. Proportional to karHeight, if overlap, increase. Defautl value 2.5
boolean, reduce distance among karyotypes FALSE = equally
sized karyotypes or TRUE = equally spaced karyotypes. Incompatible with addMissingOTUAfter
numeric, depends on karSepar=TRUE, if zero your
karyotypes will have no distance among them, if overlap,
increase this and karHeiSpace
character, when you want to add space (ghost OTUs) after one or several OTUs, pass the names of OTUs preceding the desired space in a character vector i.e. c("species one","species five")
numeric, when you use addMissingOTUAfter this numeric vector should have the same length and corresponds to the number of free spaces (ghost OTUs) to add after each OTU respectively
numeric vertices number for round corners
data.frame, optional, with columns OTU and note for adding notes to each OTU, they appear to the right of chromosomes
numeric, font size of notes, see notes
numeric, move notes to the right
boolean, defaults to FALSE. Diminishes chr. width with increasing number of OTUs
numeric, if greater than this number (defaults to 10000), MbUnit will apply and specialyTitle will not.
this is the max. value allowed for the main two significative digits, otherwise scale will shrink. For example, after 35 \(\mu m\) (Default), apparent size will be 3.5 and scale interval will change. See also ceilingFactor, you may have to use -1. Introduced in 1.13
character, text of units of title when MbThreshold met and OTU not in specialOTUNames. See specialyTitle
Defaults to "Mb", but anything can be used. Introduced in 1.13. See specialyTitle
character, units for common title. Defaults to \(\mu m\)
character, title of ruler if OTU is in specialOTUNames. Will not apply if MbThreshold met. In that case use MbUnit
character vector, normally title of ruler is micrometer or Mb (big numbers). Use this param. to be able to put a different unit in ruler title. See "specialyTitle"
boolean, if TRUE adds OTU (species) name to karyotype
numeric, font size of OTU name (species). Defaults to 1. When OTUasNote is TRUE, use notesTextSize instead
numeric, 1 for normal, 2 for bold, 3 for italics, 4 for bold-italics
character, font family for OTU name.
boolean, if TRUE adds OTU (species) name to the right, see notes
logical value, when TRUE, sorts chromosomes by total
length from the largest to the smallest
character, print name of chromosome, "original" uses the original
name in OTU column of dfChrSize, "simple" (just 1 to ...) or "" (none).
numeric, font size of chr. and kar. indices and
chromosome name. Defaults to 1
numeric, distance from name of chromosome to chromosome,
also affects vertical separation of indices. Defaults to 1
boolean, when TRUE when groups present, they appear over the chr. name. Defaults to FALSE
boolean, when TRUE shows separated chromatids. Defaults to TRUE
boolean, when TRUE (default) (for chromatids=TRUE) shows upArrow, downArrow styles of marks in both chromatids when arrowsToSide=TRUE.
boolean, when TRUE and chromatids=TRUE does not plot holocen kar. with chromatids. Defaults to FALSE. A value of TRUE modifies excHoloFrArrToSide to TRUE always.
boolean, when arrowsToSide=TRUE, excludes holocen. from this behaviour, plotting a centered arrow only.
numeric, for chromatids=TRUE, separation among chromatids
numeric, factor to shrink xModifier for holocen. 5 means 5 times smaller (quotient).
numeric, relative chromosome width. Defaults to 0.5
numeric, horizontal spacing among chromosomes, see also chrWidth. Defaults to 0.5
numeric, relative chromosome width. Defaults to 0.5 for OTUs in specialOTUNames
numeric, horizontal spacing among chromosomes for OTUs in specialOTUNames, see also chrWidth. Defaults to 0.5
character, main color for chromosomes. Defaults to "gray"
character, color for border of chromosomes, defaults to chrColor
numeric, optional, this establishes the apparent size of cen. in the plot in \(\mu\)m. Automatic when NA. Default: NA
character, color for centromeres, if GISH use NULL or NA. Defaults to chrColor
boolean, when TRUE uses chrColor as centromere (and cen. mark) border color. See also cenColor,
chrColor, colorBorderMark, borderOfWhiteMarks. No default value.
boolean, when FALSE, cen has triangular aspect. When TRUE, it has rounded aspect (Default).
numeric, shape of vertices of chromosomes and square marks,
higher values more squared. Defaults to 4
thickness of border of chr., marks; ruler. Also thick of cM marks if lwd.cM absent Defaults to 0.5
thickness of cM marks. Defaults to lwd.chr
data.frame of marks (sites): columns: OTU (opt), chrName,
markName (name of site), chrRegion (for monocen. and opt for whole arm (w) in holocen.), markDistCen (for monocen.),
markPos (for holocen.), markSize; column chrRegion:
use p for short arm, q for long arm, cen for centromeric mark and w for whole chr. mark; column
markDistCen: use distance from
centromere to mark, not necessary for cen. marks (cen), w, p, q (when whole arm). See also param. markDistType
data.frame, specific for centromeric marks. columns: chrName
and markName. See also dfMarkPos for another option to pass cen. marks
character, default style of mark, only used when style column of dfMarkColor data.frame is missing or in absence of this data.frame. Use "square" (default) "dots" or "cM". Introduced in 1.13
character, if "cen" = the distance you provided in data.frame (dfMarkPos) column markDistCen
or markPos is to the center of the mark, if "beg" = the distance you provided is to the
beginning of the mark (Default)
numeric, when style of mark is "cM", fraction of chrWidth to stretch marker. Defaults to 0.2. Introduced in 1.13
For non-monocentric chr. (for holocentrics only) Use "b" (default) if distance to mark in ("markPos" column in "dfMarkPos") data.frame measured from bottom of chromosome, use "t" for distance to mark from top of chr.
boolean, start position of cM and cMLeft marks. If TRUE, starts in the center (width) of chr. . Defaults to FALSE
numeric, proportion of head of arrow (mark styles: upArrow,downArrow). Defaults to 0.3
numeric, proportion, shrinks body of arrow. Defaults to 0.3333
numeric, proportion, shrinks head of arrow. Defaults to 0.1
boolean, when FALSE use a centered arrow, instead of an arrow next to chr. margins (TRUE, default)
data.frame, optional, specifying colors and style for marks (sites);
columns: markName, markColor, style. style accepts: square or dots or cM.
(if column style missing all (except 5S) are plotted as in param. defaultStyleMark). cM introduced in 1.13
character vector, optional, i.e. c("blue","red","green") for specifying color of marks in order of appearance. if diverges with number of marks will be recycled if dfMarkColor present, mycolors will be ignored. To know the
order of your marks use something like: unique(c(dfMarkPos$markName,dfCenMarks$markName) )
boolean, if TRUE (Default) uses black border for white marks. See dfMarkColor. Does not apply to marks with style cenStyle
character, without default, pass a name of a color to use as border of marks. See borderOfWhiteMarks
thickness of lines of cenStyle marks; affects only lateral borders. Defaults to lwd.chr
character, color of outer part of cenStyle marks. Defaults to white
REGEX pattern to remove from names of marks
character, "" for no legend; "inline" prints labels near
chromosomes; "aside" prints legend to the right of karyotypes (default). See markLabelSpacer
boolean, when legend="aside", if you use pattern, you can have several marks with same name. When TRUE this remove this pseudoduplicates from legend. Be sure that this pseudoduplicates have the same color, otherwise you should use FALSE (default).
character, character string or vector with mark names to be removed from plot. Not the marks but the labels.
numeric, factor to increase width of squares and of legend. Defaults to 1.7
numeric, factor to increase height of squares and dots of legend. Automatic.
numeric, only if legend != (not) "", size of the text of
labels of marks (legend). Defaults to 1
numeric, only if legend="aside", space from the
rightmost chr. to legend. Defaults to 1
numeric, modify Y position of legend when legend="aside"
character, add arm ratio with "AR" and centromeric index with "CI", or "both" (Default), or "" for none
character, if "both" (default) prints the Guerra and Levan classif of cen. position, use also "Guerra" or "Levan" or "" for none. See also ?armRatioCI.
numeric, modify position of name of chr. indices
logical, add karyotype indices A (intrachromosomal - centromere pos.) and A2 (interchromosomal asymmetry, variation among chromosome sizes)
numeric, move karyotype index
boolean, display ruler to the left of karyotype, when FALSE no ruler
numeric, absolute position of ruler, corresponds to pos
argument of axis R plot
numeric, modify position of ruler, corresponds to line
argument of axis R plot
numeric, tick size of ruler, corresponds to tck argument of
axis R plot. Defaults to -0.02
numeric, modify position of numbers of ruler. Defaults to 0.5
numeric, size of number's font in ruler. Defaults to 1
numeric, intervals in ruler. No default, automatic. Introduced in 1.13
numeric, intervals in ruler of OTU in specialOTUNames. No default. Introduced in 1.13
numeric, intervals in ruler of OTU with data in Mb (>MbThreshold) and absent from specialOTUNames. No default. Introduced in 1.13
numeric, affects number of decimals for ceiling. Affects max. value of ruler. Defaults to 0. When threshold is greater than 35 this may have to be negative. Introduced in 1.13
numeric, modify position of ruler title. See yTitle, specialyTitle, MbUnit
numeric font size of units of ruler. See also ylabline
numeric, modifies xlim left argument of plot
numeric, xlim right side modification by adding space to the right
of idiograms. Defaults to 2
numeric, modify ylim bottom argument of plot
numeric, modify ylim top argument of plot
boolean, create new plot in your device. Defaults to TRUE
numeric, y x aspect of plot. Defautls to 1
boolean, if TRUE chromosomes are plotted in concentric circles. Defaults to FALSE
numeric, for circularPlot=TRUE percentage of usage of circle. Defaults to 0.9
numeric, for circularPlot=TRUE modify separation of concentric karyotypes. Defaults to 1.5
numeric, for circularPlot=TRUE. Spacing of mark labels. Defaults to 0.7
boolean, inline labels projected outwards
numeric, for circularPlot=TRUE. Spacing of chr. labels. Defaults to 0.5
numeric, for circularPlot=TRUE. Affects radius of karyotypes. Defaults to 0.5
numeric, anti-clockwise rotation, defaults to 0.5 which rotates chr. from top to -90 degrees. (-0.5*\(\pi\) )
boolean, for circularPlot=TRUE. use one dot instead of two in style of marks dots. Defaults to TRUE
numeric, for circularPlot=TRUE. Coordinate X of center of circles. Affects legend="aside" position. Defaults to 1
numeric, for circularPlot=TRUE. Coordinate Y of center of circles. Affects legend="aside" position. Defaults to 1
numeric, for circularPlot=TRUE. Spacing for OTU names. Defaults to 0.3
numeric, for circularPlot=TRUE. Angle to use for OTU names. Defaults to 0
character, for circularPlot=TRUE. location of OTU name. Defaults to "first" plots name near
first chr. "number" places number near 1st chr. and index and name to the right or center.
"simple" place name to the right or center without numbering. See also OTUcentered
numeric, for circularPlot=TRUE and OTUplacing="number" or "simple". Modifies x names position
numeric, for circularPlot=TRUE and OTUplacing="number" or "simple". Modifies y names position
boolean, for circularPlot=TRUE and OTUplacing="number" or "simple". OTU name in center of circle
when TRUE, otherwise, to the right.
numeric, for circularPlot=TRUE and OTUplacing="number" or "simple". Justification of OTU name. 0 = left
(Default); use 0.5 for centered. See ?text -> adj
numeric, for circularPlot=TRUE and OTUplacing="number" or "simple". Modifies y names separation
deprecated, use squareness
accepts other arguments for the plot, see, ?plot
plot
# NOT RUN {
data(dfOfChrSize)
plotIdiograms(dfOfChrSize, ylimBotMod = .75, rulerPos=-.5)
plotIdiograms(dfOfChrSize, circularPlot = TRUE, chrLabelSpacing = 1)
plotIdiograms(dfChrSizeHolo, rulerPos=-.5)
# }
Run the code above in your browser using DataLab