bio-reporting-jupyter-reports
$
npx mdskill add GPTomics/bioSkills/bio-reporting-jupyter-reportsGenerates reproducible bioinformatics reports using parameterized Jupyter notebooks
- Solves the need for automated, shareable computational analysis reports
- Uses Python and tools like Jupyter, Papermill, and nbconvert
- Injects parameters into notebook templates for dynamic execution
- Exports results as HTML, PDF, or executed notebooks for review
SKILL.md
.github/skills/bio-reporting-jupyter-reportsView on GitHub ↗
---
name: bio-reporting-jupyter-reports
description: Creates reproducible Jupyter notebooks for bioinformatics analysis with parameterization using papermill. Use when generating automated analysis reports, running notebook-based pipelines, or creating shareable computational notebooks.
tool_type: python
primary_tool: papermill
---
## Version Compatibility
Reference examples tested with: jupyter 1.0+, papermill 2.5+
Before using code patterns, verify installed versions match. If versions differ:
- Python: `pip show <package>` then `help(module.function)` to check signatures
- 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.
# Jupyter Reports with Papermill
**"Generate reproducible analysis reports"** → Execute parameterized Jupyter notebooks programmatically and export as HTML/PDF reports.
- Python: `papermill.execute_notebook(input, output, parameters={...})`
- CLI: `jupyter nbconvert --to html notebook.ipynb`
## Parameterized Notebooks
```python
import papermill as pm
# Execute notebook with parameters
pm.execute_notebook(
'analysis_template.ipynb',
'output_report.ipynb',
parameters={
'input_file': 'data/counts.csv',
'condition_col': 'treatment',
'fdr_threshold': 0.05
}
)
```
## Creating Parameterized Templates
Mark a cell with the `parameters` tag in Jupyter:
```python
# Parameters (tag this cell as "parameters")
input_file = 'default.csv'
output_dir = 'results/'
fdr_threshold = 0.05
```
## Batch Processing
```python
import papermill as pm
from pathlib import Path
samples = ['sample1', 'sample2', 'sample3']
for sample in samples:
pm.execute_notebook(
'qc_template.ipynb',
f'reports/{sample}_qc.ipynb',
parameters={'sample_id': sample}
)
```
## Converting to HTML/PDF
```bash
# Single notebook
jupyter nbconvert --to html report.ipynb
# With execution
jupyter nbconvert --execute --to html report.ipynb
# PDF (requires pandoc + LaTeX)
jupyter nbconvert --to pdf report.ipynb
```
## Best Practices
- Keep analysis code in cells, explanatory text in markdown
- Use parameters for all configurable values
- Include version information and timestamps
- Clear outputs before committing to version control
## Related Skills
- reporting/quarto-reports - Alternative report format
- reporting/rmarkdown-reports - R-based reports
- workflows/rnaseq-to-de - Embed in workflows
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.