-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
4,194 additions
and
2,806 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
```{r boxplots1, results='asis', message=FALSE, warning=FALSE, echo=FALSE, fig.height = 8, fig.width = 12, dpi=100, fig.align="center"} | ||
if(exists("samples") & exists("svars")){ | ||
cat("## Outlier QC statistic boxplots \n") | ||
cat("### Plot description \n") | ||
cat("If the user has included a file of sample-level summary statistics with the --samplefile` option and has specified variables to analyze with the `--svars` option, this plot will show the distributions of those variables for the outliers compared to the inlier samples. \n \n") | ||
cat("### Interpreting this plot \n") | ||
cat("These boxplots tell us whether the outliers detected by *Doomsayer* show differences in other sample-level summary statistics. \n") | ||
sigs2 <- merge(sig_contribs, samples, by="ID") %>% | ||
mutate(outlier=ifelse(ID %in% outlier_IDs, T, F)) | ||
sigs2 <- merge(sigs2, cluster_mems, by="ID", all.x=T) | ||
sigs2[is.na(sigs2$group),]$group <- "keep" | ||
sumdat <- sigs2 %>% | ||
# filter(sig!=2) %>% | ||
group_by(group) %>% | ||
dplyr::select(c("ID","group",svars)) %>% | ||
# filter(coverage < 15) %>% | ||
gather(var, val, svars[1]:svars[length(svars)]) %>% | ||
group_by(group, var) | ||
# figure showing that simple cutoffs for quality indicators would not easily | ||
# differentiate inliers vs. Doomsayer's flagged outliers | ||
sumdat1 <- sumdat %>% | ||
ungroup() %>% | ||
mutate(group = gsub(" .*", "", group)) | ||
p1 <- ggplot(sumdat1, aes(x=group, y=val, group=group, fill=group))+ | ||
geom_boxplot()+ | ||
scale_fill_manual(values=c("gray30", "red"))+ | ||
facet_wrap(~var, scales="free")+ | ||
theme_bw()+ | ||
theme(axis.text.x=element_text(angle=45, hjust=1), | ||
axis.title.x=element_blank(), | ||
legend.position="none") | ||
sggplotly(p1) | ||
} else { | ||
sigs2 <- merge(sig_contribs, cluster_mems, by="ID", all.x=T) %>% | ||
mutate(outlier=ifelse(ID %in% outlier_IDs, T, F)) | ||
sigs2[is.na(sigs2$group),]$group <- "keep" | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
```{r boxplots2, results='asis', message=FALSE, warning=FALSE, echo=FALSE, fig.height = 8, fig.width = 12, dpi=100, fig.align="center"} | ||
if(exists("samples") & exists("svars")){ | ||
cat("### Plot description \n") | ||
cat("The plot below shows the distributions of user-specified QC variables for the inlier samples compared to the outlier samples grouped according to the cluster assignment shown in the [heatmap](#error_profile_heatmap) \n \n") | ||
cat("### Interpreting this plot \n") | ||
cat("These boxplots tell us whether **specific groups** of outliers detected by *Doomsayer* show differences in other sample-level summary statistics. \n") | ||
# figure showing that simple cutoffs for quality indicators would not easily | ||
# differentiate inliers vs. Doomsayer's flagged outliers | ||
p2 <- ggplot(sumdat, aes(x=group, y=val, group=group, fill=group))+ | ||
geom_boxplot()+ | ||
scale_fill_manual(values=c("gray30", group_col_vals))+ | ||
facet_wrap(~var, scales="free")+ | ||
theme_bw()+ | ||
theme(axis.text.x=element_text(angle=45, hjust=1), | ||
axis.title.x=element_blank(), | ||
legend.position="none") | ||
sggplotly(p2) | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.