Conversation
- used Claude to translate Rmarkdown to Notebook - made small adaptions, but the equality of the results has to be still tested
enryH
left a comment
There was a problem hiding this comment.
I left the output in the notebook so it can be easily inspected:
or using the nbviewer:
https://nbviewer.org/github/biosustain/dsp_transcriptomics_training/blob/add_pyDeseq2/01_scripts/02_differential_expression_analysis_pyDeseq2.ipynb
There was a problem hiding this comment.
Pull request overview
Adds a Python/pyDESeq2-based differential expression analysis workflow alongside the existing R DESeq2 report, aiming to reproduce the treatment vs control contrast in a Jupyter-friendly format.
Changes:
- Introduces a Jupytext-compatible Python notebook script implementing DE analysis with pyDESeq2 (including shrinkage, plots, and result export).
- Loads nf-core merged gene counts + sample metadata, constructs a pyDESeq2 dataset, and runs the treatment vs control contrast.
- Writes full and significant results tables and optionally compares overlap with existing R outputs.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| from pathlib import Path | ||
|
|
||
| import matplotlib.pyplot as plt | ||
| import numpy as np | ||
| import pandas as pd | ||
| import seaborn as sns | ||
| from pydeseq2.dds import DeseqDataSet | ||
| from pydeseq2.ds import DeseqStats | ||
| from scipy.stats import zscore |
| # If needed, uncomment and run: | ||
| # conda create -n pydeseq2 python pip | ||
| # conda activate pydeseq2 | ||
| # # %pip install pydeseq2 pandas numpy matplotlib seaborn scipy ipykernel |
| "## 1. Setup\n", | ||
| "Install dependencies if needed, then import libraries.\n", | ||
| "\n", | ||
| "Using conda (microforge recommended) and pip, you can install the required packages with the following commands:\n", |
There was a problem hiding this comment.
It might be useful for some users to add a link to the microforge site to get installation instructions immediately (if they don't have conda installed yet)
…significantly different
|
Testing procedure for comparison of pydeseq2 and R-DESeq2 results Main findings |
Concepts form R seem to be translated to Python.