Loading 0_data/0_scripts/F4.functions.R +15 −8 Original line number Diff line number Diff line Loading @@ -134,10 +134,10 @@ trplot <- function(sel){ scale_x_continuous(expand=c(0,0))+ scale_y_continuous(expand=c(0,0), trans = 'reverse')+ scale_fill_gradientn(name=expression(bar(italic(r)^2)),colours=clr, values=rescale(c(1,.5,.08,.03,.015,.01,0)), limits=c(0,1), guide = 'legend',breaks=c(0,.005,.01,.02,.03,.1,1))+ # scale_fill_gradientn(name=expression(bar(italic(r)^2)),colours=clr, # values=rescale(c(1,.5,.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(.9,.75), legend.direction = 'vertical') Loading @@ -151,14 +151,21 @@ trplot <- function(sel){ 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))+ #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) # cs <- scale_fill_viridis_c(name=expression(bar(r^2)),begin = 0,end = 0.55,direction = -1) cs <- scale_fill_viridis_c(name=expression(bar(r^2)), limits = c(0,0.55),values = c(0,.08,1), option = 'B',direction = -1) # cs <- scale_fill_gradientn(name=expression(bar(r^2)),colours=clr, # values=rescale(c(1,.08,.03,.015,.01,0)), # limits=c(0,0.55)) return(p1+cs) } run_one_sample_test <- function(pop,n,data){ Loading 0_data/0_scripts/S09.functions.R +4 −7 Original line number Diff line number Diff line Loading @@ -188,9 +188,6 @@ trplot <- function(sel){ scale_x_continuous(expand=c(0,0))+ scale_y_continuous(expand=c(0,0), trans = 'reverse')+ scale_fill_gradientn(name=expression(bar(italic(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))+ scale_color_manual(values=viridis_pal(option='A')(6))+theme_void()+ theme(legend.position = c(.7,.75),legend.direction = 'vertical') } else { Loading @@ -203,11 +200,11 @@ trplot <- function(sel){ 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))+ scale_color_manual(values=viridis_pal(option='A')(6))+theme_void()+ theme(legend.position = c(.7,.75),legend.direction = 'vertical') } return(p1) cs <- scale_fill_viridis_c(name=expression(bar(r^2)), limits = c(0,0.55),values = c(0,.08,1), option = 'B',direction = -1) return(p1+cs) } No newline at end of file 0_data/0_scripts/S16.functions.R +1 −1 Original line number Diff line number Diff line Loading @@ -138,7 +138,7 @@ trplot <- function(sel){ scale_x_continuous(expand=c(0,0))+ scale_y_continuous(expand=c(0,0), trans = 'reverse')+ scale_fill_viridis_c(name=expression(bar(italic(r)^2)))+ scico::scale_fill_scico(name=expression(bar(italic(r)^2)),palette = 'lapaz',direction = -1)+ theme_void()+ theme(legend.position = c(.9,.75), legend.direction = 'vertical') Loading 2_reSeq-scripts/2-2_popGen/2.2.8.1.linkage_decay.sh 0 → 100644 +30 −0 Original line number Diff line number Diff line #PBS -l elapstim_req=0:20:00 #PBS -l memsz_job=10gb #PBS -b 1 #PBS -l cpunum_job=1 #PBS -N linkage_decay #PBS -q clexpress #PBS -o 2.2.8.1.linkage_decay.stdout #PBS -e 2.2.8.1.linkage_decay.stderr cd $WORK/2_output/08_popGen/07_LD mkdir -p decay cd decay RANDOM=27678 #set seed for k in {1..20};do LG=$(echo $(( (RANDOM % 24) + 1 )) | awk '$1<10{print "0"$1} $1>=10{print$1}') RN1=$(( ( RANDOM % 13684534 ) + 1)) RN2=$(($RN2+15000)) echo $RN2 vcftools \ --gzvcf $WORK/2_output/07_phased_variants/6_phased_mac2.vcf.gz \ --chr LG$LG \ --from-bp $RN1 \ --to-bp $RN2 \ --hap-r2 \ --out dist.$k.$RN1 done gzip ./*.hap.ld 3_figures/F_scripts/F4.R +2 −2 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ honGrob <- gTree(children=gList(pictureGrob(readPicture("../../0_data/0_img/hond panGrob <- gTree(children=gList(pictureGrob(readPicture("../../0_data/0_img/panama-cairo.svg")))) globGrob <- gTree(children=gList(pictureGrob(readPicture("../../0_data/0_img/caribbean-cairo.svg")))) leg <- get_legend(plts[[1]]+theme(legend.direction = 'horizontal')+ guides(fill = guide_legend(nrow=1))) leg <- get_legend(plts[[1]]+theme(legend.direction = 'horizontal',legend.key.width = unit(60,'pt'))) sY <- .035; sX <- -.03; F4 <- ggdraw(pGr1)+ Loading @@ -54,7 +54,7 @@ F4 <- ggdraw(pGr1)+ draw_plot(boxGenes+theme(legend.position='none'),.65,.54,.45,.21)+ draw_plot(pGRAD,.307,-.018,.16,.53)+ draw_grob(pGr2,0,0,1,1)+ draw_grob(leg,-.33,.22,1,1)+ draw_grob(leg,-.25,.22,1,1)+ draw_grob(pGr3,0,0,1,1)+ draw_grob(pGr4,0,0,1,1)+ draw_grob(pGr5,0,0,1,1)+ Loading Loading
0_data/0_scripts/F4.functions.R +15 −8 Original line number Diff line number Diff line Loading @@ -134,10 +134,10 @@ trplot <- function(sel){ scale_x_continuous(expand=c(0,0))+ scale_y_continuous(expand=c(0,0), trans = 'reverse')+ scale_fill_gradientn(name=expression(bar(italic(r)^2)),colours=clr, values=rescale(c(1,.5,.08,.03,.015,.01,0)), limits=c(0,1), guide = 'legend',breaks=c(0,.005,.01,.02,.03,.1,1))+ # scale_fill_gradientn(name=expression(bar(italic(r)^2)),colours=clr, # values=rescale(c(1,.5,.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(.9,.75), legend.direction = 'vertical') Loading @@ -151,14 +151,21 @@ trplot <- function(sel){ 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))+ #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) # cs <- scale_fill_viridis_c(name=expression(bar(r^2)),begin = 0,end = 0.55,direction = -1) cs <- scale_fill_viridis_c(name=expression(bar(r^2)), limits = c(0,0.55),values = c(0,.08,1), option = 'B',direction = -1) # cs <- scale_fill_gradientn(name=expression(bar(r^2)),colours=clr, # values=rescale(c(1,.08,.03,.015,.01,0)), # limits=c(0,0.55)) return(p1+cs) } run_one_sample_test <- function(pop,n,data){ Loading
0_data/0_scripts/S09.functions.R +4 −7 Original line number Diff line number Diff line Loading @@ -188,9 +188,6 @@ trplot <- function(sel){ scale_x_continuous(expand=c(0,0))+ scale_y_continuous(expand=c(0,0), trans = 'reverse')+ scale_fill_gradientn(name=expression(bar(italic(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))+ scale_color_manual(values=viridis_pal(option='A')(6))+theme_void()+ theme(legend.position = c(.7,.75),legend.direction = 'vertical') } else { Loading @@ -203,11 +200,11 @@ trplot <- function(sel){ 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))+ scale_color_manual(values=viridis_pal(option='A')(6))+theme_void()+ theme(legend.position = c(.7,.75),legend.direction = 'vertical') } return(p1) cs <- scale_fill_viridis_c(name=expression(bar(r^2)), limits = c(0,0.55),values = c(0,.08,1), option = 'B',direction = -1) return(p1+cs) } No newline at end of file
0_data/0_scripts/S16.functions.R +1 −1 Original line number Diff line number Diff line Loading @@ -138,7 +138,7 @@ trplot <- function(sel){ scale_x_continuous(expand=c(0,0))+ scale_y_continuous(expand=c(0,0), trans = 'reverse')+ scale_fill_viridis_c(name=expression(bar(italic(r)^2)))+ scico::scale_fill_scico(name=expression(bar(italic(r)^2)),palette = 'lapaz',direction = -1)+ theme_void()+ theme(legend.position = c(.9,.75), legend.direction = 'vertical') Loading
2_reSeq-scripts/2-2_popGen/2.2.8.1.linkage_decay.sh 0 → 100644 +30 −0 Original line number Diff line number Diff line #PBS -l elapstim_req=0:20:00 #PBS -l memsz_job=10gb #PBS -b 1 #PBS -l cpunum_job=1 #PBS -N linkage_decay #PBS -q clexpress #PBS -o 2.2.8.1.linkage_decay.stdout #PBS -e 2.2.8.1.linkage_decay.stderr cd $WORK/2_output/08_popGen/07_LD mkdir -p decay cd decay RANDOM=27678 #set seed for k in {1..20};do LG=$(echo $(( (RANDOM % 24) + 1 )) | awk '$1<10{print "0"$1} $1>=10{print$1}') RN1=$(( ( RANDOM % 13684534 ) + 1)) RN2=$(($RN2+15000)) echo $RN2 vcftools \ --gzvcf $WORK/2_output/07_phased_variants/6_phased_mac2.vcf.gz \ --chr LG$LG \ --from-bp $RN1 \ --to-bp $RN2 \ --hap-r2 \ --out dist.$k.$RN1 done gzip ./*.hap.ld
3_figures/F_scripts/F4.R +2 −2 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ honGrob <- gTree(children=gList(pictureGrob(readPicture("../../0_data/0_img/hond panGrob <- gTree(children=gList(pictureGrob(readPicture("../../0_data/0_img/panama-cairo.svg")))) globGrob <- gTree(children=gList(pictureGrob(readPicture("../../0_data/0_img/caribbean-cairo.svg")))) leg <- get_legend(plts[[1]]+theme(legend.direction = 'horizontal')+ guides(fill = guide_legend(nrow=1))) leg <- get_legend(plts[[1]]+theme(legend.direction = 'horizontal',legend.key.width = unit(60,'pt'))) sY <- .035; sX <- -.03; F4 <- ggdraw(pGr1)+ Loading @@ -54,7 +54,7 @@ F4 <- ggdraw(pGr1)+ draw_plot(boxGenes+theme(legend.position='none'),.65,.54,.45,.21)+ draw_plot(pGRAD,.307,-.018,.16,.53)+ draw_grob(pGr2,0,0,1,1)+ draw_grob(leg,-.33,.22,1,1)+ draw_grob(leg,-.25,.22,1,1)+ draw_grob(pGr3,0,0,1,1)+ draw_grob(pGr4,0,0,1,1)+ draw_grob(pGr5,0,0,1,1)+ Loading