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 = 10,
addMissingOTUAfter = NA,
addMissingOTUBefore = NA,
missOTUspacings = 0,
moveKarHor,
moveAllKarValueHor,
moveAllKarValueY,
karAnchorLeft,
karAnchorRight,
anchor,
anchorLineLty = 1,
anchorText = "",
anchorTextMParental,
anchorTextMoveX = 0.5,
anchorTextMoveY = 1,
anchorTextMoveParenX = 0,
anchorTextMoveParenY = 0,
anchorVsizeF = 0.5,
pchAnchor = 23,
moveAnchorV = 0,
moveAnchorH = 0,
mkhValue = 0.5,
n = 50,
notes,
leftNotes,
leftNotesUp,
notesTextSize = 0.4,
notesLeft,
notesPosX = 0.5,
notesPosY = 0,
leftNotesPosX = 0.5,
leftNotesPosY = 0,
leftNotesUpPosY = 0,
leftNoteFont = 1,
leftNoteFontUp = 1,
noteFont = 1,
parseTypes = TRUE,
parseStr2lang = FALSE,
propWidth = FALSE,
MbThreshold = 10000,
threshold = 35,
MbUnit = "Mb",
yTitle = "m",
specialyTitle = "cM",
specialOTUNames = "",
addOTUName = TRUE,
OTUTextSize = 1,
OTUfont,
OTUfamily,
OTUasNote = FALSE,
OTUasLeftNote = FALSE,
orderChr = "size",
chrId = "original",
classMbName = "Pm.",
classcMName = "L.G.",
classChrName = "Chr.",
classChrNameUp = "Type",
classGroupName = "",
chrNameUp = FALSE,
chrIdPatternRem,
indexIdTextSize = 1,
distTextChr = 1,
groupUp = FALSE,
groupName = TRUE,
groupSepar = 0.5,
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 = NULL,
gishCenBorder,
hideCenLines = 1.75,
roundedCen = TRUE,
squareness = 4,
lwd.chr = 0.5,
lwd.cM,
lwd.marks,
dfMarkPos,
dfCenMarks,
defaultStyleMark = "square",
markDistType = "beg",
protruding = 0.2,
origin = "b",
efZero = 1e-05,
cMBeginCenter = FALSE,
arrowhead = 0.3,
shrinkArrow = 0.3333,
arrowheadWidthShrink = 0.1,
arrowsToSide = TRUE,
useOneDot = FALSE,
dotsAsOval = FALSE,
dfMarkColor,
mycolors,
borderOfWhiteMarks = TRUE,
colorBorderMark,
lwd.mimicCen,
defCenStyleCol,
pattern = "",
legend = "aside",
remSimiMarkLeg = FALSE,
bannedMarkName,
bannedMarkNameAside = FALSE,
forbiddenMark,
legendWidth = 1.7,
legendHeight = NA,
markLabelSize = 1,
markLabelSpacer = 1,
legendYcoord = 0,
markNewLine = NA,
mylheight = 0.7,
chrSize = FALSE,
nsmall = 1,
chrSizeMbp = FALSE,
markPer = "",
showMarkPos = FALSE,
bToRemove = "",
perAsFraction = FALSE,
chrIndex = "both",
morpho = "both",
nameChrIndexPos = 2,
karIndex = TRUE,
karIndexPos = 0.5,
ruler = TRUE,
useMinorTicks = FALSE,
miniTickFactor = 10,
rulerPos = 0,
ruler.tck = -0.02,
rulerNumberPos = 0.5,
rulerNumberSize = 1,
rulerInterval,
rulerIntervalcM,
rulerIntervalMb,
ceilingFactor = 0,
xPosRulerTitle = 2.6,
yPosRulerTitle = 0,
rulerTitleSize = 1,
xlimLeftMod = 1,
xlimRightMod = 2,
ylimBotMod = 0.2,
ylimTopMod = 0.2,
callPlot = TRUE,
asp = 1,
circularPlot = FALSE,
verticalPlot = TRUE,
karSpaceHor = 0,
shrinkFactor = 0.9,
separFactor = 1.5,
labelSpacing = 0.7,
labelOutwards = FALSE,
chrLabelSpacing = 0.5,
radius = 0.5,
rotation = 0.5,
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")
character, when you want to add space (ghost OTUs) before one or several OTUs, pass the names of OTUs after 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
character, OTUs' names of karyotypes that should be moved horizontally. See mkhValue
numeric, similar to mkhValue, but affects all karyotypes.
numeric, similar to moveAllKarValueHor, but affects y axis.
character, OTUs' add anchor to the left of this OTU names of karyotypes. For verticalPlot=FALSE
character, OTUs' add anchor to the right of this OTU names of karyotypes. For verticalPlot=FALSE
boolean, when TRUE, plots a parent progeny structure in karyotypes in moveKarHor. Or a horizontal anchor to the left/right
of karAnchorLeft, karAnchorRight when verticalPlot=FALSE
numeric, type of line in anchor, corresponds to lty. Defaults to 1
character, text to add to anchor structure near symbol. See anchor. Defaults to ""
character, designed to fill with a character object the space left of a missing parental in the anchor structure.
numeric, for vertical plots with anchorText move text in X axis. Defaults to 0.5
numeric, for horizontal plots with anchorText move text in Y axis. Defaults to 1
numeric, for plots with anchorTextMParental move text in X axis. Defaults to 0
numeric, for plots with anchorTextMParental move text in Y axis. Defaults to 0
numeric, factor to modify vertical size of anchor 0.5 (default). Size itself is equal to karHeiSpace
numeric, symbol for anchor, see ?points and anchor
numeric, displace anchor vertical portion to right or left. See anchor
numeric, displace anchor horizontal portion to right or left. See anchor
numeric, value to move kar. hor. See moveKarHor
numeric vertices number for round corners
data.frame, (to the right), with columns OTU and note for adding notes to each OTU, they appear to the right of chromosomes
data.frame, (to the left), with columns OTU and note for adding notes to each OTU, they appear to the left of chromosomes
data.frame, (to the left), similar to leftNotes, but intended for placement over chr.
numeric, font size of notes, see notes
deprecated, use a data.frame for leftNotes
numeric, move right notes to the right or left (x axis)
numeric, move right notes down or up (y axis)
numeric, move left notes to the right or left (x axis)
numeric, move left notes (leftNotes) down or up (y axis)
numeric, move up left notes (leftNotesUp) down or up (y axis)
numeric 1 for normal, 2 for bold, 3 for italics, 4 for bold-italics. See leftNotes
numeric 1 for normal, 2 for bold, 3 for italics, 4 for bold-italics. See leftNotesUp
numeric 1 for normal, 2 for bold, 3 for italics, 4 for bold-italics. See notes
boolean, parse in notes the Citrus chr. types names. Creates subindex pos. for FL. Defaults to TRUE. Incompatible with parseStr2lang
bolean, parse string in notes with function str2lang(paste0("paste(",note,")") ) for ex: "italic('C. sinensis'), ' Author'". See notes, leftNotes,leftNotesUp.
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, when 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, when TRUE adds OTU (species) name to the right, see notes
boolean, when TRUE adds OTU (species) name to the left-up, see leftNotesUp
character, when "size", sorts chromosomes by total
length from the largest to the smallest. "original": preserves d.f. order. "name": sorts alphabetically; "group": sorts by group name; "chrNameUp": sorts according to column chrNameUp. See chrNameUp
character, print name of chromosome, "original" uses the original
name in OTU column of dfChrSize, "simple" (just 1 to ...) or "" (none).
character, name of "chromosome" when in Mbp. Defaults to "Pm". See MbUnit
character, name of "chromosome" when OTU in specialOTUNames. Defaults to "L.G."
character, name of "chromosome" when in micrometers (apparently). Defaults to "Chr.". See specialOTUnames, classMbName, classcMName
character, name of "chromosome" for col. "chrNameUp". Defaults to "Type"
character, name of groups. Defaults to ""
boolean, when TRUE adds secondary chromosome name from col. chrNameUp over chrs. Defaults to FALSE
character, regex pattern to remove from chr. names
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 (default), shows group names. When FALSE only line
numeric, factor for affecting chr. spacing chrSpacing among groups. Defaults to 0.5
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. When chrColor is "white" this turns insto "black".
boolean, when TRUE, cen. mark border color is the same as mark color, ignoring colorBorderMark. No default.
numeric, factor to multiply line width (lwd) used for covering cen. border, when chrColor is white or when gishCenBorder=TRUE
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., some marks and ruler. Thick of cM marks when lwd.cM absent and other marks when lwd.marks absent. Defaults to 0.5
thickness of cM marks. Defaults to lwd.chr
thickness of most marks. Except cM marks and centr. related marks. See lwd.chr, lwd.cM. 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), "squareLeft", "dots", "cM", "cMLeft","cenStyle", "upArrow", "downArrow".
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.
numeric, numbers below this one will be considered as zero, for comparison purposes. Defaults to 1e-5
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). See arrowsBothChrt
boolean, use one dot instead of two in style of marks dots. Defaults to FALSE. Not useful for chromatids=TRUE
boolean, use oval instead of two dots in style of marks dots. Defaults to FALSE. See useOneDot. Not useful for chromatids=TRUE or circularPlot=TRUE
data.frame, optional, specifying colors and style for marks (sites);
columns: markName, markColor, style. style accepts: square, squareLeft, dots, cM,
"cMLeft", "cenStyle", "upArrow", "downArrow".
(if column style missing all (except 5S) are plotted as in param. defaultStyleMark).
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. Except when bannedMarkNameAside is used.
boolean, when TRUE and legend="inline", shows marks in bannedMarkName as legend="aside".
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 font 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, character to split mark Names into different lines. Applies to square marks. Defaults to NA
numeric, for markNewLine!=NA; is equivalent to lheight of par: "The line height multiplier. The height of a line of text (used to vertically space multi-line text) is found by multiplying the character height both by the current character expansion and by the line height multiplier." Defaults to 0.7.
boolean, when TRUE adds total chr size under each chr. Defaults to FALSE
numeric, rounding decimals for chrSize parameter. Defaults to 1
boolean, when TRUE adds total Mbp chr. size to each chr. provided, there is a Mbp column in dfChrSize data.frame. Defaults to FALSE. If data in columns shortArmSize, or col. chrSize is in millions ("Mbp"). Use chrSize=TRUE not this one (not column Mbp, you don't need this).
character, name of mark to calculate % of mark in chr. and add it to plot. See perAsFraction
boolean, adds position of marks under karyotype (fraction 0-1) when TRUE. Defaults to FALSE
character, bands to remove from calc. of pos.
boolean, when TRUE % is shown as fraction. Defaults to FALSE. See markPer
character, add arm ratio with "AR" and centromeric index with "CI", or "both" (Default), or "" for none
character, when "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
boolean, display minor ticks between labeled ticks in ruler. See miniTickFactor. Defaults to FALSE. (ticks without label)
numeric, number of minor ticks for each labeled tick. See useMinorTicks. Defaults to 10
numeric, absolute position of ruler, corresponds to pos
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. Defaults to 2.6. A value of 2.6 means 2.6 times the value of chrSpacing to the left, from the first chr.
numeric, affects vertical position of ruler title. Defaults to 0
numeric font size of units of ruler. See also xPosRulerTitle
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. Defaults to 1
boolean, if TRUE chromosomes/karyotypes are plotted in concentric circles. Defaults to FALSE
boolean, when TRUE karyotypes are plotted vertically, otherwise, horizontally Defaults to TRUE
numeric, separation among horizontal karyotypes. When verticalPlot=FALSE. Defaults to 0
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\) )
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