Go to home
Go to 2. Holocentrics Vignette
Go to 3. Groups Vignette
Go to 4. Phylogeny Vignette
Go to 5. Human Vignette
This guide shows the files to plot idiograms of measured karyotypes and optionally marks.
1 Load package
visit gitlab for installation instructions https://gitlab.com/ferroao/idiogramFISH
2 Get your chromosome size data
Initially you have to open your chromosome data as a data.frame.
From scratch:
# Example data.frame to write in R, use: (column OTU is optional if only 1 OTU)
mydfChrSize<-read.table(text=
" OTU chrName shortArmSize longArmSize
\"Species one\" 1 1.5 2.0
\"Species one\" 2 2.0 2.5
\"Species one\" 3 1.0 1.5
\"Species one\" B 2.0 3.5" , header=TRUE, stringsAsFactors=FALSE,fill=TRUE)
OTU | chrName | shortArmSize | longArmSize |
---|---|---|---|
Species one | 1 | 1.5 | 2.0 |
Species one | 2 | 2.0 | 2.5 |
Species one | 3 | 1.0 | 1.5 |
Species one | B | 2.0 | 3.5 |
loading saved data:
Initially, if you use RStudio, use menu “Session”, “Set working directory” for choosing your desired folder or:
Open your chromosome data data.frame importing it from a .csv (read.csv) or .xls file (readxl).
Editing a data.frame:
For fixing column names use:
3 Get marks general data
This data.frame is optional.
Open or make your mark data as a data.frame. This data.frame has the marks present in all karyotypes without position info. If style
column is not present it will be filled with square
during plotting.
# From scratch:
mydfMarkColor<-read.table(text=
" markName markColor style
5S red dots
45S green square
DAPI blue square
CMA yellow square
\"B mark\" black square" , header=TRUE, stringsAsFactors=FALSE,fill=TRUE)
markName | markColor | style |
---|---|---|
5S | red | dots |
45S | green | square |
DAPI | blue | square |
CMA | yellow | square |
B mark | black | square |
For fixing column names use:
4 Get marks positions data
Open or write your mark positions as a data.frame. This data.frame has the marks present in all karyotypes with position info. This data.frame has also the centromeric marks present in all karyotypes.
# We will use column OTU if data.frame because chromosome size df has it
mydfOfMarks<-read.table(text=
" OTU chrName markName chrRegion markSize markDistCen
\"Species one\" 1 45S p NA NA # no measure means whole arm
\"Species one\" 1 5S q 0.5 0.5
\"Species one\" B \"B mark\" w NA NA # w for whole chromosome
\"Species one\" 2 45S p 1 1.0
\"Species one\" 3 DAPI q 1 1.0
\"Species one\" 1 DAPI cen
\"Species one\" 3 CMA cen", header=TRUE, stringsAsFactors=FALSE,fill=TRUE)
OTU | chrName | markName | chrRegion | markSize | markDistCen |
---|---|---|---|---|---|
Species one | 1 | 45S | p | NA | NA |
Species one | 1 | 5S | q | 0.5 | 0.5 |
Species one | B | B mark | w | NA | NA |
Species one | 2 | 45S | p | 1.0 | 1.0 |
Species one | 3 | DAPI | q | 1.0 | 1.0 |
Species one | 1 | DAPI | cen | NA | NA |
Species one | 3 | CMA | cen | NA | NA |
For fixing column names use something like:
5 Add some text to the right
For ver. > 1.7
# We will use column note to add a note to the right of the karyotype of the OTU in column OTU
notesdf<-read.table(text=
" OTU note
\"Species one\" \"Author notes\" ", header=TRUE, stringsAsFactors=FALSE,fill=TRUE)
For adding just the OTU name (from column OTU
of data.frame of chr. size) to the right, use OTUasNote=TRUE
6 Plotting
You can plot without marks (use only 1st data.frame), but we will use all 4 data.frames created. By default the function will calculate indices (Romero-Zarco, 1986; Watanabe et al., 1999) and morphological categories of Guerra (1986) and Levan (1964). Use parameters chrIndex
and morpho
of the function plotIdiograms
to modify that. See ?plotIdiograms
.
# svg("mydfChrSize.svg",width=13,height=8 )
# par(mar = c(0, 0, 0, 0), omi=rep(0,4), oma=rep(0,4) )
plotIdiograms(dfChrSize= mydfChrSize, # chr. size data.frame
dfMarkPos= mydfOfMarks, # mark position data.frame (inc. cen.)
dfMarkColor=mydfMarkColor, # mark style d.f.
roundness=3, # vertices roundness
distTextChr = .7, # separation among text and chr names and ind.
orderBySize = FALSE, # do not order chr. by size
karHeiSpace=1.6, # vertical size of karyotype including spacer
legendWidth = .8 # legend item width
,legendHeight = .5 # legend item height
,markLabelSpacer = 2 # legend spacer
,rulerPos=-1, # ruler position
ruler.tck=-0.01, # ticks of ruler size and orientation
notes=notesdf # data.frame with notes NEW
,notesTextSize = 1.3 # font size of notes
,notesPos = .2 # space from chr. (right) to note
,ylimBotMod = 0.4 # modify ylim bottom argument
,ylimTopMod = 0 # modify ylim top argument
,xlimLeftMod = 2 # modify left xlim
,xlimRightMod = 3 # modify right xlim
,asp=1 # y x aspect ratio
)
Vertices when centromereSize=0
are rounded:
png("mydfChrSize2.png", width=700, height=950)
plotIdiograms(dfChrSize = bigdfOfChrSize[1:14,], # chr. size df
dfMarkColor = mydfMarkColor,# mark style df
dfMarkPos = bigdfOfMarks, # mark position df
# cen. marks NOT AVAILABLE for centromereSize = 0
centromereSize = 0, # <- HERE
roundness=3, # vertices roundness
chrSpacing = .7, # space among chr.
karHeight = 3, # karyotype rel. height
karHeiSpace=5, # vertical size of karyotype including spacer
amoSepar= 2.5, # separation among karyotype
indexIdTextSize=.8, # font size fo chr name and indices
karIndexPos = .1, # position of kar. index
markLabelSize=.7, # font size of mark legends
distTextChr = .8, # separation among chr. and ind.
rulerPos=-.8, # ruler position
ruler.tck=-0.01, # ticks of ruler size and orientation
xlimLeftMod = 2, # modify xlim left argument
ylimBotMod = 0.4, # modify ylim bottom argument
ylimTopMod = 0 # modify ylim top argument
,asp=1 # y x aspect
)
dev.off()
For ver. > 1.0.0 there is no need to add dfMarkColor
and you can also use the parameter mycolors
(optional too), to establish marks’ colors. Colors are assigned depending on the order of marks, i.e.:
charVectorCol <- c("tomato3","darkolivegreen4","dfsd","blue","green")
png("dfOfChrSize.png", width=600, height=400)
par(mar=rep(0,4))
plotIdiograms(dfChrSize = dfOfChrSize, # d.f. of chr. sizes
dfMarkPos = dfOfMarks2, # d.f. of marks' positions
chrColor = "gray", # chr. color
cenColor = "gray", # cen. color
mycolors = charVectorCol, # colors to use
distTextChr = .5 # separ. text and chr.
,karHeiSpace=1.6, # karyotype height including spacing
markLabelSize=.7, # font size for labels (legend)
rulerPos=-.5, # ruler position
ruler.tck=-0.01, # ruler tick orientation and length
rulerNumberSize=.5 # ruler font size
,asp=1 # y x aspect
,xlimRightMod = 1 # modify xlim right arg.
)
dev.off()
7 Example with several species (OTUs)
To illustrate this, we will load some data.frames from the package
- Chromosome sizes
OTU | chrName | shortArmSize | longArmSize | |
---|---|---|---|---|
1 | Species 1 | 1 | 1.5 | 2.0 |
2 | Species 1 | 2 | 2.0 | 2.5 |
3 | Species 1 | 3 | 1.0 | 1.5 |
4 | Species 2 | 1 | 3.0 | 4.0 |
5 | Species 2 | 2 | 4.0 | 5.0 |
6 | Species 2 | 3 | 2.0 | 3.0 |
7 | Species 2 | X | 1.0 | 2.0 |
8 | Species 2 | 4 | 3.0 | 4.0 |
9 | Species 3 | 1 | 3.2 | 4.0 |
10 | Species 3 | 2 | 4.5 | 5.0 |
11 | Species 3 | 3 | 2.0 | 3.0 |
12 | Species 3 | 4 | 1.5 | 2.0 |
13 | Species 3 | 5 | 4.8 | 6.0 |
14 | Species 3 | 6 | 6.1 | 7.0 |
15 | Species 4 | 1 | 1.5 | 2.0 |
16 | Species 4 | 2 | 2.0 | 2.5 |
17 | Species 4 | 3 | 1.0 | 1.5 |
18 | Species 5 | 1 | 3.0 | 4.0 |
19 | Species 5 | 2 | 4.0 | 5.0 |
20 | Species 5 | 3 | 2.0 | 3.0 |
21 | Species 5 | X | 1.0 | 2.0 |
22 | Species 5 | 4 | 3.0 | 4.0 |
23 | Species 6 | 1 | 3.2 | 4.0 |
24 | Species 6 | 2 | 4.5 | 5.0 |
25 | Species 6 | 3 | 2.0 | 3.0 |
26 | Species 6 | 4 | 1.5 | 2.0 |
27 | Species 6 | 5 | 4.8 | 6.0 |
28 | Species 6 | 6 | 6.1 | 7.0 |
231 | Species 7 | 1 | 3.9 | 4.0 |
241 | Species 7 | 2 | 3.8 | 4.0 |
- Mark characteristics, does not require OTU
- optional for ver. > 1.0.0
markName | markColor | style |
---|---|---|
5S | red | dots |
45S | green | square |
DAPI | blue | square |
CMA | yellow | square |
- Mark position
OTU | chrName | markName | chrRegion | markDistCen | markSize |
---|---|---|---|---|---|
Species 1 | 1 | 5S | p | 0.5 | 1 |
Species 1 | 1 | 45S | q | 0.5 | 1 |
Species 1 | 2 | 45S | p | 1.0 | 1 |
Species 1 | 3 | DAPI | q | 1.0 | 1 |
Species 3 | 3 | 5S | p | 1.0 | 1 |
Species 3 | 3 | DAPI | q | 1.0 | 1 |
Species 3 | 4 | 45S | p | NA | NA |
Species 3 | 4 | DAPI | q | 1.0 | 1 |
Species 3 | 5 | CMA | q | 2.0 | 1 |
Species 3 | 6 | 5S | q | 0.5 | 1 |
Species 2 | 1 | DAPI | cen | NA | NA |
Species 2 | 4 | CMA | cen | NA | NA |
Plotting
plotIdiograms(dfChrSize =bigdfOfChrSize,# chr sizes
dfMarkColor=dfMarkColor, # mark characteristics, optional in dev version. see above.
dfMarkPos =bigdfOfMarks, # mark positions (inc. cen. marks)
# cen. marks in bigdfOfMarks
karHeight=2.5, # karyotype rel. height
karHeiSpace=6, # karyotype vertical size with spacing
amoSepar = 2, # Vertical separation of kar. when karSepar = TRUE
centromereSize = 1, # apparent size of cen.
roundness = 10, # roundness of chr. vertices
distTextChr=.8, # distance of chr. to text
chrIndex = "AR", # add arm ratio only. For v. >=1.12
morpho="Guerra", # add chr. morphology by Guerra, see above. For v. >=1.12
indexIdTextSize=.6, # font size of indices and chr. name
OTUTextSize=.9, # font size of OTU names
markLabelSize=.7, # font size of legend
legendHeight = 2, # height of labels
ruler=TRUE, # add ruler
rulerPos=-.9, # position of ruler
rulerPosMod=3, # modify position of ruler
ruler.tck=-0.004, # size and orient. of ticks in ruler
rulerNumberPos=.4, # position of numbers of ruler
rulerNumberSize=.4, # font size of ruler
xlimRightMod = 3, # modify xlim left argument
ylimBotMod = 0, # modify ylim bottom argument
ylimTopMod = -.3 # modify ylim top argument
,asp=1 # y x aspect ratio
)
8 GISH of monocentric chromosomes
You need the data.frame of chr. sizes, and a d.f. of marks
Chr. sizes:
parentalAndHybChrSize
OTU | chrName | shortArmSize | longArmSize |
---|---|---|---|
Parental 1 | 1 | 3.2 | 4 |
Parental 1 | 4 | 1.5 | 2 |
Parental 1 | 5 | 4.8 | 6 |
Parental 1 | 6 | 6.1 | 7 |
Parental 2 | 1 | 3.2 | 4 |
Parental 2 | 2 | 4.5 | 5 |
Parental 2 | 3 | 2.0 | 3 |
Allopolyploid | 1 | 3.2 | 4 |
Allopolyploid | 2 | 4.5 | 5 |
Allopolyploid | 3 | 2.0 | 3 |
Allopolyploid | 4 | 1.5 | 2 |
Allopolyploid | 5 | 4.8 | 6 |
Allopolyploid | 6 | 6.1 | 7 |
Marks’ positions data
dfAlloParentMarks
OTU | chrName | markName | chrRegion |
---|---|---|---|
Allopolyploid | 1 | Parental 1 | p |
Allopolyploid | 1 | Parental 2 | q |
Allopolyploid | 1 | Parental 2 | cen |
Allopolyploid | 2 | Parental 2 | w |
Allopolyploid | 3 | Parental 2 | w |
Allopolyploid | 4 | Parental 1 | w |
Allopolyploid | 5 | Parental 1 | w |
Allopolyploid | 6 | Parental 1 | w |
Parental 1 | 6 | Parental 1 | w |
Parental 1 | 5 | Parental 1 | w |
Parental 1 | 1 | Parental 1 | w |
Parental 1 | 4 | Parental 1 | w |
Parental 2 | 2 | Parental 2 | w |
Parental 2 | 1 | Parental 2 | w |
Parental 2 | 3 | Parental 2 | w |
Plotting
# svg("gish.svg",width=7,height=9 )
#png("parentalAndHybChrSize.png", width=700, height=900)
plotIdiograms(dfChrSize = parentalAndHybChrSize, # d.f. of chr. sizes
dfMarkPos = dfAlloParentMarks, # d.f. of marks' positions
cenColor = NULL, # cen. color
karHeiSpace=5, # karyotype height including spacing
karSepar = FALSE, # equally sized (height) karyotypes
rulerPos=-1.2, # ruler position
ruler.tck= -0.006, # ruler tick orientation and length
rulerNumberSize=.4 # ruler font size
,legend="" # no legend
,asp=1 # y x aspect ratio
,notes=notesdf2 # data.frame with notes NEW
#,OTUasNote=TRUE # TRY THIS (OTU name to the right)
,notesTextSize = 1.3 # font size of notes
,notesPos = 1.5 # space from chr. (right) to note
,ylimBotMod = 1 # ylim bottom argument mod.
)
9 Plot data in micrometers and bases
For version > 1.9.1 info in number of bases can be combined in the same plot with info. in micrometers.
# merge data.frames in micrometers and number of bases
mixedThreeSpChrSize <- plyr::rbind.fill(bigdfOfChrSize[1:14,], bigdfOfChrSize3Mb)
# sort by OTU name
mixedThreeSpChrSize <- mixedThreeSpChrSize[order(mixedThreeSpChrSize$OTU),]
# merge marks in micrometers and bases
mixedThreeSpMarks <- plyr::rbind.fill(bigdfOfMarks , bigdfOfMarks3Mb)
plotIdiograms(dfChrSize = mixedThreeSpChrSize, # chr. size df
dfMarkPos = mixedThreeSpMarks, # mark position df
centromereSize = 1, # cen. size
roundness=5, # vertices roundness
chrWidth=.6, # width of chr.
chrSpacing = .6, # space among chr.
karHeight = 3, # kar. height without interspace
karHeiSpace = 5, # vertical size of karyotype including spacer
amoSepar =2, # separ. among kar.
indexIdTextSize=.6, # font size fo chr name and indices
markLabelSize=.7, # font size of mark legends
distTextChr = .65, # separation among chr. names and indices
legendWidth = 1.5 # legend items width
,ylabline = -7 # position of Mb (title) in axis
,rulerPos=-.9, # ruler position
ruler.tck=-0.005, # ticks of ruler size and orientation
rulerNumberPos =.7, # position of numbers in ruler
rulerNumberSize=.5, # font size of ruler numbers
ylimBotMod = 0.4, # modify ylim bottom argument
ylimTopMod = 0 # modify ylim top argument
,asp=1 # aspect of plot
)
Let’s explore those data.frames
OTU | chrName | shortArmSize | longArmSize | chrSize | |
---|---|---|---|---|---|
1 | Species 1 | 1 | 1.5 | 2.0 | NA |
2 | Species 1 | 2 | 2.0 | 2.5 | NA |
3 | Species 1 | 3 | 1.0 | 1.5 | NA |
15 | Species 1 genome | 1 | NA | NA | 3500000 |
16 | Species 1 genome | 2 | NA | NA | 4500000 |
17 | Species 1 genome | 3 | NA | NA | 2500000 |
OTU | chrName | markName | chrRegion | markDistCen | markSize | markPos | |
---|---|---|---|---|---|---|---|
1 | Species 1 | 1 | 5S | p | 0.5 | 1 | NA |
2 | Species 1 | 1 | 45S | q | 0.5 | 1 | NA |
3 | Species 1 | 2 | 45S | p | 1.0 | 1 | NA |
4 | Species 1 | 3 | DAPI | q | 1.0 | 1 | NA |
13 | Species 1 genome | 1 | 5S | NA | NA | 1000000 | 2500000 |
14 | Species 1 genome | 1 | 45S | NA | NA | 1000000 | 500000 |
15 | Species 1 genome | 2 | 45S | NA | NA | 1000000 | 3500000 |
16 | Species 1 genome | 3 | DAPI | NA | NA | 1000000 | 0 |
References
Guerra M. 1986. Reviewing the chromosome nomenclature of Levan et al. Brazilian Journal of Genetics, 9(4): 741–743
Levan A, Fredga K, Sandberg AA. 1964. Nomenclature for centromeric position on chromosomes Hereditas, 52(2): 201–220. https://doi.org/10.1111/j.1601-5223.1964.tb01953.x. https://onlinelibrary.wiley.com/doi/abs/10.1111/j.1601-5223.1964.tb01953.x
Romero-Zarco C. 1986. A new method for estimating karyotype asymmetry Taxon, 35(3): 526–530. https://onlinelibrary.wiley.com/doi/abs/10.2307/1221906
Watanabe K, Yahara T, Denda T, Kosuge K. 1999. Chromosomal evolution in the genus Brachyscome (Asteraceae, Astereae): statistical tests regarding correlation between changes in karyotype and habit using phylogenetic information Journal of Plant Research, 112: 145–161. http://link.springer.com/article/10.1007/PL00013869