Commit e4900339 authored by Kosmas Hench's avatar Kosmas Hench

update figures

parent 8ec8eaab
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -32,7 +32,8 @@ create_K_plot <- function(searchLG,gfffile,xr,searchgene,secondary_genes,searchs
clr <- c('#fb8620','#1b519c','#d93327')
annoclr <- c('lightgray',highclr,rgb(.3,.3,.3))[1:3]
df_list[[1]] <- df_list[[1]] %>% mutate(label=paste("italic(",tolower(Parentgenename),")",sep='') )
df_list[[1]] <- df_list[[1]] %>%
mutate(label=paste("italic(",tolower(Parentgenename),")",sep='') )
LW <- .3;lS <- 9;tS <- 6
plotSET <- theme(rect = element_blank(),
......@@ -67,7 +68,7 @@ create_K_plot <- function(searchLG,gfffile,xr,searchgene,secondary_genes,searchs
# color settings
scale_color_manual(values=annoclr,breaks=c("x","y","z"),guide=F)+
scale_fill_manual(values=annoclr,guide=F)+
scale_x_continuous(name=paste(searchLG,' (',muskID,', kb)'),expand=c(0,0),position = 'top')+
scale_x_continuous(name=paste0(searchLG,' (',muskID,', kb)'),expand=c(0,0),position = 'top')+
scale_y_continuous(breaks = seq(0,.75,length.out = 4))+
theme(rect = element_blank(),
text=element_text(size=tS,color='black'),
......@@ -130,7 +131,8 @@ create_K_plot <- function(searchLG,gfffile,xr,searchgene,secondary_genes,searchs
,aes(x=POS,y=avgp_wald,col=run),lwd=LW)+
# geom_line(data=(data_pfst_pw %>% filter(POS > xr[1],POS<xr[2]))
# ,aes(x=POS,y=avgp_wald,col=run,linetype=group),lwd=1)+
scale_color_manual(values=c(clr,annoclr),breaks=c("nig-pue","nig-uni","pue-uni","x","y","z"),guide=F)+
scale_color_manual(values=c(clr,annoclr),
breaks=c("nig-pue","nig-uni","pue-uni","x","y","z"),guide=F)+
facet_grid(window~.,scales='free_y',
switch = 'y',labeller = label_parsed,as.table = T)+
scale_x_continuous(name=searchLG,expand=c(0,0),position = 'top')+
......@@ -151,7 +153,7 @@ create_K_plot <- function(searchLG,gfffile,xr,searchgene,secondary_genes,searchs
scale_linetype(name='location',label=c('Belize','Honduras','Panama'))+
guides(linetype= guide_legend(override.aes = list(color = 'black')))+plotSET
p2 <- plot_grid(p11,p12,p13,p14,
ncol = 1,align = 'v',axis = 'r',rel_heights = c(1.3,rep(1,3)))
ncol = 1,align = 'v',axis = 'r',
rel_heights = c(1.3,rep(1,3)))
return(p2)}
\ No newline at end of file
......@@ -34,7 +34,7 @@ pBOX <- ggplot(BW,aes(x=run,y=R.2))+
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 ')+
scale_y_continuous('genome wide ILD (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),
......
......@@ -30,8 +30,8 @@ BoxGenes_summary <- dataBoxGenes %>%
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²')+
coord_fixed(ylim=c(0,.031),ratio = 250)+
scale_y_continuous('ILD around \ncandidate genes (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'))+
......
......@@ -88,7 +88,7 @@ create_K_plot <- function(searchLG,gfffile,xr,searchgene,secondary_genes,searchs
# color settings
scale_color_manual(values=annoclr,breaks=c("x","y","z"),guide=F)+
scale_fill_manual(values=annoclr,guide=F)+
scale_x_continuous(name=paste(searchLG,' (',muskID,', kb)'),expand=c(0,0),position = 'top')+
scale_x_continuous(name=paste0(searchLG,' (',muskID,', kb)'),expand=c(0,0),position = 'top')+
scale_y_continuous(breaks = seq(0,.75,length.out = 4))+
theme(rect = element_blank(),
text=element_text(size=tS,color='black'),
......
#PBS -l elapstim_req=02:00:00
#PBS -l memsz_job=80gb
#PBS -b 1
#PBS -l cpunum_job=1
#PBS -N fstGlobal
#PBS -q clexpress
#PBS -o 2.2.5.4.fst_gw_bel.stdout
#PBS -e 2.2.5.4.fst_gw_bel.stderr
cd $WORK/2_output/08_popGen/05_fst
vcftools --gzvcf $WORK/2_output/07_phased_variants/6_phased_mac2.vcf.gz \
--keep $WORK/0_data/0_resources/vcfpops/vcftools_bel.pop \
--weir-fst-pop $WORK/0_data/0_resources/vcfpops/vcftools_nigbel.pop \
--weir-fst-pop $WORK/0_data/0_resources/vcfpops/vcftools_puebel.pop \
--out fst.gw.nigbel-puebel
vcftools --gzvcf $WORK/2_output/07_phased_variants/6_phased_mac2.vcf.gz \
--keep $WORK/0_data/0_resources/vcfpops/vcftools_bel.pop \
--weir-fst-pop $WORK/0_data/0_resources/vcfpops/vcftools_nigbel.pop \
--weir-fst-pop $WORK/0_data/0_resources/vcfpops/vcftools_unibel.pop \
--out fst.gw.nigbel-unibel
vcftools --gzvcf $WORK/2_output/07_phased_variants/6_phased_mac2.vcf.gz \
--keep $WORK/0_data/0_resources/vcfpops/vcftools_bel.pop \
--weir-fst-pop $WORK/0_data/0_resources/vcfpops/vcftools_puebel.pop \
--weir-fst-pop $WORK/0_data/0_resources/vcfpops/vcftools_unibel.pop \
--out fst.gw.puebel-unibel
\ No newline at end of file
#PBS -l elapstim_req=02:00:00
#PBS -l memsz_job=80gb
#PBS -b 1
#PBS -l cpunum_job=1
#PBS -N fstGlobal
#PBS -q clexpress
#PBS -o 2.2.5.4.fst_gw_hon.stdout
#PBS -e 2.2.5.4.fst_gw_hon.stderr
cd $WORK/2_output/08_popGen/05_fst
vcftools --gzvcf $WORK/2_output/07_phased_variants/6_phased_mac2.vcf.gz \
--keep $WORK/0_data/0_resources/vcfpops/vcftools_hon.pop \
--weir-fst-pop $WORK/0_data/0_resources/vcfpops/vcftools_nighon.pop \
--weir-fst-pop $WORK/0_data/0_resources/vcfpops/vcftools_puehon.pop \
--out fst.gw.nighon-puehon
vcftools --gzvcf $WORK/2_output/07_phased_variants/6_phased_mac2.vcf.gz \
--keep $WORK/0_data/0_resources/vcfpops/vcftools_hon.pop \
--weir-fst-pop $WORK/0_data/0_resources/vcfpops/vcftools_nighon.pop \
--weir-fst-pop $WORK/0_data/0_resources/vcfpops/vcftools_unihon.pop \
--out fst.gw.nighon-unihon
vcftools --gzvcf $WORK/2_output/07_phased_variants/6_phased_mac2.vcf.gz \
--keep $WORK/0_data/0_resources/vcfpops/vcftools_hon.pop \
--weir-fst-pop $WORK/0_data/0_resources/vcfpops/vcftools_puehon.pop \
--weir-fst-pop $WORK/0_data/0_resources/vcfpops/vcftools_unihon.pop \
--out fst.gw.puehon-unihon
\ No newline at end of file
#PBS -l elapstim_req=02:00:00
#PBS -l memsz_job=80gb
#PBS -b 1
#PBS -l cpunum_job=1
#PBS -N fstGlobal
#PBS -q clexpress
#PBS -o 2.2.5.4.fst_gw_bel.stdout
#PBS -e 2.2.5.4.fst_gw_bel.stderr
cd $WORK/2_output/08_popGen/05_fst
vcftools --gzvcf $WORK/2_output/07_phased_variants/6_phased_mac2.vcf.gz \
--keep $WORK/0_data/0_resources/vcfpops/vcftools_bel.pop \
--weir-fst-pop $WORK/0_data/0_resources/vcfpops/vcftools_nigbel.pop \
--weir-fst-pop $WORK/0_data/0_resources/vcfpops/vcftools_puebel.pop \
--out fst.gw.nigbel-puebel
vcftools --gzvcf $WORK/2_output/07_phased_variants/6_phased_mac2.vcf.gz \
--keep $WORK/0_data/0_resources/vcfpops/vcftools_bel.pop \
--weir-fst-pop $WORK/0_data/0_resources/vcfpops/vcftools_nigbel.pop \
--weir-fst-pop $WORK/0_data/0_resources/vcfpops/vcftools_unibel.pop \
--out fst.gw.nigbel-unibel
vcftools --gzvcf $WORK/2_output/07_phased_variants/6_phased_mac2.vcf.gz \
--keep $WORK/0_data/0_resources/vcfpops/vcftools_bel.pop \
--weir-fst-pop $WORK/0_data/0_resources/vcfpops/vcftools_puebel.pop \
--weir-fst-pop $WORK/0_data/0_resources/vcfpops/vcftools_unibel.pop \
--out fst.gw.puebel-unibel
\ No newline at end of file
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -13,7 +13,7 @@ knitr::opts_knit$set(root.dir = './F_scripts')
## Summary
This is the accessory documentation of Figure 1.
The Figure can be recreated by running the **R** script F1.R:
The Figure can be recreated by running the **R** script `F1.R`:
```sh
cd $WORK/3_figures/F_scripts
......@@ -22,7 +22,7 @@ rm Rplots.pdf
```
## Details of F1.R
## Details of `F1.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 geodata packages.
Additionally, the supporting R script (**F1.functions.R**) in needed:
......
......@@ -14,7 +14,7 @@ knitr::opts_knit$set(root.dir = './F_scripts')
This is the accessory documentation of Figure 2.
The Figure can be recreated by running the **R** script F2.R:
The Figure can be recreated by running the **R** script `F2.R`:
```sh
cd $WORK/3_figures/F_scripts
......@@ -23,7 +23,7 @@ Rscript --vanilla F2.R
rm Rplots.pdf
```
## Details of F2.R
## Details of `F2.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 packages.
......@@ -185,7 +185,8 @@ p1 <- ggplot()+
# genome wide Fst
geom_rect(data=gwFST,aes(xmin=570*10^6,xmax=573*10^6,ymin=0,ymax=gwFST*secScale))+
# layout of y axis and secondary y axis
scale_y_continuous(name = yl,breaks=0:4*0.2,labels = c(0,'',0.4,'',0.8),
scale_y_continuous(name = yl,limits=c(-.03,.83),
breaks=0:4*0.2,labels = c(0,'',0.4,'',0.8),
sec.axis = sec_axis(~./secScale,labels = c(0,'',.02,'',.04)))+
# layout of x axis
scale_x_continuous(expand = c(0,0),limits = c(0,577*10^6),
......
......@@ -14,7 +14,7 @@ knitr::opts_knit$set(root.dir = './F_scripts')
This is the accessory documentation of Figure 3.
The Figure can be recreated by running the **R** script F3.R:
The Figure can be recreated by running the **R** script `F3.R`:
```sh
cd $WORK/3_figures/F_scripts
......@@ -23,7 +23,7 @@ Rscript --vanilla F3.R
rm Rplots.pdf
```
## Details of F3.R
## Details of `F3.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.
......@@ -112,11 +112,11 @@ F3
</center>
---
## Details of F3.plot_fun.R
## Details of `F3.plot_fun.R`
The actual work for figure 3 is done within the `create_K_plot()` function.
This function loads the data and does the plotting - the F3.R script is basically just a wrapper that selects the setting for each subplot and combines the results.
This function loads the data and does the plotting - the `F3.R` script is basically just a wrapper that selects the setting for each subplot and combines the results.
The function starts by importing the functions need to import the different data types (gene models, *F~ST~* values, GxP p values, d~XY~)
......@@ -128,7 +128,7 @@ create_K_plot <- function(searchLG,gfffile,xr,searchgene,secondary_genes,searchs
source('../../0_data/0_scripts/F3.getDXY.R')
```
It then sets some global options for the plotting and throws an error if the genomic range illogical.
It then sets some global options for the plotting and throws an error if the genomic range is negative.
```{r, eval=FALSE}
highclr <- '#3bb33b'
......@@ -211,7 +211,7 @@ The first data track contains the gene models from the annotation file as well a
scale_color_manual(values=annoclr,breaks=c("x","y","z"),guide=F)+
scale_fill_manual(values=annoclr,guide=F)+
# axes labels and settings
scale_x_continuous(name=paste(searchLG,' (',muskID,', kb)'),expand=c(0,0),position = 'top')+
scale_x_continuous(name=paste0(searchLG,' (',muskID,', kb)'),expand=c(0,0),position = 'top')+
scale_y_continuous(breaks = seq(0,.75,length.out = 4))+
# plot format adjustments
theme(rect = element_blank(),
......
......@@ -13,7 +13,7 @@ knitr::opts_knit$set(root.dir = './F_scripts')
This is the accessory documentation of Figure 4.
The Figure can be recreated by running the **R** script F4.R:
The Figure can be recreated by running the **R** script `F4.R`:
```sh
cd $WORK/3_figures/F_scripts
......@@ -22,7 +22,7 @@ Rscript --vanilla F4.R
rm Rplots.pdf
```
## Details of F4.R
## Details of `F4.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.
......@@ -150,7 +150,7 @@ F4
</center>
---
## Details of F4.functions.R
## Details of `F4.functions.R`
The script first defines a function for standard error
```{r eval=FALSE}
......@@ -415,12 +415,12 @@ Finally, the function returns the current base plot stored in `p1`.
---
## Details of F4.genomeWide_box.R
## Details of `F4.genomeWide_box.R`
Within this script, the ILD data of the genome wide subsets of SNPs is loaded and and plotted.
First we read in the global data set, then we loop over the individual population subsets and append the data to the global data set.
Since we're only interested in the distribution of r^2, we select only this column and create extra columns for the run ID, and the run type (global, subset by species, subset by location)
Since we're only interested in the distribution of r[2], we select only this column and create extra columns for the run ID, and the run type (global, subset by species, subset by location)
```{r eval=FALSE}
BW <- read.csv('../../2_output/08_popGen/07_LD/subsets/glob_between.interchrom.hap.ld',sep='\t') %>%
......@@ -480,7 +480,7 @@ pBOX <- ggplot(BW,aes(x=run,y=R.2))+
# settting the axis and color labels
scale_x_discrete(labels = expression(Global,Panama,Belize,Honduas,
italic("H. nigricans"),italic("H. puella"),italic("H. unicolor")))+
scale_y_continuous('genome wide ')+
scale_y_continuous('genome wide ILD (r²)')+
scale_fill_manual('',values = clr[c(6,1)],labels=c('mean','median'))+
# formatting the legend
guides(shape = guide_legend(ncol = 1))+
......@@ -497,7 +497,7 @@ pBOX <- ggplot(BW,aes(x=run,y=R.2))+
---
## Details of F4.peakArea_box.R
## Details of `F4.peakArea_box.R`
Within this script, the ILD data of the peak area subsets of SNPs is loaded and and plotted.
......@@ -553,9 +553,9 @@ boxGenes <- ggplot(dataBoxGenes,aes(x=xS))+
# adding mean and median values
geom_point(data=BoxGenes_summary,aes(y=val,fill=type),shape=23,size=1)+
# set a fixed aspect ratio
coord_fixed(ylim=c(0,.06),ratio = 133)+
coord_fixed(ylim=c(0,.031),ratio = 133)+
# settting the axis and color labels
scale_y_continuous('peak area r²')+
scale_y_continuous('ILD around \ncandidate genes (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'))+
......
......@@ -14,7 +14,7 @@ knitr::opts_knit$set(root.dir = './F_scripts')
This is the accessory documentation of Figure 5.
The Figure can be recreated by running the **R** script F5.R:
The Figure can be recreated by running the **R** script `F5.R`:
```sh
cd $WORK/3_figures/F_scripts
......@@ -23,14 +23,14 @@ Rscript --vanilla F5.R
rm Rplots.pdf
```
## Details of F5.R
## 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 script F4.R. It uses the same functions and just differs in the data sets and settings
This script is a modification of script `F4.R`. It uses the same functions and just differs in the data sets and settings
```{r head,results='hide',message=FALSE}
library(tidyverse)
......
......@@ -106,7 +106,7 @@ p1 <- ggplot()+
geom_text(data=musks,aes(x=muskX,y=.65,label=musk))+
geom_vline(data = data.frame(x=567000000),aes(xintercept=x),col=annoclr,lwd=.2)+
geom_rect(data=gwFST,aes(xmin=570*10^6,xmax=573*10^6,ymin=0,ymax=gwFST*secScale))+
scale_y_continuous(name = yl,breaks=0:4*0.2,labels = c(0,'',0.4,'',0.8),
scale_y_continuous(name = yl,limits=c(-.03,.83),breaks=0:4*0.2,labels = c(0,'',0.4,'',0.8),
sec.axis = sec_axis(~./secScale,labels = c(0,'',.02,'',.04)))+
scale_x_continuous(expand = c(0,0),limits = c(0,577*10^6),
breaks = c((karyo$GSTART+karyo$GEND)/2,571*10^6),
......
......@@ -42,5 +42,6 @@ F3 <- plot_grid(NULL,NULL,NULL,NULL,
'','','',''),label_size = 10)+
draw_grob(legGrob, 0.1, 0, .8, 0.04)
ggsave(plot = F3,filename = '../output/F3.pdf',width = 183,height = 155,units = 'mm',device = cairo_pdf)
ggsave(plot = F3,filename = '../output/F3.pdf',
width = 183,height = 155,units = 'mm',device = cairo_pdf)
#ggsave('ranges_all_label.pdf',width = 183,height = 120,units = 'mm',device = cairo_pdf)
......@@ -78,7 +78,8 @@ p1 <- ggplot()+
geom_vline(data=data2,aes(xintercept=xmean),col=annoclr,lwd=.2)+
geom_point(data=data,aes(x=GPOS,y=avgp_wald,col=COL),size=.01)+
geom_text(data=musks,aes(x=muskX,y=9.5,label=musk))+
scale_y_continuous(name = yl,breaks=0:4*2.5,labels = c(0,'',5,'',10))+
scale_y_continuous(name = yl,limits=c(-.3,11),
breaks=0:4*2.5,labels = c(0,'',5,'',10))+
scale_x_continuous(expand = c(0,0),breaks = (karyo$GSTART+karyo$GEND)/2,labels = 1:24,position = "top")+
scale_color_manual(name='comparison',values=clr)+
scale_fill_manual(values = c(NA,lgclr),guide=F)+
......
......@@ -74,9 +74,10 @@ p1 <- ggplot()+
geom_rect(inherit.aes = F,data=karyo,aes(xmin=GSTART,xmax=GEND,
ymin=-Inf,ymax=Inf,fill=GROUP))+
geom_vline(data=data2,aes(xintercept=xmean),col=annoclr,lwd=.2)+
geom_text(data=musks,aes(x=muskX,y=.55,label=musk))+
geom_text(data=musks,aes(x=muskX,y=.7,label=musk))+
geom_point(data=data,aes(x=GPOS,y=WEIGHTED_FST,col=COL),size=.01)+
scale_y_continuous(name = yl,breaks=yT,labels = c(yT[1],'',yT[3],'',yT[5]))+
scale_y_continuous(name = yl,limits=c(-.03,.83),
breaks=yT,labels = c(yT[1],'',yT[3],'',yT[5]))+
scale_x_continuous(expand = c(0,0),breaks = (karyo$GSTART+karyo$GEND)/2,labels = 1:24,position = "top")+
scale_color_manual(name='comparison',values=clr)+
scale_fill_manual(values = c(NA,lgclr),guide=F)+
......
......@@ -73,9 +73,10 @@ p1 <- ggplot()+
geom_rect(inherit.aes = F,data=karyo,aes(xmin=GSTART,xmax=GEND,
ymin=-Inf,ymax=Inf,fill=GROUP))+
geom_vline(data=data2,aes(xintercept=xmean),col=annoclr,lwd=.2)+
geom_text(data=musks,aes(x=muskX,y=5.5,label=musk))+
geom_text(data=musks,aes(x=muskX,y=8.5,label=musk))+
geom_point(data=data,aes(x=GPOS,y=avgp_wald,col=COL),size=.01)+
scale_y_continuous(name = yl,breaks=0:4*2.5,labels = c(0,'',5,'',10))+
scale_y_continuous(name = yl,limits=c(-.3,11),
breaks=0:4*2.5,labels = c(0,'',5,'',10))+
scale_x_continuous(expand = c(0,0),breaks = (karyo$GSTART+karyo$GEND)/2,labels = 1:24,position = "top")+
scale_color_manual(name='comparison',values=clr)+
scale_fill_manual(values = c(NA,lgclr),guide=F)+
......
......@@ -27,19 +27,19 @@ p4 <- create_K_plot(searchLG = "LG17",gfffile = '../../1-output/09_gff_from_IKMB
secondary_genes = c("Hcfc1","HCFC1_2","HCFC1_1","GNL3L","TFE3_0","MDFIC2_1","CXXC1_3","CXXC1_1",'Mbd1','CCDC120'),
muskID = 'D')
legGrob <- gTree(children=gList(pictureGrob(readPicture("../../0_data/0_img/legend-pw-cairo.svg"))))
legGrob <- gTree(children=gList(pictureGrob(readPicture("../../0_data/0_img/legend-pw-single-cairo.svg"))))
S11 <- plot_grid(NULL,NULL,NULL,NULL,
p1,NULL,p2,NULL,
NULL,NULL,NULL,NULL,
p3,NULL,p4,NULL,
NULL,NULL,NULL,NULL,
ncol=4,rel_heights = c(.03,1,.03,1,.1),rel_widths = c(1,.025,1,.02),
ncol=4,rel_heights = c(.03,1,.03,1,.1),rel_widths = c(1,.025,1,.04),
labels = c('a','','b','',
'','','','',
'c','','d','',
'','','','',
'','','',''),label_size = 10)+
draw_grob(legGrob, 0.1, 0, .8, 0.04)
draw_grob(legGrob, 0.05, 0, .9, 0.04)
ggsave(plot = S11,filename = '../output/S11.pdf',width = 183,height = 210,units = 'mm',device = cairo_pdf)
......@@ -10,7 +10,7 @@ source('../../0_data/0_scripts/S07.functions.R')
plts <- list()
for(k in 1:3){
plts[[k]] <- trplot((8:10)[k])
plts[[k]] <- trplot((8:10)[k])
}
tN <- theme(legend.position = 'none')
......
......@@ -16,4 +16,4 @@ p1 <- ggdraw()+
draw_grob(GA, 0, .84, .25, .2)+
draw_grob(HP, 0.75,.83,.25,.2)
ggsave(plot = p1,filename = 'S01.pdf',width = 183,height = 183,units = 'mm',device = cairo_pdf)
ggsave(plot = p1,filename = '../output/S01.pdf',width = 183,height = 183,units = 'mm',device = cairo_pdf)
......@@ -1649,7 +1649,7 @@
</symbol>
</g>
</defs>
<g id="surface5">
<g id="surface1">
<rect x="0" y="0" width="900" height="900" style="fill:rgb(100%,100%,100%);fill-opacity:1;stroke:none;"/>
<path style="fill-rule:nonzero;fill:rgb(3.921569%,14.117647%,41.568627%);fill-opacity:1;stroke-width:0.1;stroke-linecap:round;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:4;" d="M 495.648438 125.191406 C 508.886719 127.050781 522 129.71875 534.910156 133.179688 L 540.863281 110.964844 C 527.046875 107.261719 513.015625 104.40625 498.851562 102.414062 Z M 495.648438 125.191406 "/>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
......
......@@ -13,7 +13,7 @@ knitr::opts_knit$set(root.dir = './F_scripts')
This is the accessory documentation of Supplementary Figure 02.
The Figure can be recreated by running the **R** script S02.R:
The Figure can be recreated by running the **R** script `S02.R`:
```sh
cd $WORK/3_figures/F_scripts
......@@ -22,16 +22,16 @@ Rscript --vanilla S02.R
rm Rplots.pdf
```
## Details of S02.R
## Details of `S02.R`
In principal the S02.R script is a reduced versions of the F2.R script. Is an executable R script that depends on a variety of image manipulation and data managing packages.
In principal the `S02.R` script is a reduced versions of the `F2.R` script. Is an executable R script that depends on a variety of image manipulation and data managing packages.
In the following the differences to F2.R are highlighted. Obvious changes (different data input files, axis labels, y range) are omitted.
In the following the differences to `F2.R` are highlighted. Obvious changes (different data input files, axis labels, y range) are omitted.
Apart from these trivial changes, the genome wide summary of the statistic is omitted.
Therefore, the following lines of the original Script (F2.R) were removed from S02.R:
Therefore, the following lines of the original Script (`F2.R`) were removed from `S02.R`:
<div class="notthescript">
```{r oldScript1, eval=FALSE,}
......@@ -54,7 +54,7 @@ data2 <- read.csv('fst_outlier_windows.txt', sep='\t')
musks <- read.csv('fst_outlier_ID.txt', sep='\t')
```
This replaced the original section that computes the outlier windows within F2.R:
This replaced the original section that computes the outlier windows within `F2.R`:
<div class="notthescript">
```{r oldScript2, eval=FALSE,}
......@@ -84,7 +84,7 @@ musks <- data2 %>% group_by(musk) %>% summarise(MUSKmin=min(xmin),
```
</div>
The final plot, as produced by the S02.R script:
The final plot, as produced by the `S02.R` script:
```{r head, include=FALSE}
library(grid)
......@@ -170,7 +170,7 @@ p1 <- ggplot()+
geom_point(data=data,aes(x=GPOS,y=avgp_wald,col=COL),size=.01)+
# labels for the outlier windows
geom_text(data=musks,aes(x=muskX,y=9.5,label=musk))+
scale_y_continuous(name = yl,breaks=0:4*2.5,labels = c(0,'',5,'',10))+
scale_y_continuous(name = yl,limits=c(-.3,11),breaks=0:4*2.5,labels = c(0,'',5,'',10))+
scale_x_continuous(expand = c(0,0),breaks = (karyo$GSTART+karyo$GEND)/2,labels = 1:24,position = "top")+
scale_color_manual(name='comparison',values=clr)+
scale_fill_manual(values = c(NA,lgclr),guide=F)+
......
......@@ -14,7 +14,7 @@ knitr::opts_knit$set(root.dir = './F_scripts')
This is the accessory documentation of Supplementary Figure 04.
The Figure can be recreated by running the **R** script S04.R:
The Figure can be recreated by running the **R** script `S04.R`:
```sh
cd $WORK/3_figures/F_scripts
......@@ -23,7 +23,7 @@ Rscript --vanilla S04.R
rm Rplots.pdf
```
## Details of S04.R
## Details of `S04.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 packages. The main workhorse of the expression analysis is the R package `DESeq2`.
......
......@@ -13,7 +13,7 @@ knitr::opts_knit$set(root.dir = './F_scripts')
This is the accessory documentation of Supplementary Figure 05.
The Figure can be recreated by running the **R** script S05.R:
The Figure can be recreated by running the **R** script `S05.R`:
```sh
cd $WORK/3_figures/F_scripts
......@@ -22,11 +22,11 @@ Rscript --vanilla S05.R
rm Rplots.pdf
```
## Details of S05.R
## Details of `S05.R`
In principal the S05.R script is a reduced versions of the F2.R script.
In principal the `S05.R` script is a reduced versions of the `F2.R` script.
In contrast to F2.R, in this version only the global species comparisons are loaded. Additionally, the outlier threshold is lowered to the 99.90 *F~ST~* percentile (as compared to the 99.98 percentile).
In contrast to `F2.R`, in this version only the global species comparisons are loaded. Additionally, the outlier threshold is lowered to the 99.90 *F~ST~* percentile (as compared to the 99.98 percentile).
Is an executable R script that depends on a variety of image manipulation and data managing packages.
......
......@@ -13,7 +13,7 @@ knitr::opts_knit$set(root.dir = './F_scripts')
This is the accessory documentation of Supplementary Figure 06.
The Figure can be recreated by running the **R** script S06.R:
The Figure can be recreated by running the **R** script `S06.R`:
```sh
cd $WORK/3_figures/F_scripts
......@@ -22,9 +22,9 @@ Rscript --vanilla S06.R
rm Rplots.pdf
```
## Details of S06.R
## Details of `S06.R`
The S06.R script is basically a variant of the F3.R script.
The `S06.R` script is basically a variant of the `F3.R` script.
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 `F3.functions.R`,`F3.plot_fun.R` which themselves depend on `F3.getDXY.R`, `F3.getFSTs.R` and `F3.getGxP.R` (all located under `$WORK/0_data/0_scripts`).
......@@ -63,7 +63,7 @@ p8 <- create_K_plot(searchLG = "LG20",gfffile = '../../1-output/09_gff_from_IKMB
#....#
```
Here, for comparison, the original within F3.R:
Here, for comparison, the original within `F3.R`:
<div class="notthescript">
```{r oldScript1, eval=FALSE}
......
......@@ -13,7 +13,7 @@ knitr::opts_knit$set(root.dir = './F_scripts')
This is the accessory documentation of Supplementary Figure 07.
The Figure can be recreated by running the **R** script S07.R:
The Figure can be recreated by running the **R** script `S07.R`:
```sh
cd $WORK/3_figures/F_scripts
......@@ -22,17 +22,17 @@ Rscript --vanilla S07.R
rm Rplots.pdf
```
## Details of S07.R
## Details of `S07.R`
The S07.R script is basically a variant of the F4.R script.
The `S07.R` script is basically a variant of the `F4.R` script.
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 `S07.functions.R` (which is itself a variant of `F4.functions.R` , both located under `$WORK/0_data/0_scripts`).
The difference to the original (F4.R) is the extended number of genomic ranges considered, as well as the extend of the respective regions. Furthermore, the box plot sub figures are omitted in this version.
The difference to the original (`F4.R`) is the extended number of genomic ranges considered, as well as the extend of the respective regions. Furthermore, the box plot sub figures are omitted in this version.
Otherwise, the setup of S07.R is exactly equivalent to the original script with adjusted scaling and labeling definitions.
These adjustments are located within the S07.functions.R script.
Otherwise, the setup of `S07.R` is exactly equivalent to the original script with adjusted scaling and labeling definitions.
These adjustments are located within the `S07.functions.R` script.
Here as an example the expanded scaling vector:
......@@ -94,7 +94,7 @@ This replaces the more restricted original selection:
```
</div>
Analogous replacements continue throughout the S07.functions.R script.
Analogous replacements continue throughout the `S07.functions.R` script.
```{r head, include=FALSE}
library(tidyverse)
......@@ -171,6 +171,6 @@ S07
```
</center>
For detail of the individual steps required to produce this figure please refer to the documentation of the *original* version ([Figure 4](figure-4.html), F2.functions.R).
For detail of the individual steps required to produce this figure please refer to the documentation of the *original* version ([Figure 4](figure-4.html), `F2.functions.R`).
---
\ No newline at end of file
......@@ -13,7 +13,7 @@ knitr::opts_knit$set(root.dir = './F_scripts')
This is the accessory documentation of Supplementary Figure 08.
The Figure can be recreated by running the **R** script S08.R:
The Figure can be recreated by running the **R** script `S08.R`:
```sh
cd $WORK/3_figures/F_scripts
......@@ -22,7 +22,7 @@ Rscript --vanilla S08.R
rm Rplots.pdf
```
## Details of S08.R
## Details of `S08.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 packages.
......@@ -101,7 +101,7 @@ bp1 <- bp1 %>%
strech = bp-lag(bp,default = 0))
```
The lincage and ampping data are merged, the position by LG is transformed to genomic position and the lincage density (as cM/Mp) is calculated. Also, a parent ID column is added.
The linkage and mapping data are merged, the position by LG is transformed to genomic position and the linkage density (as cM/Mp) is calculated. Also, a parent ID column is added.
```{r mergeData1,results='hide',message=FALSE, warning=FALSE}
data1 <- merge(merge(bp1,cM1,by='Loci'),seqStart,by='LG') %>% arrange(LG,bin_bp) %>%
......@@ -135,7 +135,7 @@ data2 <- merge(merge(bp2,cM2,by='Loci'),seqStart,by='LG') %>% arrange(LG,bin_bp)
mutate(Parent="Parent 2")
```
The datasets of the two parents are combined.
The data sets of the two parents are combined.
```{r fullData,results='hide',message=FALSE, warning=FALSE}
dataMERGE <- rbind(data1,data2)
......@@ -144,8 +144,8 @@ dataMERGE$LG <- drop.levels(dataMERGE$LG)
### Plotting
Colors are set for the plot (backgroundcolor for the LGs, raw cM data, secondary y axsis & labels)
Also the ratio of primary Y axis and secondary Y axis as well as the Y axsis labels are set.
Colors are set for the plot (background color for the LGs, raw cM data, secondary y axis & labels)
Also the ratio of primary Y axis and secondary Y axis as well as the Y axis labels are set.
```{r prepPlot,results='hide',message=FALSE, warning=FALSE}
lgclr <- rgb(.9,.9,.9)
......
---
output: html_document
editor_options:
chunk_output_type: console
---
# Supplementary Figure 09
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_knit$set(root.dir = './F_scripts')
```
## Summary