bio-reporting-quarto-reports
$
npx mdskill add GPTomics/bioSkills/bio-reporting-quarto-reportsGenerate reproducible scientific reports using Quarto with R, Python, Julia, and Observable JS
- Solve the need for creating reproducible analysis reports and presentations
- Leverages Quarto, R, Python, Julia, and Observable JS for document generation
- Uses YAML headers and code chunks to structure narrative and analysis
- Delivers HTML, PDF, or Word outputs with embedded code and visualizations
SKILL.md
.github/skills/bio-reporting-quarto-reportsView on GitHub ↗
---
name: bio-reporting-quarto-reports
description: Build reproducible scientific documents, presentations, and websites with Quarto supporting R, Python, Julia, and Observable JS. Use when creating reproducible reports with Quarto.
tool_type: mixed
primary_tool: Quarto
---
## Version Compatibility
Reference examples tested with: Quarto 1.4+, DESeq2 1.42+, ggplot2 3.5+, matplotlib 3.8+, scanpy 1.10+
Before using code patterns, verify installed versions match. If versions differ:
- CLI: `<tool> --version` then `<tool> --help` to confirm flags
If code throws ImportError, AttributeError, or TypeError, introspect the installed
package and adapt the example to match the actual API rather than retrying.
# Quarto Reports
**"Create a Quarto analysis report"** → Write reproducible documents mixing code (Python/R), narrative, and figures that render to HTML/PDF/Word.
- CLI: `quarto render report.qmd --to html`
## Basic Document
```yaml
---
title: "Analysis Report"
author: "Your Name"
date: today
format:
html:
toc: true
code-fold: true
theme: cosmo
---
```
## Python Document
````markdown
---
title: "scRNA-seq Analysis"
format: html
jupyter: python3
---
```{python}
import scanpy as sc
import matplotlib.pyplot as plt
adata = sc.read_h5ad('data.h5ad')
sc.pl.umap(adata, color='leiden')
```
````
## R Document
````markdown
---
title: "DE Analysis"
format: html
---
```{r}
library(DESeq2)
dds <- DESeqDataSetFromMatrix(counts, metadata, ~ condition)
dds <- DESeq(dds)
```
````
## Multiple Formats
```yaml
---
title: "Multi-format Report"
format:
html:
toc: true
pdf:
documentclass: article
docx:
reference-doc: template.docx
---
```
```bash
# Render all formats
quarto render report.qmd
# Render specific format
quarto render report.qmd --to pdf
```
## Parameters
```yaml
---
title: "Parameterized Report"
params:
sample: "sample1"
threshold: 0.05
---
```
```bash
# Render with parameters
quarto render report.qmd -P sample:sample2 -P threshold:0.01
```
## Tabsets
````markdown
::: {.panel-tabset}
## PCA
```{r}
plotPCA(vsd)
```
## Heatmap
```{r}
pheatmap(mat)
```
:::
````
## Callouts
```markdown
::: {.callout-note}
This is an important note about the analysis.
:::
::: {.callout-warning}
Check your input data format before proceeding.
:::
::: {.callout-tip}
Use caching for long computations.
:::
```
## Cross-References
````markdown
See @fig-volcano for the volcano plot.
```{r}
#| label: fig-volcano
#| fig-cap: "Volcano plot showing DE genes"
ggplot(res, aes(log2FC, -log10(pvalue))) + geom_point()
```
Results are summarized in @tbl-summary.
```{r}
#| label: tbl-summary
#| tbl-cap: "Summary statistics"
knitr::kable(summary_df)
```
````
## Code Cell Options
````markdown
```{python}
#| echo: true
#| warning: false
#| fig-width: 10
#| fig-height: 6
#| cache: true
import scanpy as sc
sc.pl.umap(adata, color='leiden')
```
````
## Inline Code
```markdown
We found `{python} len(sig_genes)` significant genes.
We found `{r} nrow(sig)` significant genes.
```
## Presentations
```yaml
---
title: "Analysis Results"
format: revealjs
---
## Slide 1
Content here
## Slide 2 {.smaller}
More content with smaller text
```
## Quarto Projects
```yaml
# _quarto.yml
project:
type: website
output-dir: docs
website:
title: "Analysis Portal"
navbar:
left:
- href: index.qmd
text: Home
- href: methods.qmd
text: Methods
- href: results.qmd
text: Results
```
## Bibliography
```yaml
---
bibliography: references.bib
csl: nature.csl
---
```
```markdown
Gene expression analysis was performed using DESeq2 [@love2014].
## References
```
## Freeze Computations
```yaml
# _quarto.yml
execute:
freeze: auto # Only re-run when source changes
```
## Include Files
```markdown
{{< include _methods.qmd >}}
```
## Diagrams with Mermaid
````markdown
```{mermaid}
flowchart LR
A[Raw Data] --> B[QC]
B --> C[Alignment]
C --> D[Quantification]
D --> E[DE Analysis]
```
````
## Multi-Language Document
````markdown
---
title: "R + Python Analysis"
---
Load in R:
```{r}
library(reticulate)
counts <- read.csv('counts.csv')
```
Process in Python:
```{python}
import pandas as pd
counts_py = r.counts # Access R object
```
````
## Related Skills
- reporting/rmarkdown-reports - R-focused alternative
- data-visualization/ggplot2-fundamentals - R visualizations
- workflow-management/snakemake-workflows - Pipeline integration
More from GPTomics/bioSkills
- bio-admet-predictionPredicts ADMET properties using ADMETlab 3.0 API or DeepChem models. Estimates bioavailability, CYP inhibition, hERG liability, and 119 toxicity endpoints with uncertainty quantification. Filters for PAINS and other structural alerts. Use when filtering compounds for drug-likeness or prioritizing leads by predicted safety.
- bio-alignment-amplicon-clippingTrim PCR primers from aligned reads in amplicon-panel BAMs using samtools ampliconclip. Use when processing SARS-CoV-2 ARTIC, hereditary cancer panels, ctDNA hot-spot panels, or any amplicon assay where primer-derived bases would falsely confirm reference at primer footprints.
- bio-alignment-filteringFilter alignments by flags, mapping quality, and regions using samtools view and pysam. Use when extracting specific reads, removing low-quality alignments, or subsetting to target regions.
- bio-alignment-indexingCreate and use BAI/CSI indices for BAM/CRAM files using samtools and pysam. Use when enabling random access to alignment files or fetching specific genomic regions.
- bio-alignment-ioRead, write, and convert multiple sequence alignment files using Biopython Bio.AlignIO. Supports Clustal, PHYLIP, Stockholm, FASTA, Nexus, and other alignment formats for phylogenetics and conservation analysis. Use when reading, writing, or converting alignment file formats.
- bio-alignment-msa-parsingParse and analyze multiple sequence alignments using Biopython. Extract sequences, identify conserved regions, analyze gaps, work with annotations, and manipulate alignment data for downstream analysis. Use when parsing or manipulating multiple sequence alignments.
- bio-alignment-msa-statisticsCalculate alignment statistics including sequence identity, conservation scores, substitution matrices, and similarity metrics. Use when comparing alignment quality, measuring sequence divergence, and analyzing evolutionary patterns.
- bio-alignment-multiplePerform multiple sequence alignment using MAFFT, MUSCLE5, ClustalOmega, or T-Coffee. Guides tool and algorithm selection based on dataset size, sequence divergence, and downstream application. Use when aligning three or more homologous sequences for phylogenetics, conservation analysis, or evolutionary studies.
- bio-alignment-pairwisePerform pairwise sequence alignment using Biopython Bio.Align.PairwiseAligner. Use when comparing two sequences, finding optimal alignments, scoring similarity, and identifying local or global matches between DNA, RNA, or protein sequences.
- bio-alignment-sortingSort alignment files by coordinate or read name using samtools and pysam. Use when preparing BAM files for indexing, variant calling, or paired-end analysis.