Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom filenames for DT csv exports #115

Merged
merged 6 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .deprecated/align-minimap.smk
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ rule genome_setup:
container:
None
message:
"copying {input} to Genome/"
"Copying {input} to Genome/"
shell:
"""
if (file {input} | grep -q compressed ) ;then
Expand Down
File renamed without changes.
6 changes: 5 additions & 1 deletion src/harpy/reports/align_bxstats.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ DT::datatable(
aggregate_df,
rownames = F,
extensions = 'Buttons',
options = list(dom = 'Brtip', buttons = c('csv'), scrollX = TRUE),
options = list(
dom = 'Brtip',
scrollX = TRUE,
buttons = list(list(extend = "csv",filename = "per_sample_barcode_alignment"))
),
caption = 'Per-Sample Alignment Information Pertaining to Barcodes',
fillContainer = T,
colnames = c("sample", "alignments", "unique molecules", "singletons", "multiplex", "unique barcodes", "molecule:bx ratio", "valid bx alignments", "invalid bx alignments", "% valid bx", "avg reads/molecule", "SEM reads/molecule", "avg molecule coverage %","SEM molecule coverage %", "N50", "N75","N90")
Expand Down
27 changes: 23 additions & 4 deletions src/harpy/reports/align_stats.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,14 @@ valueBox(scales::comma(totuniqBX), caption = "Total unique molecules", color = "
valids %>%
group_by(contig) %>%
summarize(n50 = NX(length_inferred, 50), n75 = NX(length_inferred, 75), n90 = NX(length_inferred, 90)) %>%
DT::datatable(rownames = F, options = list(dom = 'Brtip', buttons = c('csv')), fillContainer = T)
DT::datatable(
rownames = F,
options = list(
dom = 'Brtip',
buttons = list(list(extend = "csv",filename = paste0(samplename ,"_molecule_NX")))
),
fillContainer = T
)
```

## Reads per molecule dec
Expand Down Expand Up @@ -446,7 +453,11 @@ DT::datatable(
contig_avg,
rownames = F,
extensions = 'Buttons',
options = list(dom = 'Brtip', buttons = c('csv'), scrollX = TRUE),
options = list(
dom = 'Brtip',
scrollX = TRUE,
buttons = list(list(extend = "csv",filename = paste0(samplename ,"_align_depth_avg")))
),
colnames = c('Contig', 'Average Depth', 'Standard Deviation'),
autoHideNavigation = T,
fillContainer = T,
Expand All @@ -460,7 +471,11 @@ DT::datatable(
contig_avg_filt,
rownames = F,
extensions = 'Buttons',
options = list(dom = 'Brtip', buttons = c('csv'), scrollX = TRUE),
options = list(
dom = 'Brtip',
scrollX = TRUE,
buttons = list(list(extend = "csv",filename = paste0(samplename ,"_align_depth_filt_avg")))
),
colnames = c('Contig', 'Average Depth', 'Standard Deviation'),
autoHideNavigation = T,
fillContainer = T,
Expand All @@ -474,7 +489,11 @@ DT::datatable(
outliers,
rownames = F,
extensions = 'Buttons',
options = list(dom = 'Brtip', buttons = c('csv'), scrollX = TRUE),
options = list(
dom = 'Brtip',
scrollX = TRUE,
buttons = list(list(extend = "csv",filename = paste0(samplename ,"_align_depth_outlier_avg")))
),
colnames = c('Contig', 'Position', 'Depth'),
autoHideNavigation = T,
fillContainer = T
Expand Down
15 changes: 13 additions & 2 deletions src/harpy/reports/bcftools_stats.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ if(sum(.dpL) == 0){
rownames = F,
filter = "top",
extensions = 'Buttons',
options = list(dom = 'Brtip', buttons = c('csv')),
options = list(dom = 'Brtip', buttons = list(list(extend = "csv",filename = "align_depth_bins"))),
colnames = c("Depth Bin", "Genotypes", "% Genotypes", "Sites", "% Sites")
)
}
Expand Down Expand Up @@ -317,7 +317,18 @@ figheight <- 1 + (0.2 * nrow(psc))
## Individual Statistics {.tabset data-height=plotheight}
### Individual Data
```{r Individual table, echo=FALSE, message=FALSE, warning=FALSE}
DT::datatable(psc, rownames = F, fillContainer = T, filter = "top", extensions = 'Buttons', options = list(dom = 'Brtip', buttons = c('csv'), scrollX = TRUE, paging = F))
DT::datatable(
psc, rownames = F,
fillContainer = T,
filter = "top",
extensions = 'Buttons',
options = list(
dom = 'Brtip',
buttons = list(list(extend = "csv",filename = "snp_indiv_stats")),
scrollX = TRUE,
paging = F
)
)
```

### Individual Statistics
Expand Down
14 changes: 11 additions & 3 deletions src/harpy/reports/hapcut.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,14 @@ DT::datatable(
percontig,
rownames = F,
extensions = 'Buttons',
options = list(dom = 'Brtip', buttons = c('csv'), scrollX = TRUE),
options = list(
dom = 'Brtip',
buttons = list(list(extend = "csv",filename = "phasing_per_contig")),
scrollX = TRUE
),
colnames = c("Contig", "Total Haplotypes", "Mean SNPs", "Median SNPs", "Mean Haplotype Length", "Median Haplotype Length", "Largest Haplotype"),
fillContainer = T
)
)
```

### per contig plot {.no-title}
Expand Down Expand Up @@ -247,7 +251,11 @@ DT::datatable(
persample,
rownames = F,
extensions = 'Buttons',
options = list(dom = 'Brtip', buttons = c('csv'), scrollX = TRUE),
options = list(
dom = 'Brtip',
buttons = list(list(extend = "csv",filename = "phasing_per_sample")),
scrollX = TRUE
),
colnames = c("Sample", "Haplotypes", "Mean SNPs", "Median SNPs", "Mean Haplotype Length", "Median Haplotype Length", "Largest Haplotype"),
fillContainer = T
)
Expand Down
13 changes: 10 additions & 3 deletions src/harpy/reports/leviathan.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ using<-function(...) {
using("flexdashboard","dplyr","ggplot2","DT","BioCircos")
```

# General Stats
## Intro
### introtext {.no-title}
```{r}
Expand Down Expand Up @@ -127,7 +126,11 @@ DT::datatable(
rownames = F,
filter = "top",
extensions = 'Buttons',
options = list(dom = 'Brtip', buttons = c('csv'), scrollX = TRUE),
options = list(
dom = 'Brtip',
buttons = list(list(extend = "csv",filename = paste0(samplename , "_sv_leviathan`"))),
scrollX = TRUE
),
autoHideNavigation = T,
fillContainer = T
)
Expand All @@ -148,7 +151,11 @@ DT::datatable(
rownames = F,
filter = "top",
extensions = 'Buttons',
options = list(dom = 'Brtip', buttons = c('csv'), scrollX = TRUE),
options = list(
dom = 'Brtip',
buttons = list(list(extend = "csv",filename = paste0(samplename ,"_sv_leviathan_per_contig"))),
scrollX = TRUE
),
autoHideNavigation = T,
fillContainer = T
)
Expand Down
18 changes: 15 additions & 3 deletions src/harpy/reports/leviathan_pop.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,11 @@ DT::datatable(
rownames = F,
filter = "top",
extensions = 'Buttons',
options = list(dom = 'Brtip', buttons = c('csv'), scrollX = TRUE),
options = list(
dom = 'Brtip',
buttons = list(list(extend = "csv",filename = "leviathan_sv")),
scrollX = TRUE
),
fillContainer = T
)
```
Expand All @@ -158,7 +162,11 @@ DT::datatable(
rownames = F,
filter = "top",
extensions = 'Buttons',
options = list(dom = 'Brtip', buttons = c('csv'), scrollX = TRUE),
options = list(
dom = 'Brtip',
buttons = list(list(extend = "csv",filename = "leviathan_sv_count_pop")),
scrollX = TRUE
),
fillContainer = T
)
```
Expand All @@ -177,7 +185,11 @@ DT::datatable(
rownames = F,
filter = "top",
extensions = 'Buttons',
options = list(dom = 'Brtip', buttons = c('csv'), scrollX = TRUE),
options = list(
dom = 'Brtip',
buttons = list(list(extend = "csv",filename = "leviathan_sv_bp_pop")),
scrollX = TRUE
),
fillContainer = T
)
```
Expand Down
28 changes: 20 additions & 8 deletions src/harpy/reports/naibr.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ fai <- snakemake@input[["fai"]]
samplename <- gsub(".bedpe", "", basename(infile))
```

# General Stats
## file top
### file header {.no-title}
<h1> NAIBR Variant Calling: `r samplename` </h1>
Expand Down Expand Up @@ -145,8 +144,11 @@ DT::datatable(
grpstats %>% pivot_wider(id_cols = 1, names_from = SV, values_from = count),
rownames = F,
extensions = 'Buttons',
options = list(dom = 'Brtip', buttons = c('csv'), scrollX = TRUE),
#colnames = c('Contig', 'Variant Type', 'Count', 'Total Base Pairs'),
options = list(
dom = 'Brtip',
buttons = list(list(extend = "csv",filename = paste0(samplename , "_sv_naibr_count"))),
scrollX = TRUE
),
autoHideNavigation = T,
fillContainer = T
)
Expand All @@ -157,9 +159,11 @@ DT::datatable(
grpstats %>% pivot_wider(id_cols = 1, names_from = SV, values_from = total_bp),
rownames = F,
extensions = 'Buttons',
options = list(dom = 'Brtip', buttons = c('csv'), scrollX = TRUE),
#colnames = c('deletion', 'duplication', 'inversion'),
autoHideNavigation = T,
options = list(
dom = 'Brtip',
buttons = list(list(extend = "csv",filename = paste0(samplename , "_sv_naibr_count_bp"))),
scrollX = TRUE
), autoHideNavigation = T,
fillContainer = T,
)
```
Expand Down Expand Up @@ -210,7 +214,11 @@ DT::datatable(
rownames = F,
filter = "top",
extensions = 'Buttons',
options = list(dom = 'Brtip', buttons = c('csv'), scrollX = TRUE),
options = list(
dom = 'Brtip',
buttons = list(list(extend = "csv",filename = paste0(samplename ,"_sv_naibr"))),
scrollX = TRUE
),
autoHideNavigation = T,
fillContainer = T
)
Expand All @@ -222,7 +230,11 @@ DT::datatable(
rownames = F,
filter = "top",
extensions = 'Buttons',
options = list(dom = 'Brtip', buttons = c('csv'), scrollX = TRUE),
options = list(
dom = 'Brtip',
buttons = list(list(extend = "csv",filename = paste0(samplename ,"_sv_naibr_chimeric"))),
scrollX = TRUE
),
autoHideNavigation = T,
fillContainer = T
)
Expand Down
24 changes: 20 additions & 4 deletions src/harpy/reports/naibr_pop.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,11 @@ DT::datatable(
rownames = F,
filter = "top",
extensions = 'Buttons',
options = list(dom = 'Brtip', buttons = c('csv'), scrollX = TRUE),
options = list(
dom = 'Brtip',
buttons = list(list(extend = "csv",filename = "naibr_sv_count_pop")),
scrollX = TRUE
),
fillContainer = T
)
```
Expand All @@ -189,7 +193,11 @@ DT::datatable(
rownames = F,
filter = "top",
extensions = 'Buttons',
options = list(dom = 'Brtip', buttons = c('csv'), scrollX = TRUE),
options = list(
dom = 'Brtip',
buttons = list(list(extend = "csv",filename = "naibr_sv_count_bp")),
scrollX = TRUE
),
fillContainer = T
)
```
Expand Down Expand Up @@ -239,7 +247,11 @@ DT::datatable(
rownames = F,
filter = "top",
extensions = 'Buttons',
options = list(dom = 'Brtip', buttons = 'csv', scrollX = TRUE),
options = list(
dom = 'Brtip',
buttons = list(list(extend = "csv",filename = "naibr_sv")),
scrollX = TRUE
),
fillContainer = T
)
```
Expand All @@ -250,7 +262,11 @@ DT::datatable(
rownames = F,
filter = "top",
extensions = 'Buttons',
options = list(dom = 'Brtip', buttons = c('csv'), scrollX = TRUE)
options = list(
dom = 'Brtip',
buttons = list(list(extend = "csv",filename = "naibr_sv_chimeric")),
scrollX = TRUE
)
)
```

Expand Down
6 changes: 5 additions & 1 deletion src/harpy/reports/preflight_bam.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,11 @@ DT::datatable(
rownames = F,
filter = "top",
extensions = 'Buttons',
options = list(dom = 'Brtip', buttons = c('csv'), scrollX = T),
options = list(
dom = 'Brtip',
buttons = list(list(extend = "csv",filename = "bam_checks")),
scrollX = T
),
fillContainer = T
)
```
Expand Down
6 changes: 5 additions & 1 deletion src/harpy/reports/preflight_fastq.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ DT::datatable(
rownames = F,
filter = "top",
extensions = 'Buttons',
options = list(dom = 'Brtip', buttons = c('csv'), scrollX = T),
options = list(
dom = 'Brtip',
buttons = list(list(extend = "csv",filename = "fastq_checks")),
scrollX = T
),
fillContainer = T
)
```
Expand Down
6 changes: 5 additions & 1 deletion src/harpy/reports/stitch_collate.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,11 @@ DT::datatable(
rownames = F,
filter = "top",
extensions = 'Buttons',
options = list(dom = 'Brtip', buttons = c('csv'), scrollX = TRUE),
options = list(
dom = 'Brtip',
buttons = list(list(extend = "csv",filename = "impute_per_sample")),
scrollX = TRUE
),
autoHideNavigation = T,
fillContainer = T
)
Expand Down
2 changes: 1 addition & 1 deletion src/harpy/snakefiles/align_bwa.smk
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ rule genome_setup:
container:
None
message:
"copying {input} to Genome/"
"Copying {input} to Genome/"
shell:
"""
if (file {input} | grep -q compressed ) ;then
Expand Down
2 changes: 1 addition & 1 deletion src/harpy/snakefiles/align_ema.smk
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ rule genome_setup:
container:
None
message:
"copying {input} to Genome/"
"Copying {input} to Genome/"
shell:
"""
if (file {input} | grep -q compressed ) ;then
Expand Down
2 changes: 1 addition & 1 deletion src/harpy/snakefiles/align_strobealign.smk
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ rule genome_setup:
container:
None
message:
"copying {input} to Genome/"
"Copying {input} to Genome/"
shell:
"""
if (file {input} | grep -q compressed ) ;then
Expand Down
Loading
Loading