Commit 5ddd61bf authored by Kosmas Hench's avatar Kosmas Hench

update figure documentation

parent 4a40cb84
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
se <- function(x){
x2 <- x[!is.na(x)]
return(sd(x2)/sqrt(length(x2)))}
trplot <- function(sel){
files <- c("global","boc","bel","hon","pue","nig","uni","nig-pue","nig-uni","pue-uni")
data <- read.csv(paste('../../2_output/08_popGen/07_LD/',files[sel],'-10000-bins.txt',sep=''),sep='\t')
message(files[sel])
s1=17620000;s2=19910000;s3=21960000;s4=22320000;
e2=20660000;e3=22460000;
stp=20000;
l1=500000;l2=750000;l3=500000;l4=500000
scling <- c(-s1,-s2+(l1+stp),-s3+(l1+l2+2*stp),-s4+(l1+l2+l3+(stp*3)))
dt <- data %>% mutate(miX = floor(Mx/10000),miY=floor(My/10000))
genes <- data.frame(start=c(17871610,20186151,22225149,22553187,22556763,22561894,22573388),
end=c(17873915,20347811,22228342,22555052,22559742,22566321,22575503),
sclr=c(1,2,3,4,4,4,4),
LG=c("LG09","LG12-1","LG12-2","LG17","LG17","LG17","LG17"),
name=c("sox10",'casz1',"hoxc13a","sws2a\u03B1","sws2a\u03B2","sws2b","lws"))
genes <- genes %>% mutate(Nx1 = (start+scling[sclr])/10000,Nx2 = (end+scling[sclr])/10000,
labPOS = (Nx1+Nx2)/2)
genes$labPOS[genes$name %in% c("sws2a\u03B1","sws2a\u03B2","sws2b","lws")] <- genes$labPOS[genes$name %in% c("sws2a\u03B1","sws2a\u03B2","sws2b","lws")]+c(-16,-1,12,20)
GZrS <- 40000;GZrS2 <- 20000; #gene zoom offset
BS <- c(-5,5,-4,3,-8,8,-20,-10,-6,5,7,16,17,22)*10000 # Backshifter for gene zoom
GZdf <- data.frame(x=c(genes$start[1],genes$end[1],genes$end[1]+GZrS+BS[1],genes$start[1]+GZrS+BS[2],genes$start[1],
genes$start[2],genes$end[2],genes$end[2]+GZrS+BS[3],genes$start[2]+GZrS+BS[4],genes$start[2],
genes$start[3],genes$end[3],genes$end[3]+GZrS+BS[5],genes$start[3]+GZrS+BS[6],genes$start[3],
genes$start[4],genes$end[4],genes$end[4]+GZrS+BS[7],genes$start[4]+GZrS+BS[8],genes$start[4],
genes$start[5],genes$end[5],genes$end[5]+GZrS+BS[9],genes$start[5]+GZrS+BS[10],genes$start[5],
genes$start[6],genes$end[6],genes$end[6]+GZrS+BS[11],genes$start[6]+GZrS+BS[12],genes$start[6],
genes$start[7],genes$end[7],genes$end[7]+GZrS+BS[13],genes$start[7]+GZrS+BS[14],genes$start[7])+GZrS2,
y=c(genes$start[1],genes$end[1],genes$end[1]-GZrS+BS[1],genes$start[1]-GZrS+BS[2],genes$start[1],
genes$start[2],genes$end[2],genes$end[2]-GZrS+BS[3],genes$start[2]-GZrS+BS[4],genes$start[2],
genes$start[3],genes$end[3],genes$end[3]-GZrS+BS[5],genes$start[3]-GZrS+BS[6],genes$start[3],
genes$start[4],genes$end[4],genes$end[4]-GZrS+BS[7],genes$start[4]-GZrS+BS[8],genes$start[4],
genes$start[5],genes$end[5],genes$end[5]-GZrS+BS[9],genes$start[5]-GZrS+BS[10],genes$start[5],
genes$start[6],genes$end[6],genes$end[6]-GZrS+BS[11],genes$start[6]-GZrS+BS[12],genes$start[6],
genes$start[7],genes$end[7],genes$end[7]-GZrS+BS[13],genes$start[7]-GZrS+BS[14],genes$start[7])-GZrS2,
grp=rep(letters[1:7],each=5)) %>%
mutate(sclr=rep(c(1,2,3,4,4,4,4),each=5),
Nx1 = (x+scling[sclr])/10000,
Nx2 = (y+scling[sclr])/10000)
clr = c(viridis::inferno(5)[c(1,1:5)])
Gcol <- '#3bb33b'
Zcol = rgb(.94,.94,.94)
DG <- rgb(.4,.4,.4)
LGoffset <- 15
GLABoffset <- 8
if(sel %in% c(1,8)){
rS <- 100000 # width of grey annotation band
zmRange <- data.frame(x=c(s1,s1+l1,s1+l1+rS,s1+rS,s1,
s2,s2+l2,s2+l2+rS,s2+rS,s2,
s3,s3+l3,s3+l3+rS,s3+rS,s3,
s4,s4+l4,s4+l4+rS,s4+rS,s4),
y=c(s1,s1+l1,s1+l1-rS,s1-rS,s1,
s2,s2+l2,s2+l2-rS,s2-rS,s2,
s3,s3+l3,s3+l3-rS,s3-rS,s3,
s4,s4+l4,s4+l4-rS,s4-rS,s4),
grp=rep(letters[1:4],each=5)) %>%
mutate(sclr=rep(1:4,each=5),
Nx1 = (x+scling[sclr])/10000-1,
Nx2 = (y+scling[sclr])/10000)
rS2 <- .75*rS
zmRange2 <- data.frame(x=c(s1,s1+l1,s1+l1+rS2,s1+rS2,s1,
s2,s2+l2,s2+l2+rS2,s2+rS2,s2,
s3,s3+l3,s3+l3+rS2,s3+rS2,s3,
s4,s4+l4,s4+l4+rS2,s4+rS2,s4),
y=c(s1,s1+l1,s1+l1-rS2,s1-rS2,s1,
s2,s2+l2,s2+l2-rS2,s2-rS2,s2,
s3,s3+l3,s3+l3-rS2,s3-rS2,s3,
s4,s4+l4,s4+l4-rS2,s4-rS2,s4),
grp=rep(letters[1:4],each=5)) %>%
mutate(sclr=rep(1:4,each=5),
Nx1 = (x+scling[sclr])/10000-1,
Nx2 = (y+scling[sclr])/10000)
rS3 <- .07*rS
zmRange3 <- data.frame(x=c(s1,s1+l1,s1+l1+rS3,s1+rS3,s1,
s2,s2+l2,s2+l2+rS3,s2+rS3,s2,
s3,s3+l3,s3+l3+rS3,s3+rS3,s3,
s4,s4+l4,s4+l4+rS3,s4+rS3,s4),
y=c(s1,s1+l1,s1+l1-rS3,s1-rS3,s1,
s2,s2+l2,s2+l2-rS3,s2-rS3,s2,
s3,s3+l3,s3+l3-rS3,s3-rS3,s3,
s4,s4+l4,s4+l4-rS3,s4-rS3,s4),
grp=rep(letters[1:4],each=5)) %>%
mutate(sclr=rep(1:4,each=5),
Nx1 = (x+scling[sclr])/10000-1,
Nx2 = (y+scling[sclr])/10000)
zmLab <- data.frame(x=c(s1+.5*l1,s2+.5*l2,s3+.5*l3,s4+.5*l4),
label=c('LG09 (A)','LG12 (B)','LG12 (C)','LG17 (D)')) %>%
mutate(sclr=1:4, Nx= (x+scling[sclr])/10000)
zmEND <- data.frame(x=c(s1,s1+l1,
s2,s2+l2,
s3,s3+l3,
s4,s4+l4)) %>%
mutate(sclr=rep(1:4,each=2),
Nx = ((x+scling[sclr])/10000)+rep(c(2.5,-4),4),
label=round((x/1000000),2))
textSCALE1 <- c(1.8,rep(NA,6),.7)
textSCALE2 <- c(2,rep(NA,6),1)
textSCALE3 <- c(3.5,rep(NA,6),1.75)
p1 <- ggplot(dt %>% filter(!is.na(Mval)),aes(fill=Mval))+
coord_equal()+
geom_polygon(inherit.aes = F,data=zmRange,
aes(x=Nx1+1,y=Nx2-1,group=grp),fill='lightgray')+
geom_polygon(inherit.aes = F,data=zmRange2,
aes(x=Nx1+11,y=Nx2-11,group=grp),fill=DG)+
geom_polygon(inherit.aes = F,data=zmRange3,
aes(x=Nx1+1.1,y=Nx2-1.1,group=grp),fill=DG)+
geom_polygon(inherit.aes = F,data=GZdf,
aes(x=Nx1,y=Nx2,group=grp),fill=Zcol)+
geom_segment(inherit.aes = F,data=genes,
aes(x=Nx1+1,y=Nx1-1,xend=Nx2+1,yend=Nx2-1),
col=Gcol,size=1.5)+
geom_tile(aes(x=miX,y=miY))+
geom_text(inherit.aes = F,data=zmEND,
aes(x=Nx+LGoffset,y=Nx-LGoffset,label=paste(label,'\n(Mb)')),
angle=45,size=textSCALE1[sel])+
geom_text(inherit.aes = F,data=genes,
aes(x=labPOS+GLABoffset,y=labPOS-GLABoffset,label=name),
angle=-45,fontface='italic',size=textSCALE2[sel])+
geom_text(inherit.aes = F,data=zmLab,
aes(x=Nx+LGoffset-.8,y=Nx-LGoffset+.8,label=label),
angle=-45,fontface='bold',size=textSCALE3[sel],col='white')+
scale_x_continuous(expand=c(0,0))+
scale_y_continuous(expand=c(0,0),
trans = 'reverse')+
scale_fill_gradientn(name=expression(bar(r^2)),colours=clr,
values=rescale(c(1,.08,.03,.015,.01,0)),
limits=c(0,1),guide = 'legend',breaks=c(0,.005,.01,.02,.03,.1,1))+
theme_void()+
theme(legend.position = c(.7,.75),legend.direction = 'vertical')
} else {
p1 <- ggplot(dt %>% filter(!is.na(Mval)),aes(fill=Mval))+
coord_equal()+
geom_segment(inherit.aes = F,data=genes,
aes(x=Nx1+1.5,y=Nx1-1.5,xend=Nx2+1.5,yend=Nx2-1.5),
col=Gcol,size=1)+
geom_tile(aes(x=miX,y=miY))+
scale_x_continuous(expand=c(0,0))+
scale_y_continuous(expand=c(0,0),
trans = 'reverse')+
scale_fill_gradientn(name=expression(bar(r^2)),colours=clr,
values=rescale(c(1,.08,.03,.015,.01,0)),
limits=c(0,1),guide = 'legend',breaks=c(0,.005,.01,.02,.03,.1,1))+
theme_void()+
theme(legend.position = c(.7,.75),legend.direction = 'vertical')
}
return(p1)
}
\ No newline at end of file
BW <- read.csv('../../2_output/08_popGen/07_LD/subsets/glob_between.interchrom.hap.ld',sep='\t') %>%
select(R.2) %>%
mutate(type='Global',run='Global')
for(j in 1:6){
flS <- c("boc","bel","hon","pue","nig","uni")
flL <- c("Panana","Belize","Honduras","H. puella","H. nigricans","H. unicolor")
flT <- c(rep('Geo',3),rep('Spec',3))
k <- flS[j]
q <- flL[j]
u <- flT[j]
print(j)
BW <- BW %>%
rbind(.,(read.csv(paste('../../2_output/08_popGen/07_LD/subsets/glob_between.',k,'.interchrom.hap.ld',sep=''),
sep='\t') %>%
select(R.2) %>%
mutate(type=u,run=q)))
}
BW$run <- factor(BW$run,levels=c('Global',"Panana","Belize","Honduras",
"H. nigricans","H. puella","H. unicolor"))
dt2 <- BW %>%
group_by(run) %>%
summarise(meanR2=mean(R.2,na.rm = T),medR2=median(R.2,na.rm = T)) %>%
gather(key = 'type',value = 'val',2:3)
BC <-rgb(.7,.7,.7)
clr <-colorRampPalette(colors = c('white',BC,'black'))(8)
pBOX <- ggplot(BW,aes(x=run,y=R.2))+
geom_boxplot(fill=BC,width=.7,outlier.size = .1)+
coord_fixed(ylim=c(0,.031),ratio = 250)+
geom_point(inherit.aes = F, data=dt2,aes(x=run,y=val,fill=type),shape=23,size=1)+
scale_x_discrete(labels = expression(Global,Panama,Belize,Honduas,
italic("H. nigricans"),italic("H. puella"),italic("H. unicolor")))+
scale_y_continuous('genome wide r²')+
scale_fill_manual('',values = clr[c(6,1)],labels=c('mean','median'))+
guides(shape = guide_legend(ncol = 1))+
theme(legend.position = c(-.4,1.27),
text = element_text(size=10),
axis.title.x = element_blank(),
axis.text.y = element_text(size=7),
axis.text.x = element_text(size=7,angle=45,hjust = 1),
panel.background = element_blank(),
plot.background = element_blank())
\ No newline at end of file
dataBoxGenes <- data.frame(R.2=c(),run=c(),stringsAsFactors = F)
for (file in dir("../../2_output/08_popGen/07_LD/",pattern = "interchrom.hap.ld.gz")) {
nm <- str_remove_all(file, "spotlight.") %>% str_remove_all(.,".interchrom.hap.ld.gz")
if(nm %in% c("global","uni","pue","nig","hon","bel","boc")){
dataBoxGenes <- read.csv(gzfile(paste('../../2_output/08_popGen/07_LD/',file,sep='')),sep='\t') %>%
mutate(run = nm) %>%
select(R.2,run) %>%
rbind(dataBoxGenes,.)
}
}
dataBoxGenes$xS <- factor(dataBoxGenes$run,
levels = c("global","boc","bel","hon","nig","pue","uni"))
BoxGenes_summary <- dataBoxGenes %>%
group_by(xS) %>%
summarise(run = run[1],
meanR2 = mean(R.2,na.rm = T),
medR2 = median(R.2,na.rm = T),
sdR2 = sd(R.2,na.rm=T),
seR2 = se(R.2),
nanr = sum(is.na(R.2)),
minR2 = min(R.2,na.rm = T),
maxR2 = max(R.2,na.rm = T),
lengthR2 = length(R.2)) %>%
select(xS,meanR2,medR2) %>%
gather(key = 'type',value = 'val',2:3)
boxGenes <- ggplot(dataBoxGenes,aes(x=xS))+
geom_boxplot(aes(y=R.2),fill=BC,width=.7,outlier.size = .1) +
geom_point(data=BoxGenes_summary,aes(y=val,fill=type),shape=23,size=1)+
coord_fixed(ylim=c(0,.06),ratio = 133)+
scale_y_continuous('peak area r²')+
scale_x_discrete(labels = expression(Global,Panama,Belize,Honduas,
italic("H. nigricans"),italic("H. puella"),italic("H. unicolor")))+
scale_fill_manual('',values = clr[c(6,1)],labels=c('mean','median'))+
guides(shape = guide_legend(ncol = 1))+
theme(legend.position = c(.35,1.27),
text = element_text(size=10),
axis.title.x = element_blank(),
axis.text.y = element_text(size=7),
axis.text.x = element_text(size=7,angle=45,hjust = 1),
panel.background = element_blank(),
plot.background = element_blank())
\ No newline at end of file
---
output: html_document
editor_options:
chunk_output_type: console
chunk_output_type: console
---
# Figure 3
......
This diff is collapsed.
---
output: html_document
editor_options:
chunk_output_type: console
chunk_output_type: console
---
# Figure 5
......@@ -22,4 +22,88 @@ cd $WORK/3_figures/F_scripts
Rscript --vanilla F5.R
rm Rplots.pdf
```
\ No newline at end of file
```
## Details of F5.R
In the following, the individual steps of the R script are documented.
Is an executable R script that depends on a variety of image manipulation and data managing and genomic data packages.
It Furthermore depends on the R scripts `F4.functions.R` (located under `$WORK/0_data/0_scripts`).
This script is a modification of sript F4.R. It uses the same funtions and just differs in the data sets and settings
```{r head,results='hide',message=FALSE}
library(tidyverse)
library(scales)
library(cowplot)
library(grid)
library(gridSVG)
library(grImport2)
source('../../0_data/0_scripts/F4.functions.R')
```
The script `F4.functions.R`contains a function (`trplot()`) that plots a single LD triangle as seen in Figure 5.
The Details of this script are explained below.
The output depends on the data set plotted (sub figure a contains additional annotations).
We create an empty list that is then filled with the subplots using the `trplot()` function.
```{r basePlot,results='hide',message=FALSE}
plts <- list()
for(k in 1:3){
plts[[k]] <- trplot((8:10)[k])
}
```
The basic plots are transformed into `grid obgects`.
These are afterwards rotated by 45 degrees.
```{r grobPlot,results='hide', message=FALSE, warning=FALSE}
tN <- theme(legend.position = 'none')
pG8 <- ggplotGrob(plts[[1]]+tN)
pG9 <- ggplotGrob(plts[[2]]+tN)
pG10 <- ggplotGrob(plts[[3]]+tN)
pGr8 <- editGrob(pG8, vp=viewport(x=0.5, y=0.97, angle=45,width = .76), name="pG8")
pGr9 <- editGrob(pG9, vp=viewport(x=0.5, y=0.62, angle=45,width = .7), name="pG9")
pGr10 <- editGrob(pG10, vp=viewport(x=0.5, y=0.3, angle=45,width = .7), name="pG10")
```
Then, external annotations loaded and the legend ins extracted from the first plot.
```{r annotatePlot,results='hide', message=FALSE, warning=FALSE}
npGrob <- gTree(children=gList(pictureGrob(readPicture("../../0_data/0_img/pue-nig-cairo.svg"))))
puGrob <- gTree(children=gList(pictureGrob(readPicture("../../0_data/0_img/uni-pue-cairo.svg"))))
nuGrob <- gTree(children=gList(pictureGrob(readPicture("../../0_data/0_img/nig-uni-cairo.svg"))))
leg <- get_legend(plts[[1]]+theme(legend.text = element_text(size = 5),
legend.title = element_text(size = 5),
legend.key.size = unit(7,'pt')))
```
Finally, the complete Figure 5 is put together.
```{r finalPlot,results='hide', message=FALSE, warning=FALSE}
F5 <- ggdraw(pGr8)+
draw_grob(pGr9,0,0,1,1)+
draw_grob(leg,-.65,.04,1,1)+
draw_grob(pGr10,0,0,1,1)+
draw_grob(npGrob, 0.7, 0.7, 0.28, 0.1)+
draw_grob(nuGrob, 0.7, 0.37, 0.28, 0.1)+
draw_grob(puGrob, 0.7, .04, 0.28, 0.1)
```
The final figure is then exported using `ggsave()`.
```{r, eval=FALSE}
#ggsave(plot = F5,filename = '../output/F5.pdf',width = 91.5,height = 145,units = 'mm',device = cairo_pdf)
ggsave(plot = F5,filename = '../output/F5.png',width = 91.5,height = 145,units = 'mm',dpi = 150)
```
<center>
```{r f5SHOW, echo=FALSE, fig.height=145*0.03937008, fig.width=91.5*0.03937008, warning=FALSE}
F5
```
</center>
---
\ No newline at end of file
This diff is collapsed.
#!/usr/bin/env Rscript
library(tidyverse)
library(scales)
library(cowplot)
library(grid)
library(gridSVG)
library(grImport2)
source('../../0_data/0_scripts/F4.functions.R')
plts <- list()
for(k in 1:3){
plts[[k]] <- trplot((8:10)[k])
}
tN <- theme(legend.position = 'none')
pG8 <- ggplotGrob(plts[[1]]+tN)
pG9 <- ggplotGrob(plts[[2]]+tN)
pG10 <- ggplotGrob(plts[[3]]+tN)
pGr8 <- editGrob(pG8, vp=viewport(x=0.5, y=0.97, angle=45,width = .76), name="pG8")
pGr9 <- editGrob(pG9, vp=viewport(x=0.5, y=0.62, angle=45,width = .7), name="pG9")
pGr10 <- editGrob(pG10, vp=viewport(x=0.5, y=0.3, angle=45,width = .7), name="pG10")
npGrob <- gTree(children=gList(pictureGrob(readPicture("../../0_data/0_img/pue-nig-cairo.svg"))))
puGrob <- gTree(children=gList(pictureGrob(readPicture("../../0_data/0_img/uni-pue-cairo.svg"))))
nuGrob <- gTree(children=gList(pictureGrob(readPicture("../../0_data/0_img/nig-uni-cairo.svg"))))
leg <- get_legend(plts[[1]]+theme(legend.text = element_text(size = 5),
legend.title = element_text(size = 5),
legend.key.size = unit(7,'pt')))
F5 <- ggdraw(pGr8)+
draw_grob(pGr9,0,0,1,1)+
draw_grob(leg,-.65,.04,1,1)+
draw_grob(pGr10,0,0,1,1)+
draw_grob(npGrob, 0.7, 0.7, 0.28, 0.1)+
draw_grob(nuGrob, 0.7, 0.37, 0.28, 0.1)+
draw_grob(puGrob, 0.7, .04, 0.28, 0.1)
#ggsave(plot = F5,filename = '../output/F5.pdf',width = 91.5,height = 145,units = 'mm',device = cairo_pdf)
ggsave(plot = F5,filename = '../output/F5.png',width = 91.5,height = 145,units = 'mm',dpi = 150)
\ No newline at end of file
# S01
---
output: html_document
editor_options:
chunk_output_type: console
---
# Supplement Figure S01
This is the accessory documentation of Supplementary Figure 01.
It explains the steps of script **2.2.0.1.maf2circos.sh** and documents progression from the whole genome alignment of the *de novo* *Hypoplectrus puella* genome assembly with the *Gasterosteus aculeatus* reference genome.
......
# S08
---
output: html_document
editor_options:
chunk_output_type: console
---
# Supplement Figure S08
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
......
......@@ -31,6 +31,12 @@ edgR <- function(pts,edg){
## Info
In the following, I give an overview over the individual steps done in during *de novo* assembly of the barred hamlet (*Hypoplectrus puella*) genome.
Within the scheme, each arrow represents a script (or class of scripts) connecting individual setps of the assembly/ analysis.
The respective scripts are store in the folders `$WORK/1_assembly_scripts` & `$WORK/2_reSeq-scripts`.
For the final visualization (the green squares in panel 2.2.Popgen), additional documetation is provided in the following pages.
```{r data_prep,echo=FALSE}
source('workflow/points_and_edges_assembly.R')
source('workflow/points_and_edges_analysis.R')
......
......@@ -118,6 +118,8 @@ gwFST <- read.csv('../../2_output/08_popGen/05_fst/genome_wide_weighted_mean_fst
gwFST$RUN <- factor(gwFST$run,levels=levels(data$RUN))
```
### Computing 99.98 *F~ST~* percentiles
The upper 99.98 *F~ST~* percintile is computed per run.
Then windows above this threshold are indentified for each global run.
......@@ -153,6 +155,8 @@ musks <- data2 %>% group_by(musk) %>% summarise(MUSKmin=min(xmin),
MUSKmin-1e+07,MUSKmax+1e+07))
```
### Plotting
For plotting, colors,labels and the scaling of the secondary axis are pre-defined.
......@@ -234,6 +238,8 @@ yd <- .2195
boxes = data.frame(x=rep(.9675,4),y=c(ys,ys+yd+ysc,ys+(yd+ysc)*2,ys+(yd+ysc)*3))
```
### Composing the final figure
And finally the base plot is combined with the external annotations.
......
---
output: html_document
editor_options:
chunk_output_type: console
chunk_output_type: console
---
# Figure 3
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
---
output: html_document
editor_options:
chunk_output_type: console
chunk_output_type: console
---
# Figure 5
......@@ -20,3 +20,91 @@ Rscript --vanilla F5.R
rm Rplots.pdf
```
## Details of F5.R
In the following, the individual steps of the R script are documented.
Is an executable R script that depends on a variety of image manipulation and data managing and genomic data packages.
It Furthermore depends on the R scripts `F4.functions.R` (located under `$WORK/0_data/0_scripts`).
This script is a modification of sript F4.R. It uses the same funtions and just differs in the data sets and settings
```r
library(tidyverse)
library(scales)
library(cowplot)
library(grid)
library(gridSVG)
library(grImport2)
source('../../0_data/0_scripts/F4.functions.R')
```
The script `F4.functions.R`contains a function (`trplot()`) that plots a single LD triangle as seen in Figure 5.
The Details of this script are explained below.
The output depends on the data set plotted (sub figure a contains additional annotations).
We create an empty list that is then filled with the subplots using the `trplot()` function.
```r
plts <- list()
for(k in 1:3){
plts[[k]] <- trplot((8:10)[k])
}
```
The basic plots are transformed into `grid obgects`.
These are afterwards rotated by 45 degrees.
```r
tN <- theme(legend.position = 'none')
pG8 <- ggplotGrob(plts[[1]]+tN)
pG9 <- ggplotGrob(plts[[2]]+tN)
pG10 <- ggplotGrob(plts[[3]]+tN)
pGr8 <- editGrob(pG8, vp=viewport(x=0.5, y=0.97, angle=45,width = .76), name="pG8")
pGr9 <- editGrob(pG9, vp=viewport(x=0.5, y=0.62, angle=45,width = .7), name="pG9")
pGr10 <- editGrob(pG10, vp=viewport(x=0.5, y=0.3, angle=45,width = .7), name="pG10")
```
Then, external annotations loaded and the legend ins extracted from the first plot.
```r
npGrob <- gTree(children=gList(pictureGrob(readPicture("../../0_data/0_img/pue-nig-cairo.svg"))))
puGrob <- gTree(children=gList(pictureGrob(readPicture("../../0_data/0_img/uni-pue-cairo.svg"))))
nuGrob <- gTree(children=gList(pictureGrob(readPicture("../../0_data/0_img/nig-uni-cairo.svg"))))
leg <- get_legend(plts[[1]]+theme(legend.text = element_text(size = 5),
legend.title = element_text(size = 5),
legend.key.size = unit(7,'pt')))
```
Finally, the complete Figure 5 is put together.
```r
F5 <- ggdraw(pGr8)+
draw_grob(pGr9,0,0,1,1)+
draw_grob(leg,-.65,.04,1,1)+
draw_grob(pGr10,0,0,1,1)+
draw_grob(npGrob, 0.7, 0.7, 0.28, 0.1)+
draw_grob(nuGrob, 0.7, 0.37, 0.28, 0.1)+
draw_grob(puGrob, 0.7, .04, 0.28, 0.1)
```
The final figure is then exported using `ggsave()`.
```r
#ggsave(plot = F5,filename = '../output/F5.pdf',width = 91.5,height = 145,units = 'mm',device = cairo_pdf)
ggsave(plot = F5,filename = '../output/F5.png',width = 91.5,height = 145,units = 'mm',dpi = 150)
```
<center>
<img src="F5_files/figure-html/f5SHOW-1.png" width="345.82678272" />
</center>
---
......@@ -5,6 +5,12 @@
In the following, I give an overview over the individual steps done in during *de novo* assembly of the barred hamlet (*Hypoplectrus puella*) genome.
Within the scheme, each arrow represents a script (or class of scripts) connecting individual setps of the assembly/ analysis.
The respective scripts are store in the folders `$WORK/1_assembly_scripts` & `$WORK/2_reSeq-scripts`.
For the final visualization (the green squares in panel 2.2.Popgen), additional documetation is provided in the following pages.
<center>
<img src="Workflow_files/figure-html/plot-1.png" width="2304" />
</center>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -25,7 +25,7 @@
<meta name="author" content="Kosmas Hench">
<meta name="date" content="2018-06-13">
<meta name="date" content="2018-06-14">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
......@@ -123,16 +123,26 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
<li class="chapter" data-level="4.1" data-path="figure-2.html"><a href="figure-2.html#summary-1"><i class="fa fa-check"></i><b>4.1</b> Summary</a></li>
<li class="chapter" data-level="4.2" data-path="figure-2.html"><a href="figure-2.html#details-of-f2.r"><i class="fa fa-check"></i><b>4.2</b> Details of F2.R</a><ul>
<li class="chapter" data-level="4.2.1" data-path="figure-2.html"><a href="figure-2.html#reading-in-data"><i class="fa fa-check"></i><b>4.2.1</b> Reading in Data</a></li>
<li class="chapter" data-level="4.2.2" data-path="figure-2.html"><a href="figure-2.html#computing-99.98-fst-percentiles"><i class="fa fa-check"></i><b>4.2.2</b> Computing 99.98 <em>F<sub>ST</sub></em> percentiles</a></li>
<li class="chapter" data-level="4.2.3" data-path="figure-2.html"><a href="figure-2.html#plotting"><i class="fa fa-check"></i><b>4.2.3</b> Plotting</a></li>
<li class="chapter" data-level="4.2.4" data-path="figure-2.html"><a href="figure-2.html#composing-the-final-figure"><i class="fa fa-check"></i><b>4.2.4</b> Composing the final figure</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="5" data-path="figure-3.html"><a href="figure-3.html"><i class="fa fa-check"></i><b>5</b> Figure 3</a><ul>
<li class="chapter" data-level="5.1" data-path="figure-3.html"><a href="figure-3.html#summary-2"><i class="fa fa-check"></i><b>5.1</b> Summary</a></li>
<li class="chapter" data-level="5.2" data-path="figure-3.html"><a href="figure-3.html#details-of-f3.r"><i class="fa fa-check"></i><b>5.2</b> Details of F3.R</a></li>
<li class="chapter" data-level="5.3" data-path="figure-3.html"><a href="figure-3.html#details-of-f3.plot_fun.r"><i class="fa fa-check"></i><b>5.3</b> Details of F3.plot_fun.R</a></li>
</ul></li>
<li class="chapter" data-level="6" data-path="figure-4.html"><a href="figure-4.html"><i class="fa fa-check"></i><b>6</b> Figure 4</a><ul>
<li class="chapter" data-level="6.1" data-path="figure-4.html"><a href="figure-4.html#summary-3"><i class="fa fa-check"></i><b>6.1</b> Summary</a></li>
<li class="chapter" data-level="6.2" data-path="figure-4.html"><a href="figure-4.html#details-of-f4.r"><i class="fa fa-check"></i><b>6.2</b> Details of F4.R</a></li>
<li class="chapter" data-level="6.3" data-path="figure-4.html"><a href="figure-4.html#details-of-f4.functions.r"><i class="fa fa-check"></i><b>6.3</b> Details of F4.functions.R</a></li>
<li class="chapter" data-level="6.4" data-path="figure-4.html"><a href="figure-4.html#details-of-f4.genomewide_box.r"><i class="fa fa-check"></i><b>6.4</b> Details of F4.genomeWide_box.R</a></li>
<li class="chapter" data-level="6.5" data-path="figure-4.html"><a href="figure-4.html#details-of-f4.peakarea_box.r"><i class="fa fa-check"></i><b>6.5</b> Details of F4.peakArea_box.R</a></li>
</ul></li>
<li class="chapter" data-level="7" data-path="figure-5.html"><a href="figure-5.html"><i class="fa fa-check"></i><b>7</b> Figure 5</a><ul>
<li class="chapter" data-level="7.1" data-path="figure-5.html"><a href="figure-5.html#summary-4"><i class="fa fa-check"></i><b>7.1</b> Summary</a></li>
<li class="chapter" data-level="7.2" data-path="figure-5.html"><a href="figure-5.html#details-of-f5.r"><i class="fa fa-check"></i><b>7.2</b> Details of F5.R</a></li>
</ul></li>
<li class="chapter" data-level="8" data-path="s01.html"><a href="s01.html"><i class="fa fa-check"></i><b>8</b> S01</a><ul>
<li class="chapter" data-level="8.1" data-path="s01.html"><a href="s01.html#preparation"><i class="fa fa-check"></i><b>8.1</b> Preparation</a></li>
......@@ -163,7 +173,7 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
<h1><span class="header-section-number">3</span> Figure 1</h1>
<div id="summary" class="section level2">
<h2><span class="header-section-number">3.1</span> Summary</h2>
<p>This is the accessory documentation of Figure 1. The Figure can be recreated by using runing the <strong>R</strong> script F1.R:</p>
<p>This is the accessory documentation of Figure 1. The Figure can be recreated by runing the <strong>R</strong> script F1.R:</p>