Go to home
Go to 1. monocentrics 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 karyotypes of holocentrics 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 written in R, use: (column OTU is optional if only 1 OTU)
mydfChrSizeHolo<-read.table(text=
" OTU chrName chrSize
\"Species one\" 1 6.5
\"Species one\" 2 5.0
\"Species one\" 3 4.0
\"Species one\" 4 4.0
\"Species one\" X 3.0 " , header=TRUE, stringsAsFactors=FALSE,fill=TRUE)
OTU | chrName | chrSize |
---|---|---|
Species one | 1 | 6.5 |
Species one | 2 | 5.0 |
Species one | 3 | 4.0 |
Species one | 4 | 4.0 |
Species one | X | 3.0 |
or 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).
For fixing column names use:
3 Get marks general data
This data.frame is optional for ver. > 1.0.0
Open or make your mark data as a data.frame. This data.frame has the marks present in all karyotypes with color and style, 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
1 5S red dots
2 45S green square
3 DAPI blue square
4 CMA yellow square" , header=TRUE, stringsAsFactors=FALSE,fill=TRUE)
markName | markColor | style |
---|---|---|
5S | red | dots |
45S | green | square |
DAPI | blue | square |
CMA | yellow | 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.
# We will use column OTU if data.frame because chromosome size df has it
mydfMarkPosHolo<-read.table(text=
" OTU chrName markName markPos markSize chrRegion
\"Species one\" 4 B NA NA w # whole chromosome mark, use 'w' in col. chrRegion
\"Species one\" 3 DAPI 2.0 0.5
\"Species one\" 1 45S 2.0 0.5
\"Species one\" 2 DAPI 2.0 0.5
\"Species one\" X CMA 2.0 0.5
\"Species one\" X 5S 0.5 0.5
\"Species one\" X 5S 0.5 0.5" , header=TRUE, stringsAsFactors=FALSE,fill=TRUE)
OTU | chrName | markName | markPos | markSize | chrRegion |
---|---|---|---|---|---|
Species one | 4 | B | NA | NA | w |
Species one | 3 | DAPI | 2.0 | 0.5 | |
Species one | 1 | 45S | 2.0 | 0.5 | |
Species one | 2 | DAPI | 2.0 | 0.5 | |
Species one | X | CMA | 2.0 | 0.5 | |
Species one | X | 5S | 0.5 | 0.5 | |
Species one | X | 5S | 0.5 | 0.5 |
For fixing column names use something like:
5 Plotting
function plotIdiogramsHolo
deprecated after ver. > 1.5.1
You can plot without marks (passing only 1st data.frame), but we will use all 4 data.frames created:
# library(idiogramFISH)
svg("mydfChrSizeHolo.svg",width=13.5,height=8 )
# png("mydfChrSizeHolo.png", width=600, height=400)
par(mar=c(1,4,1,1)) # bottom left top right
# function `plotIdiogramsHolo` deprecated after ver. > 1.5.1
plotIdiograms(dfChrSize = mydfChrSizeHolo,# data.frame of chr. sizes
dfMarkColor= mydfMarkColor, # df of mark style
dfMarkPos = mydfMarkPosHolo,# df of mark positions
karHeight = 1.4, # vertical size of karyotype plus spacing
addOTUName=FALSE, # add OTU names
chrWidth = 2, # width of chromosomes
chrSpacing = 2, # space among chromosomes
indexIdTextSize=1, # font size of chr. name and indices
dotRoundCorr=2, # correction factor for roundness of dots
legend="aside" , # position of legend, not "inline"
markLabelSize=1, # font size of legend
rulerNumberSize=1, # font size of ruler
rulerPos=-2.2, # position of ruler
ruler.tck=-0.01, # size and orient. of tick of ruler
rulerNumberPos=.9, # ruler's number position
xlimLeftMod=2.2, # modify xlim left argument
xlimRightMod=10, # modify xlim right argument
ylimBotMod=.1 # modify ylim bottom argument
,legendWidth=1 # width of legend
,legendHeight=0.5 # height of legend item
)
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. When using mycolors
, colors are assigned depending on the order of marks, i.e.:
par(mar=c(1,4,1,1))
# function plotIdiogramsHolo was deprecated
plotIdiograms(dfChrSize = dfChrSizeHolo, # d.f. of chr. size
dfMarkPos = dfMarkPosHolo, # d.f. of marks' positions
mycolors = c("green","yellow","blue","red"), # colors for marks
dotRoundCorr=2.5, # correction of roundness of vert. and dots
chrWidth=2.5, # rel. chr width
indexIdTextSize=1, # font size of indexes and chr. name
legend="aside", # position of legend to the right
markLabelSize=1, # font size of legend
addOTUName=F, # add OTU name
rulerNumberSize=1, # font size of ruler
rulerPos=-.7, # ruler position
ruler.tck=-0.04, # ruler ticks size and orient.
rulerNumberPos=.9, # position of numbers of ruler
xlimLeftMod=1, # modify left xlim
xlimRightMod=10, # modify right xlim
ylimBotMod=.2 # modify bottom ylim
)
6 Example with several species (OTUs)
To illustrate this, we will load some data.frames from the package
- Chromosome sizes
OTU | chrName | chrSize |
---|---|---|
species one | 1 | 5.1 |
species one | 2 | 5.0 |
species one | 3 | 4.9 |
species one | 4 | 5.2 |
species two | 1 | 3.0 |
species two | 2 | 4.0 |
species two | 3 | 2.0 |
species two | 4 | 5.0 |
species three | 1 | 1.5 |
species three | 2 | 2.0 |
species three | 3 | 6.0 |
species three | 4 | 8.0 |
- Mark characteristics, does not require OTU
- d.f 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 | markPos | markSize |
---|---|---|---|---|
species two | 3 | 5S | 1.0 | 0.5 |
species two | 3 | DAPI | 2.0 | 0.5 |
species two | 1 | 45S | 2.0 | 0.5 |
species two | 2 | DAPI | 2.0 | 0.5 |
species two | 4 | CMA | 2.0 | 0.5 |
species two | 4 | 5S | 0.5 | 0.5 |
6.1 Plotting
library(idiogramFISH)
# fig.width=6, fig.height=6
png("bigdfChrSizeHolo.png", width=600, height=600)
par(mar=c(1,1,1,1))
plotIdiograms(dfChrSize=bigdfChrSizeHolo, # df of chr. sizes
dfMarkColor=dfMarkColor, # df of mark style
dfMarkPos=bigdfMarkPosHolo, # df of marks' position
MarkDistanceType="cen", # distance to mark (center of mark)
roundness=6, # vertices roundness of chr. and marks
dotRoundCorr=1, # correction of dots roundness
karHeight = 1, # rel. karyotype height
karHeiSpace = 1.7, # karyotype height including spacing
karSepar=FALSE, # reduce vertical space among karyotypes
markLabelSpacer = 1 # distance from chr. (right) to legend
,legendWidth = 1 # width of legend labels
,legend="aside" # type of legend, right side
,chrId="simple", # numbering of chr., not using "original" name
chrWidth = 0.5, # chr. width
chrSpacing = 1, # space among chr.
indexIdTextSize=.9, # font size of chr names and indices
markLabelSize=.9, # font size of legends
rulerNumberSize=.9, # font size of ruler
OTUTextSize=1.2, # font size of OTUs' names
xlimRightMod=2, # modify xlim right argument
ylimBotMod=.4 # modify ylim bottom argument
)
dev.off()
7 Using bases instead of micrometers
Create some data in millions of bases:
# transform previous data.frames for simplicity
bigdfChrSizeHoloMb <- bigdfChrSizeHolo
bigdfChrSizeHoloMb$chrSize <- bigdfChrSizeHoloMb$chrSize * 980000
bigdfMarkPosHoloMb <- bigdfMarkPosHolo
bigdfMarkPosHoloMb$markPos <- bigdfMarkPosHoloMb$markPos * 980000
bigdfMarkPosHoloMb$markSize<- bigdfMarkPosHoloMb$markSize * 980000
Plotting
In the plot length is shown in Mb
png("bigdfChrSizeHolo2.png", width=700, height=600)
par(mar=c(1,1,1,1))
plotIdiograms(dfChrSize=bigdfChrSizeHoloMb, # df of chr. sizes
dfMarkColor=dfMarkColor, # df of mark style
dfMarkPos=bigdfMarkPosHoloMb, # df of mark positions
MarkDistanceType="cen", # distance to mark is to its center
Mb=TRUE, # <- THIS IS NEW # distances provided are in Mbs
ylabline = -3.6, # <- NEW # if Mb=TRUE modifies position of y axis title (Mb)
roundness=6, # vertices roundness of chr. and marks
dotRoundCorr=1, # correction of dots roundness
karHeight = 1, # rel. karyotype height
karHeiSpace = 1.7, # karyotype height including spacing
karSepar=TRUE, # reduce spacing among karyotypes
amoSepar = 3, # depends on karSepar, amount of sep.
chrId="simple", # chr. names not "original"
chrWidth = 0.5, # chr. width
chrSpacing = 1.0, # space among chr.
indexIdTextSize=.9, # font size of chr names and indices
karIndex = FALSE, # do not add karyotype asymmetry index
markLabelSize=.9, # font size of legend
rulerNumberSize=.9, # font size of ruler
rulerPos = 0, # position of ruler
OTUTextSize=1.2, # font size of OTU names
xlimRightMod=2, # modify right argument of xlim
xlimLeftMod = 3, # modify left argument of xlim
ylimBotMod=.4) # modify bottom argument of ylim
dev.off()
For another example see: https://stackoverflow.com/questions/33727432/how-to-plot-positions-along-a-chromosome-graphic/57153497#57153497
8 GISH of holocentric chromosomes
You need the data.frame of chr. sizes, and a d.f. of marks
Chr. sizes:
parentalAndHybHoloChrSize
OTU | chrName | chrSize |
---|---|---|
Parental 1 | 7 | 4 |
Parental 1 | 4 | 2 |
Parental 1 | 5 | 6 |
Parental 1 | 6 | 7 |
Parental 2 | 1 | 4 |
Parental 2 | 2 | 5 |
Parental 2 | 3 | 3 |
Allopolyploid | 7 | 4 |
Allopolyploid | 2 | 5 |
Allopolyploid | 3 | 3 |
Allopolyploid | 4 | 2 |
Allopolyploid | 5 | 6 |
Allopolyploid | 6 | 7 |
Marks’ positions data
dfAlloParentMarksHolo
OTU | chrName | markName | chrRegion | |
---|---|---|---|---|
1 | Allopolyploid | 7 | Parental 1 | w |
4 | Allopolyploid | 2 | Parental 2 | w |
5 | Allopolyploid | 3 | Parental 2 | w |
6 | Allopolyploid | 4 | Parental 1 | w |
7 | Allopolyploid | 5 | Parental 1 | w |
8 | Allopolyploid | 6 | Parental 1 | w |
9 | Parental 1 | 6 | Parental 1 | w |
10 | Parental 1 | 5 | Parental 1 | w |
11 | Parental 1 | 7 | Parental 1 | w |
12 | Parental 1 | 4 | Parental 1 | w |
13 | Parental 2 | 2 | Parental 2 | w |
14 | Parental 2 | 1 | Parental 2 | w |
15 | Parental 2 | 3 | Parental 2 | w |
Plotting
# svg("gish.svg",width=8,height=7 )
# png("mydfChrSize.png", width=600, height=500)
plotIdiograms(dfChrSize = parentalAndHybHoloChrSize, # d.f. of chr. sizes
dfMarkPos = dfAlloParentMarksHolo, # d.f. of marks' positions
chrColor = "gray", # chr. color
cenColor = NULL, # cen. color when GISH
OTUTextSize = 1, # font size for OTU names
dotRoundCorr=2, # correction of roundness of vert. and dots
chrWidth=2.5, # rel. chr. width
chrSpacing = 2.5, # rel. horizontal chr. spacing
karHeiSpace=2, # karyotype height including spacing
indexIdTextSize=1, # font size for chr. indexes and chr. name
distTextChr = 0.5,
markLabelSize=1, # font size for labels (legend)
rulerPos=-1.9, # ruler position
ruler.tck=-0.02, # ruler tick orientation and length
rulerNumberPos=.5, # rulers' numbers position
rulerNumberSize=0.7 # ruler font size
,legend="" # no legend
)