This guide shows the files to plot idiograms of karyotypes of holocentrics and optionally marks.
visit gitlab for installation instructions https://gitlab.com/ferroao/idiogramFISH
Initially you have to open your chromosome data as a dataframe.
# Example dataframe 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)
# just to show it here
knitr::kable(mydfChrSizeHolo)
OTU | chrName | chrSize |
---|---|---|
Species one | 1 | 6.5 |
Species one | 2 | 5.0 |
Species one | 3 | 4.0 |
Species one | X | 3.0 |
Initially, if you use RStudio, use menu “Session”, “Set working directory” for choosing your desired folder or:
setwd("~/folder/subfolder")
Open your chromosome data dataframe 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")
Open or make your mark data as a dataframe. This dataframe has the marks present in all karyotypes with color and style, without position info.
# 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)
knitr::kable(mydfMarkColor)
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"
Open or write your mark positions as a dataframe. This dataframe has the marks present in all karyotypes with position info.
# We will use column OTU if dataframe 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)
knitr::kable(mydfMarkPosHolo)
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")
You can plot without marks (passing only 1st dataframe), but we will use all 4 dataframes created:
# library(idiogramFISH)
par(mar=c(1,4,1,1)) # bottom left top right
plotIdiogramsHolo(mydfChrSizeHolo, mydfMarkColor, mydfMarkPosHolo,
dotRoundCorr=2,
chrWidth = 2, chrSpacing = 2,
indexIdTextSize=1, OTUTextSize=1, karHeight = 1.4,
legend="aside" ,markLabelSize=1,
addOTUName=FALSE,
rulerNumberSize=1, rulerPos=-2.2,ruler.tck=-0.03,rulerNumberPos=.9,
xlimLeftMod=2.2, xlimRightMod=10, ylimBotMod=.1
)
data(bigdfChrSizeHolo, dfMarkColor, bigdfMarkPosHolo)
# Chromosome sizes
knitr::kable(bigdfChrSizeHolo)
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 |
markName | markColor | style |
---|---|---|
5S | red | dots |
45S | green | square |
DAPI | blue | square |
CMA | yellow | square |
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 |
library(idiogramFISH)
par(mar=c(1,1,1,1))
plotIdiogramsHolo(bigdfChrSizeHolo, dfMarkColor, bigdfMarkPosHolo, MarkDistanceType="cen",
roundness=6, dotRoundCorr=1, karHeight = 1, karSpacing = 1.7,
chrWidth = 2, chrSpacing = 2,
indexIdTextSize=.9,
markLabelSize=.9,
rulerNumberSize=.9,
OTUTextSize=1.2,
reduDistKar=FALSE,
chrId="simple", xlimRightMod=2,
ylimBotMod=.4)
Create some data in millions:
# using previous dataframes
bigdfChrSizeHolo$chrSize<-bigdfChrSizeHolo$chrSize*980000
bigdfMarkPosHolo$markPos<-bigdfMarkPosHolo$markPos*980000
bigdfMarkPosHolo$markSize<-bigdfMarkPosHolo$markSize*980000
library(idiogramFISH)
par(mar=c(1,1,1,1))
plotIdiogramsHolo(bigdfChrSizeHolo, dfMarkColor, bigdfMarkPosHolo, MarkDistanceType="cen",
Mb=TRUE, # <- THIS IS NEW
roundness=6, dotRoundCorr=1, karHeight = 1, karSpacing = 1.7,
chrWidth = 2, chrSpacing = 2,
karIndex = FALSE,
markLabelSize=.9,
rulerNumberSize=.9, rulerPos = 0,
OTUTextSize=1.2,
reduDistKar=FALSE,
chrId="simple", xlimRightMod=2,
xlimLeftMod = 3,
ylimBotMod=.4)
For another example see: https://stackoverflow.com/questions/33727432/how-to-plot-positions-along-a-chromosome-graphic/57153497#57153497
Check the help to see all possible arguments ?idiogramFISH (click Index below)