Go to home
Go to monocentrics Vignette
Go to groups Vignette
Go to 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
1 \"Species one\" 1 6.5
2 \"Species one\" 2 5.0
3 \"Species one\" 3 4.0
4 \"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 | X | 3.0 |
or loading saved data:
Initially, if you use RStudio, use menu “Session”, “Set working directory” for choosing your desired folder or:
setwd("~/folder/subfolder")
Open your chromosome data data.frame importing it from a .csv (read.csv) or .xls file (readxl).
mydfChrSize<-read.csv("somefile.csv")
For fixing column names use:
colnames(mydfChrSize)<-c("OTU", "chrName","chrSize")
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:
colnames(mydfMarkColor)<-c("markName", "markColor","style") # if style column not present it will be filled with "square"
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
1 \"Species one\" 3 5S 1.0 0.5
2 \"Species one\" 3 DAPI 2.0 0.5
3 \"Species one\" 1 45S 2.0 0.5
4 \"Species one\" 2 DAPI 2.0 0.5
5 \"Species one\" 4 CMA 2.0 0.5
6 \"Species one\" 4 5S 0.5 0.5" , header=TRUE, stringsAsFactors=FALSE,fill=TRUE)
OTU | chrName | markName | markPos | markSize |
---|---|---|---|---|
Species one | 3 | 5S | 1.0 | 0.5 |
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 | 4 | CMA | 2.0 | 0.5 |
Species one | 4 | 5S | 0.5 | 0.5 |
For fixing column names use something like:
colnames(mydfMarkColor)<-c("OTU", "chrName","markName","markPos","markSize")
5 Plotting
You can plot without marks (passing only 1st data.frame), but we will use all 4 data.frames created:
# library(idiogramFISH)
par(mar=c(1,4,1,1)) # bottom left top right
plotIdiogramsHolo(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.03, # 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
)
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.:
unique(dfMarkPosHolo$markName)
par(mar=c(1,4,1,1))
plotIdiogramsHolo(dfChrSize=dfChrSizeHolo,
dfMarkPos=dfMarkPosHolo,
mycolors = c("green","yellow","blue","red"), # optional
dotRoundCorr=2.5, chrWidth=2.5,
indexIdTextSize=1,
legend="aside" ,markLabelSize=1,
addOTUName=F,
rulerNumberSize=1, rulerPos=-.7,ruler.tck=-0.04,rulerNumberPos=.9,
xlimLeftMod=1, xlimRightMod=10, ylimBotMod=.2
)
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 | 3 |
species one | 2 | 4 |
species one | 3 | 2 |
species one | 4 | 5 |
species two | 1 | 3 |
species two | 2 | 4 |
species two | 3 | 2 |
species two | 4 | 5 |
species three | 1 | 3 |
species three | 2 | 4 |
species three | 3 | 2 |
species three | 4 | 5 |
Mark characteristics, does not require OTU, df 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)
par(mar=c(1,1,1,1))
plotIdiogramsHolo(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
karSpacing = 1.7, # karyotype height including spacing
reduDistKar=FALSE, # reduce vertical space among karyotypes of karSpacing
chrId="simple", # numbering of chr., not using "original" name
chrWidth = 2, # chr. width
chrSpacing = 2, # 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
7 Using bases instead of micrometers
Create some data in millions of bases:
# using previous data.frames
bigdfChrSizeHolo$chrSize<-bigdfChrSizeHolo$chrSize*980000
bigdfMarkPosHolo$markPos<-bigdfMarkPosHolo$markPos*980000
bigdfMarkPosHolo$markSize<-bigdfMarkPosHolo$markSize*980000
Plotting
In the plot length is shown in Mb
par(mar=c(1,1,1,1))
plotIdiogramsHolo(dfChrSize=bigdfChrSizeHolo, # df of chr. sizes
dfMarkColor=dfMarkColor, # df of mark style
dfMarkPos=bigdfMarkPosHolo, # df of mark positions
MarkDistanceType="cen", # distance to mark is to its center
Mb=TRUE, # <- THIS IS NEW # distances provided are in Mbs
ylabline = -1, # <-THIS IS 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
karSpacing = 1.7, # karyotype height including spacing
reduDistKar=FALSE, # reduce spacing in karSpacing
chrId="simple", # chr. names not "original"
chrWidth = 2, # chr. width
chrSpacing = 2, # space among chr.
indexIdTextSize=.9, # font size of chr names and indices
karIndex = FALSE, # 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
For another example see: https://stackoverflow.com/questions/33727432/how-to-plot-positions-along-a-chromosome-graphic/57153497#57153497