Commit 727d7332 authored by mariefbourdon's avatar mariefbourdon
Browse files

220627 figures

parent 3549f1de
No preview for this file type
......@@ -289,21 +289,22 @@ colnames(peak5_tab) <- c("marker","chr","pos","allele\n1","allele\n2",
narrow_grid <- ggdraw() +
draw_plot(pheno_before_annot_data2,.5,.8,.5,.16) +
draw_plot(pheno_before_annot_data3,0,.64,.5,.16) +
draw_plot(peak1,0,.48,.3,.16) +
draw_plot(tableGrob(peak1_tab,rows=NULL),.3,.48,.7,.16) +
draw_plot(peak3,0,.32,.3,.16) +
draw_plot(tableGrob(peak3_tab,rows=NULL),.3,.32,.7,.16) +
draw_plot(peak5,0,0,.3,.16) +
draw_plot(tableGrob(peak5_tab,rows=NULL),.3,0,.7,.16) +
draw_plot(pheno_before_annot_data2,0,.75,.5,.25) +
draw_plot(pheno_before_annot_data3,.5,.75,.5,.25) +
draw_plot(peak1,0,.5,.3,.25) +
draw_plot(tableGrob(peak1_tab,rows=NULL),.3,.5,.7,.25) +
draw_plot(peak3,0,.25,.3,.25) +
draw_plot(tableGrob(peak3_tab,rows=NULL),.3,.25,.7,.25) +
draw_plot(peak5,0,0,.3,.25) +
draw_plot(tableGrob(peak5_tab,rows=NULL),.3,0,.7,.25) +
draw_plot_label(c("A","B","C","D","E","F","G","H"),
c(0,.5,0,.5,0,.35,0,.35),c(.96,.96,.8,.8,.64,.615,.48,.45))
c(0,.5,0,.3,0,.3,.5,.7),c(1,1,.75,.75,.5,.5,.25,.25))
narrow_grid
ggsave(narrow_grid,file="fig/figS3.pdf",width=10,height=17)
ggsave(narrow_grid,file="figures/figS3.pdf",width=10,height=17)
ggsave(narrow_grid,file="figures/figS3.png",width=10,height=17)
rm(peak1,peak1_tab,peak2,peak2_tab,peak3,peak3_tab,peak4_tab,peak5,peak5_tab,peak6,peak6_tab,peak7,peak7_tab,peak11,peak11_tab)
rm(peak1,peak1_tab,peak2,peak2_tab,peak3,peak3_tab,peak5,peak5_tab)
```
......
No preview for this file type
......@@ -426,7 +426,7 @@ peak1 <- qtl_plot(pheno_before,lod=data.frame(group = c("alpha=0.05", "alpha=0.1
strip.text.x = element_blank()) +
xlab("Position (cM)") +
xlim(c(15,35)) +
ggtitle("Peak 1")
ggtitle("Peak 1: 1 marker")
peak1
```
......
No preview for this file type
No preview for this file type
......@@ -363,7 +363,8 @@ pheno_before_annot_data2 <- pheno_before_plot + geom_text(
y = lod,
label = label,
color="blue")
)
) +
ggtitle("Data 2")
pheno_before_annot_data2
rm(ann_dat_text)
......@@ -388,7 +389,7 @@ peak3 <- qtl_plot(pheno_before,lod=data.frame(group = c("alpha=0.05", "alpha=0.1
strip.text.x = element_blank()) +
xlab("Position (cM)") +
xlim(c(11,31)) +
ggtitle("Peak 3")
ggtitle("Peak 3: 1 pseudomarker")
peak3
```
......@@ -448,6 +449,46 @@ pheno_data2 <- phenos %>% ggplot(aes(x=Pheno)) +
pheno_data2
```
## Missing genotypes
```{r}
na_plot <- tab2 %>% mutate(prop_NA=n_NA/176) %>% ggplot(aes(x=prop_NA)) +
geom_histogram() +
scale_y_log10() +
theme_classic() +
labs(title="Proportion of missing genotyped",
x="Proportion of NA",y="Number of markers") +
theme(
aspect.ratio=0.8,
plot.title = element_text(hjust = 0.4,face="bold",size=14))
na_plot
```
## Genotype proportions
```{r}
prop_plot <- tab2 %>% filter(n_NA<88) %>% filter(!chr %in% c("M","X","Y")) %>%
ggplot(aes(x=n_HM1/(n_HM1+n_HM2+n_HT),y=n_HM2/(n_HM1+n_HM2+n_HT),color=as.factor(exclude_prop))) +
geom_point() +
scale_color_manual(values=c("#66bd63","#b2182b"),labels = c("Retained", "Excluded")) +
geom_hline(yintercept = 0.1,linetype="dashed",size=.3) +
geom_vline(xintercept = 0.1,linetype="dashed",size=.3) +
geom_abline(intercept = 0.9, slope=-1,linetype="dashed",size=.3) +
labs(title="Exclusion of markers with mark_prop()",
x="Proportion of homozygous individuals AA",
y="Proportion of homozygous individuals BB",
color="Exclusion") +
theme_classic() +
theme(aspect.ratio=0.8,
legend.position=c(0.8,0.8),
legend.title = element_blank()) +
theme(plot.title = element_text(hjust = 0.4,face="bold",size=14))
prop_plot
```
```{r save_narrow}
tab2_data2 <- tab2
save(pheno_before_annot_data2,pheno_data2,peak3,peak3_tab,tab2_data2,
......
No preview for this file type
No preview for this file type
......@@ -373,7 +373,8 @@ pheno_before_annot_data3 <- pheno_before_plot + geom_text(
y = lod,
label = label,
color="blue")
)
) +
ggtitle("Data 3")
pheno_before_annot_data3
```
......@@ -454,7 +455,7 @@ peak5 <- qtl_plot(pheno_before,lod=data.frame(group = c("alpha=0.05", "alpha=0.1
strip.text.x = element_blank()) +
xlab("Position (cM)") +
xlim(c(22,42)) +
ggtitle("")
ggtitle("Peak 5: 1 marker and 1 pseudomarker")
peak5
```
......@@ -509,6 +510,44 @@ pheno_data3 <- phenos %>% ggplot(aes(x=Pheno)) +
pheno_data3
```
## Missing genotypes
```{r}
na_plot <- tab2 %>% mutate(prop_NA=n_NA/176) %>% ggplot(aes(x=prop_NA)) +
geom_histogram() +
scale_y_log10() +
theme_classic() +
labs(title="Proportion of missing genotyped",
x="Proportion of NA",y="Number of markers") +
theme(
aspect.ratio=0.8,
plot.title = element_text(hjust = 0.4,face="bold",size=14))
na_plot
```
## Genotype proportions
```{r}
prop_plot <- tab2 %>% filter(n_NA<88) %>% filter(!chr %in% c("M","X","Y")) %>%
ggplot(aes(x=n_HM1/(n_HM1+n_HM2+n_HT),y=n_HM2/(n_HM1+n_HM2+n_HT),color=as.factor(exclude_prop))) +
geom_point() +
scale_color_manual(values=c("#66bd63","#b2182b"),labels = c("Retained", "Excluded")) +
geom_hline(yintercept = 0.1,linetype="dashed",size=.3) +
geom_vline(xintercept = 0.1,linetype="dashed",size=.3) +
geom_abline(intercept = 0.9, slope=-1,linetype="dashed",size=.3) +
labs(title="Exclusion of markers with mark_prop()",
x="Proportion of homozygous individuals AA",
y="Proportion of homozygous individuals BB",
color="Exclusion") +
theme_classic() +
theme(aspect.ratio=0.8,
legend.position=c(0.8,0.8),
legend.title = element_blank()) +
theme(plot.title = element_text(hjust = 0.4,face="bold",size=14))
prop_plot
```
```{r}
tab2_data3 <- tab2
......
No preview for this file type
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment