Skip to content

Commit

Permalink
filter out 0s
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimens committed Jul 11, 2024
1 parent 451ba31 commit 55bdbdf
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/harpy/reports/HapCut2.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"
```

```{r echo= FALSE, message = FALSE, warning = FALSE}
#file <- "/home/pdimens/Documents/harpy/Phase/reports/blocks.summary.gz"
#file <- "~/blocks.summary.gz"
file <- snakemake@input[[1]]
df <- read.table(
file, header = T,
Expand All @@ -56,7 +56,7 @@ if(nrow(df) < 1){
knitr::knit_exit()
}
df$pos_end <- df$pos_start + df$block_length
df <- df[, c(1,2,3,4,6,5)]
df <- df[df$block_length > 0, c(1,2,3,4,6,5)]
levels(df$sample) <- basename(levels(df$sample))
```

Expand Down Expand Up @@ -89,7 +89,8 @@ some of the information in the `.blocks` files that were collated in this report
This page shows general and per-contig information. You may click the plots to
expand them in your browser. Clicking them again will exit from the zoomed pop-up
window. The `Per-Sample Stats` tab in the navigation bar above will show you
statistics relating to haplotypes on the per-sample level.
statistics relating to haplotypes on the per-sample level. Haplotype blocks with a size
of `0` were removed from the data.

## Haplotyping details {data-height=100}
```{r echo= FALSE, message = FALSE, warning = FALSE}
Expand Down Expand Up @@ -187,9 +188,9 @@ DT::datatable(
## contig ridgeplot
### per contig plot {.no-title}
```{r contig_ridgeplot, warning=FALSE, message=FALSE, echo= FALSE, fig.height=ridgeheight, fig.width=8}
ggplot(df, aes(x = block_length, y = contig) + #, fill = stat(x))) +
geom_density_ridges() + #_gradient() +
#scale_fill_viridis_c(option = "C", trans = "log10") +
ggplot(df, aes(x = block_length, y = contig, fill = stat(x))) +
geom_density_ridges_gradient() +
scale_fill_viridis_c(option = "C", trans = "log10") +
theme_minimal() +
theme(legend.position = "none") +
scale_x_log10(
Expand Down Expand Up @@ -240,9 +241,9 @@ DT::datatable(
## ridgeplot
### the ridgeplot {.no-title}
```{r sample_ridgeplot, warning=FALSE, message=FALSE, echo= FALSE, fig.height=ridgeheight.samples, fig.width=8}
ggplot(df, aes(x = block_length, y = sample) + #, fill = stat(x))) +
geom_density_ridges() + #_gradient(rel_min_height = 0.01) +
#scale_fill_viridis_c(option = "G", trans = "log10") +
ggplot(df, aes(x = block_length, y = sample, fill = stat(x))) +
geom_density_ridges_gradient(scale = 0.1) +
scale_fill_viridis_c(option = "G", trans = "log10") +
theme_minimal() +
theme(legend.position = "none") +
scale_x_log10(
Expand Down

0 comments on commit 55bdbdf

Please sign in to comment.