Skip to content
Snippets Groups Projects
report.Rmd 5.86 KiB
Newer Older
Valentina Galata's avatar
Valentina Galata committed
---
title: "ONT pilot project - report"
date: "`r Sys.time()`"
Valentina Galata's avatar
Valentina Galata committed
output:
    html_document:
Valentina Galata's avatar
Valentina Galata committed
        toc: true
        toc_float: true
        toc_depth: 2
---

# Input

- working directory: `r snakemake@config$work_dir`
    - short reads:
        - R1: `r paste(snakemake@config$data$metag$sr$r1, collapse=", ")`
        - R2: `r paste(snakemake@config$data$metag$sr$r2, collapse=", ")`
    - long reads: `r paste(snakemake@config$data$metag$ont$fastq, collapse=", ")`
- meta-transcriptomics:
    - short reads:
        - R1: `r paste(snakemake@config$data$metat$sr$r1, collapse=", ")`
        - R2: `r paste(snakemake@config$data$metat$sr$r2, collapse=", ")`
Valentina Galata's avatar
Valentina Galata committed

```{r tables-nanostats, echo=FALSE}
knitr::kable(TABS$nanostats, caption='Long reads: NanoStats')
```

```{r tables-fastp, echo=FALSE}
knitr::kable(TABS$fastp$metag, caption='Short reads (metaG): Fastp')
if(HAS_METAT){
    knitr::kable(TABS$fastp$metat, caption='Short reads (metaT): Fastp')
}
```{r figures-mash-reads, echo=FALSE, fig.width=10, fig.height=10, fig.cap='Sample (dis)similarity (Mash)', fig.topcaption = TRUE}
if(!is.null(FIGS$mash)){
    grid.newpage()
    grid.draw(FIGS$mash$reads)
}
```

# Assembly

## Mappability
```{r figures-mappability-metag, echo=FALSE, fig.width=10, fig.height=7, fig.cap='Mappability, metaG', fig.topcaption = TRUE}
print(FIGS$mappability$metag)
```{r figures-mappability-metat, echo=FALSE, fig.width=10, fig.height=7, fig.cap='Mappability, metaT', fig.topcaption = TRUE}
    print(FIGS$mappability$metat)
}
## Assembly similarity
```{r figures-mash-asm, echo=FALSE, fig.width=10, fig.height=10, fig.cap='Assembly (dis)similarity (Mash)', fig.topcaption = TRUE}
Valentina Galata's avatar
Valentina Galata committed
if(!is.null(FIGS$mash)){
    grid.newpage()
Valentina Galata's avatar
Valentina Galata committed
}
```{r figures-fastani, echo=FALSE, fig.width=10, fig.height=10, fig.cap='Assembly ANI (FastANI)', fig.topcaption = TRUE}
if(!is.null(FIGS$fastani)){
    grid.newpage()
    grid.draw(FIGS$fastani$pheatmap)
}
```

```{r figures-mummer-seqs, echo=FALSE, fig.width=10, fig.height=10, fig.cap='Aligned sequences (Mummer)', fig.topcaption = TRUE}
if(!is.null(FIGS$mummer)){
    grid.newpage()
    grid.draw(FIGS$mummer$seqs)
}
```

```{r figures-mummer-bases, echo=FALSE, fig.width=10, fig.height=10, fig.cap='Aligned bases (Mummer)', fig.topcaption = TRUE}
if(!is.null(FIGS$mummer)){
    grid.newpage()
    grid.draw(FIGS$mummer$bases)
}
```

## Assembly quality

