Welcome to pylluminator
Tutorials | API documentation | Source code | Release on pip
Pylluminator is a Python package designed to provide an efficient workflow for processing, analyzing, and visualizing DNA methylation data. Pylluminator is inspired from the popular R packages SeSAMe and ChAMP.
Pylluminator supports the following Illumina’s Infinium Beadchip array versions:
human: 27k, 450k, MSA, EPIC, EPIC+, EPICv2
mouse: MM285
mammalian: Mammal40
Main functionalities
idat files parsing
data preprocessing
Type-I probes channel inference
Dye bias correction (3 methods: using normalization control probes / linear scaling / non-linear scaling)
Detection p-value calculation (pOOBAH)
Background correction (NOOB)
Batch effect correction (ComBat)
data analysis and visualisation
beta values (density, PCA, MDS, dendrogram…)
DMPs accounting for replicates / random effects, DMRs
CNV, CNS
pathway analysis with GSEApy (GSEA, ORA)
quality control
Visualization examples:
Fig 1. Samples beta values density |
Fig 2. Differentially methylated regions (DMRs) |
Fig 3. Probes beta values associated with a specific gene |
Fig 4. Copy number variations (CNVs) |
Installation
With pip
You can install Pylluminator directly with:
pip install pylluminator
Or, if you want to use the GSEA functionalities, you will need to install the additional dependencies using this command:
pip install pylluminator[gsea]
From source
We recommend using a virtual environment with Python 3.13 or 3.12 to build pylluminator from source. Here is an example using Conda.
Setup the virtual environment (optional)
If you don’t have Conda installed yet, here are the instructions depending on your OS : Windows | Linux | MacOS. After installing it, make sure you have Pip installed by running the following command in the terminal:
conda install anaconda::pip
Now you can create a Conda environment named “pylluminator” and activate it. You can change the name to your liking ;)
conda create -n pylluminator python=3.13
conda activate pylluminator
Install pylluminator
You can download the latest source from github, or clone the repository with this command:
git clone https://github.com/eliopato/pylluminator.git
Your are now ready to install the dependencies and the package :
cd pylluminator
pip install .
Or, as mentionned above, pip install .[gsea] if you want to use the GSEA functionalities.
Usage
Refer to https://pylluminator.readthedocs.io/ for step-by-step tutorials and detailed documentation.
Citing
Pylluminator is described in detail in: Pylluminator: fast and scalable analysis of DNA methylation data in Python, available on BioRxiv
If you use this package in your research, please cite our work.
If you use the updated version of the EPICv2/hg38 annotations, please cite Re-annotating the EPICv2 manifest with genes, intragenic features, and regulatory elements, (BioRxiv link)
Contributing
We welcome contributions! If you’d like to help improve the package, please follow these steps:
Fork the repository.
Create a new branch for your feature or bugfix.
Make your changes and test them.
Submit a pull request describing your changes.
The packages used for development (testing, packaging and building the documentation) can be installed with pip install pylluminator[dev,docs].
Bug reports / new features suggestion
If you encounter any bugs, have questions, or feel like the package is missing a very important feature, please open an issue on the GitHub Issues page.
When opening an issue, please provide as much detail as possible, including:
Steps to reproduce the issue
The version of the package you are using
Any relevant code snippets or error messages
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgements
This package is strongly inspired from SeSAMe and includes code from methylprep for .idat files parsing.
Contents
- Home
- Getting started
- Annotations
- API
- annotations
- cnv
- dm
- mask
- quality_control
- read_idat
- bytes_to_int
- get_file_object
- npread
- read_and_reset
- read_byte
- read_char
- read_int
- read_long
- read_short
- read_string
- IdatDataset
- IdatHeaderLocation
IdatHeaderLocationIdatHeaderLocation.__init__()IdatHeaderLocation.as_integer_ratio()IdatHeaderLocation.bit_count()IdatHeaderLocation.bit_length()IdatHeaderLocation.conjugate()IdatHeaderLocation.denominatorIdatHeaderLocation.from_bytes()IdatHeaderLocation.imagIdatHeaderLocation.is_integer()IdatHeaderLocation.numeratorIdatHeaderLocation.realIdatHeaderLocation.to_bytes()
- IdatSectionCode
IdatSectionCodeIdatSectionCode.__init__()IdatSectionCode.as_integer_ratio()IdatSectionCode.bit_count()IdatSectionCode.bit_length()IdatSectionCode.conjugate()IdatSectionCode.denominatorIdatSectionCode.from_bytes()IdatSectionCode.imagIdatSectionCode.is_integer()IdatSectionCode.numeratorIdatSectionCode.realIdatSectionCode.to_bytes()
- sample_sheet
- samples
- from_sesame
- read_idata
- read_samples
- Samples
SamplesSamples.__init__()Samples.add_annotation_info()Samples.batch_correction()Samples.calculate_betas()Samples.cg_probes()Samples.ch_probes()Samples.controls()Samples.copy()Samples.drop_samples()Samples.dye_bias_correction()Samples.dye_bias_correction_l()Samples.dye_bias_correction_nl()Samples.get_betas()Samples.get_m_values()Samples.get_mean_ib_intensity()Samples.get_nb_probes_per_chr_and_type()Samples.get_negative_controls()Samples.get_normalization_controls()Samples.get_probes()Samples.get_probes_with_probe_type()Samples.get_signal_df()Samples.get_total_ib_intensity()Samples.has_betas()Samples.ib()Samples.ib_green()Samples.ib_red()Samples.infer_type1_channel()Samples.load()Samples.mask_control_probes()Samples.mask_non_cg_probes()Samples.mask_non_unique_probes()Samples.mask_probes_by_names()Samples.mask_quality_probes()Samples.mask_snp_probes()Samples.mask_xy_probes()Samples.merge_samples_by()Samples.meth()Samples.nb_probesSamples.nb_samplesSamples.noob_background_correction()Samples.oob()Samples.oob_green()Samples.oob_red()Samples.poobah()Samples.probe_idsSamples.remove_probes_suffix()Samples.reset_betas()Samples.reset_poobah()Samples.sample_label_nameSamples.sample_labelsSamples.save()Samples.scrub_background_correction()Samples.snp_probes()Samples.subset()Samples.type1()Samples.type1_green()Samples.type1_red()Samples.type2()Samples.unmeth()
- stats
- utils
- column_names_to_snake_case
- concatenate_non_na
- convert_to_path
- download_from_geo
- download_from_link
- get_chromosome_number
- get_column_as_flat_array
- get_files_matching
- get_logger
- get_logger_level
- get_resource_folder
- load_object
- merge_alt_chromosomes
- merge_dataframe_by
- merge_series_values
- remove_probe_suffix
- save_object
- set_channel_index_as
- set_level_as_index
- set_logger
- visualizations
- analyze_replicates
- betas_2D
- betas_dendrogram
- betas_density
- betas_heatmap
- cns_manhattan_plot
- dmp_heatmap
- dmr_manhattan_plot
- metadata_correlation
- metadata_pairplot
- nb_probes_per_chr_and_type_hist
- pc_association_heatmap
- pc_correlation_heatmap
- plot_betas_distribution
- plot_mean_beta_diff_per_group
- show_chromosome_legend
- visualize_chromosome_region
- visualize_gene