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("mydChrSizeHolo.png", width=600, height=400)
par(mar=c(0,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
addOTUName=FALSE, # add OTU names
rulerPos=-1, # 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
ylimBotMod=-2 # modify ylim bottom argument
,legendWidth=1 # width of legend
,legendHeight=.7 # height of legend item
,asp=1 # y x aspect
)
It is not mandatory to use 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
addOTUName=F, # add OTU name
rulerPos=-.7, # ruler position
ruler.tck=-0.01, # ruler ticks size and orient.
rulerNumberPos=.9, # position of numbers of ruler
xlimLeftMod=1, # modify left xlim arg.
xlimRightMod=3, # modify right xlim arg.
ylimBotMod=.2 # modify bottom ylim
,asp=1 # y x aspect
)
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
markDistType="cen", # measure towards center of mark
roundness=6, # vertices roundness of chr. and marks
karHeiSpace = 4, # karyotype height including spacing
karSepar=TRUE, # reduce vertical space among karyotypes
amoSepar = 1, # separation among karyotypes
distTextChr=.5, # distance text to chr.
legendWidth = 1 # width of legend labels
,chrId="simple", # numbering of chr., not using "original" name
indexIdTextSize=.9, # font size of chr names and indices
markLabelSize=.9, # font size of legends
rulerNumberSize=.9, # font size of ruler
ruler.tck= -.004, # tick length and orient.
ylimBotMod=.4 # modify ylim bottom argument
,asp=1 # y x aspect
)
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
markDistType="cen", # distance to mark is to its center
ylabline = -8, # <- NEW # modifies position of y axis title (Mb)
roundness=4, # vertices roundness of chr. and marks
distTextChr = .5, # separ. chr. to text
karHeight = 2, # rel. karyotype height
karHeiSpace = 4, # karyotype height including spacing
karSepar=TRUE, # reduce spacing among karyotypes
amoSepar = 1, # depends on karSepar, amount of sep.
chrId="simple", # chr. names not "original"
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
ruler.tck= -.004, # ruler tick length and orient.
legendWidth = 1.2, # width of legends
xlimLeftMod = 1, # modify left argument of xlim
ylimBotMod=.4 # modify bottom argument of ylim
,asp=1) # y x aspect
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 )
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
karHeight = 3, # karyotype heigth without spacing
karHeiSpace=5, # karyotype height including spacing
distTextChr = 0.8, # separation among chr. and text
rulerPos=-1.8, # ruler position
ruler.tck=-0.01, # ruler tick orientation and length
rulerNumberSize=0.7 # ruler font size
,legend="" # no legend
,xlimRightMod = 0 # xlim right arg. modif.
,asp=1 # y x aspect
)