```{r tables-quast, echo=FALSE}
Valentina Galata's avatar
Valentina Galata committed
if(!is.null(TABS$quast)){
    knitr::kable(t(TABS$quast), caption='QUAST')
}
```{r figures-quast, echo=FALSE, fig.width=10, fig.height=10, fig.cap='Assembly statistics w/ QUAST', fig.topcaption = TRUE}
Valentina Galata's avatar
Valentina Galata committed
if(!is.null(FIGS$quast)){
    print(FIGS$quast)
}
## Plasmid prediction
```{r figures-plasflow, echo=FALSE, fig.width=10, fig.height=7, fig.cap='Plasmid prediction w/ Plasflow', fig.topcaption = TRUE}
Valentina Galata's avatar
Valentina Galata committed
if(!is.null(FIGS$plasflow)){
    print(FIGS$plasflow$sum_pct)
}
```{r figures-prodigal-counts, echo=FALSE, fig.width=10, fig.height=7, fig.cap='Number of genes/proteins (Prodigal)', fig.topcaption = TRUE}
print(FIGS$prodigal$gcounts)
```{r figures-prodigal-pct, echo=FALSE, fig.width=10, fig.height=7, fig.cap='Number of partial genes/proteins (Prodigal)', fig.topcaption = TRUE}
knitr::opts_chunk$set(warning=FALSE)
```{r figures-prodigal-lengthv, echo=FALSE, fig.width=10, fig.height=7, fig.cap='Gene length (Prodigal), zommed in', fig.topcaption = TRUE}
print(FIGS$prodigal$glen_zoom)
```{r figures-diamondDB-density, echo=FALSE, fig.width=10, fig.height=7, fig.cap='nr UniProtKB/TrEMBL (DIAMOND)', fig.topcaption = TRUE}
if(!is.null(FIGS$diamondDB)){
    print(FIGS$diamondDB$density_qs_len_ratio)
    print(FIGS$diamondDB$density2d)
Valentina Galata's avatar
Valentina Galata committed
}
```{r figures-diamond-barplot, echo=FALSE, fig.width=10, fig.height=12, fig.cap='Unique genes/proteins (DIAMOND)', fig.topcaption = TRUE}
if(!is.null(FIGS$diamond)){
    print(FIGS$diamond$uniq)
}
```

```{r figures-diamond-scatter, echo=FALSE, fig.width=10, fig.height=10, fig.cap='Unique genes/proteins (DIAMOND)', fig.topcaption = TRUE}
if(!is.null(FIGS$diamond)){
    print(FIGS$diamond$u_hcu_metag)
    if(HAS_METAT){
        print(FIGS$diamond$u_hcu_metat)
    }
}
```
```{r tables-diamond, echo=FALSE}
knitr::kable(TABS$diamond, caption='DIAMOND (number of proteins in tool2 but not in tool1)')
```

```{r figures-cdhit-barplot, echo=FALSE, fig.width=10, fig.height=12, fig.cap='Unique genes/proteins (CD-HiT)', fig.topcaption = TRUE}
Valentina Galata's avatar
Valentina Galata committed
if(!is.null(FIGS$cdhit)){
    print(FIGS$cdhit$uniq)
```{r figures-cdhit-scatter, echo=FALSE, fig.width=10, fig.height=10, fig.cap='Unique genes/proteins (CD-HIT)', fig.topcaption = TRUE}
if(!is.null(FIGS$cdhit)){
    print(FIGS$cdhit$u_hcu_metag)
        print(FIGS$cdhit$u_hcu_metat)
Valentina Galata's avatar
Valentina Galata committed
}
```{r tables-cdhit, echo=FALSE}
knitr::kable(TABS$cdhit, caption='CD-HIT (number of proteins in tool2 but not in tool1)')
```

```{r figures-crispr-casc, echo=FALSE, fig.width=10, fig.height=7, fig.cap='CRISPR prediction (CASC)', fig.topcaption = TRUE}
if(!is.null(FIGS$casc)){
    print(FIGS$casc$num)
Valentina Galata's avatar
Valentina Galata committed
}
```{r figures-crispr-minced, echo=FALSE, fig.width=10, fig.height=7, fig.cap='CRISPR prediction (MinCED)', fig.topcaption = TRUE}
if(!is.null(FIGS$minced)){
    print(FIGS$minced$num)
Valentina Galata's avatar
Valentina Galata committed
}
```{r figures-barrnap-total, echo=FALSE, fig.width=10, fig.height=10, fig.cap='rRNA gene prediction w/ barrnap', fig.topcaption = TRUE}
if(!is.null(FIGS$barrnap)){
    print(FIGS$barrnap$total)
}
```

```{r figures-barrnap-genes, echo=FALSE, fig.width=10, fig.height=10, fig.cap='rRNA gene prediction w/ barrnap', fig.topcaption = TRUE}
    for(kingdom_name in sort(unique(TABS$barrnap$kingdom))){
        print(FIGS$barrnap[[kingdom_name]])
Valentina Galata's avatar
Valentina Galata committed
```