Work

Bacterial Methylome Mapping

Year: 2026
Type: software
Abstract: Bacterial Methylome Mapping This archive is a complement to the scientific study Bouchereau, E. et al. “Environmental salinity drives DNA methylation plasticity in the oyster pathogen Vibrio aestuarianus” (2027). This archive contains the custom scripts necessary for processing PacBio kinetic data and EM-seq data, identifying methylation motifs (EM-seq), and producing an complete annotated methylome table. The exemples below use the directory layout used on HPC environment. Paths, module names and resource requests need to be adapted to user HPC environment and needs. All tools were callibrated to the study of bacteria methylomes. Overview The analysis combines: - PacBio SMRT sequencing: used to detect m6A and m4C methylation from IPD kinetics and to identify methylation motifs. - EM-seq sequencing: used to quantify m5C methylation and find corresponding motifs. - Methylome-table processing: used to annotate sites, remove duplicated motif calls, merge EM-seq measurements, and classify methylation status. - Supplementary analyses: including coverage plots. The main processing order is: ```text PacBio / EM-seq preprocessing | v Merging results in a table | v Motif and methylation tables | v 01_deduplication.py | v 01bis_merge_methylation_emseq.py (when EM-seq data are available) | v 02_adding_methylation_status.py | v 03_annotate_genomic_context.py | v Final tables and optional plots ``` The results from the "PacBio preprocessing" where merged in a table using the following script in the singularity environment :./smrtlink_11.1.0.166339.lipme lipm_methylation.pl -input list_samples.txt -user_motif motifs.txt -fasta Genome_Pto.fasta -annotation annotation_Pto.gff -output methylation_Pto -onlyAC -hasMotif list_samples.txt follow the structure : patho_to_PacBio_gff sample_name motifs.txt follow the structure : Motif_sequence methylation_type methylated_position Project structure ```text bacterial-methylome-processing/ ├── 00_build_singularity_img_for_pacbio_tools/ │ ├── LipmError/ │ │ ├── IOException.pm │ │ ├── ObjectException.pm │ │ └── ParameterException.pm │ ├── General.pm │ ├── GeneralBioinfo.pm │ ├── lipm_find_motif.pl │ ├── lipm_methylation.pl │ ├── LipmError.pm │ ├── LipmObject.pm │ ├── ParamParser.pm │ ├── README.md │ └── smrtlink.singularity ├── 01_Sequencing-DATA-processing/ │ ├── pacbio.bacteria.epigenetic.sh │ ├── emseq.bacteria.epigenetic.sh │ └── 00_Scripts-PBS/ │ ├── 00_Subsampling_bam.pbs │ ├── 02_EMseq.pbs │ ├── run_pacbio-bacteria-epigenetic_single.pbs │ ├── run_pacbio-bacteria-epigenetic_multipleStrains.pbs │ ├── run-LongQC.pbs │ ├── run_bamTOfastq.pbs │ ├── run_indexing_pacbioDATA.pbs │ ├── run_samtoolsSTAT.pbs │ └── run_subreads-to-css.pbs ├── 02_m5C_methylation_motif_finder/ │ └── search_motif_V2.py ├── 03_Methylome-table_processing/ │ ├── 01_deduplication.py │ ├── 01bis_merge_methylation_emseq.py │ ├── 02_adding_methylation_status.py │ └── 03_annotate_genomic_context.py ├── 04_Supplementary_analysis/ │ └── Coverage_plot_1.3.py ├── bam_stats.pl ├── bam_stats.R ├── list_samples.txt ├── motifs.txt └── conda_environment_smrt-env_list ``` Requirements and installation Singularity Image The presented pipeline use a singularity image to use the different PacBio tools as well as the perl script "lipm_methylation.pl". The process to build the necessary image is describe in 00_build_singularity_img_for_pacbio_tools folder. The name for the builded singularity image used in this pipeline is "smrtlink_11.1.0.166339.lipme". Operating environment The PBS scripts were written for a Linux HPC cluster using PBS/Torque. They expect environment variables such as `DATAWORK`, `SCRATCH`, `TOOLS`, `NCPUS`, and, for some jobs, `PBS_ARRAY_INDEX`. Several scripts also load cluster specific modules or source cluster-specific environment files. They are not drop-in scripts for a local Windows installation. Conda and Python The main pipeline has been developped around a singularity enviornment which contains all necessary tools for PacBio kinetic data preprocessing. EM-seq data preprocessing and other analysis will need their respecting tools from conda installation if not currently available to the user. If conda is necessary, create an environment suitable for the Python table-processing scripts. The repository contain a package snapshot (`conda_environment_smrt-env_list`) of the historical `smrt-env` environment and includes older Python 2.7 for the conda installation of PacBio tools, which was used for 00_Subsampling_bam.pbs and run_subreads-to-css.pbs. The other environment "bioinfo-ely-env", is a standard bioinformatic environment for simple analysis : run-LongQC.pbs, run_samtoolsSTAT.pbs and the homemade python scripts. The Python scripts import the following packages: ```bash conda install -c conda-forge -c bioconda \ python pandas numpy matplotlib seaborn openpyxl pysam biopython \ pybedtools gffpandas plotly prince ``` Some packages may be easier to install with pip on a particular cluster: ```bash python -m pip install gffpandas pybedtools prince ``` Check the installation before a long run: ```bash python -c "import pandas, numpy, matplotlib, pysam, Bio, gffpandas, pybedtools, prince" ``` External command-line tools Depending on the branch of the workflow being used, install or load: - `samtools` - PacBio SMRT tools: `pbmm2`, `ipdSummary`, `motifMaker`, `dataset`, `pbreports` - `singularity` - `bismark`, `bowtie2`, and `trim-galore` for EM-seq - `meme-chip` for optional EM-seq motif discovery - `bedtools`/`pybedtools` support for table annotation - `LongQC`, `bam2fastq`, `pbindex`, and `ccs` for optional preprocessing The cluster PBS scripts contain the versions and environment paths used in the study. Read the `## USAGE EXAMPLE` section at the top of each PBS script before submitting it. Input and directory conventions The PBS workflow uses a base directory similar to: ```text $DATAWORK/Epigenetic/Methylome/ ├── in/ │ ├── Genomes/ │ ├── Samples/ │ ├── EMseq/ │ └── sample_config.tsv ├── out/ ├── logs/ └── ... ``` For the multi-strain PacBio job, `sample_config.tsv` must contain a header and one tab-separated row per sample: ```text BAM_filename<TAB>genome_filename<TAB>sample_name<TAB>cutoff ``` The BAM filenames are resolved under `in/Samples/`, genome filenames under `in/Genomes/`, and the noise cutoff is passed to `motifMaker`. Usage 1. PacBio processing For PacBio processing, two script have been developped. On for a single sample, best used for testing the pipeline. The second script run all samples listed in one go but necessit to know the pipeline well to avoid errors. Single sample The single-sample PBS job receives the BAM path, sample name, and motif score cutoff through `qsub` variables: ```bash qsub -v \ FILE=/path/to/Methylome/in/Samples/bc2042_S15.bam,\ SAMPLE=bc2042_S15,\ SEUIL=180 \ 01_Sequencing-DATA-processing/00_Scripts-PBS/run_pacbio-bacteria-epigenetic_single.pbs ``` The reference genome is defined inside the script. The underlying wrapper is: ```bash bash 01_Sequencing-DATA-processing/pacbio.bacteria.epigenetic.sh \ GENOME SAMPLE BAM_FILE NCPUS BASE_FOLDER [CUTOFF] ``` The wrapper maps reads with `pbmm2`, filters and indexes the alignments, calls kinetic modifications with `ipdSummary`, and searches/reprocesses motifs with `motifMaker`. Multiple strains or samples Create `in/sample_config.tsv`, then submit one array task per data row: ```bash SAMPLE_COUNT=$(tail -n +2 \ "$DATAWORK/Epigenetic/Methylome/in/sample_config.tsv" | wc -l) qsub -J 1-${SAMPLE_COUNT} \ 01_Sequencing-DATA-processing/00_Scripts-PBS/run_pacbio-bacteria-epigenetic_multipleStrains.pbs ``` The PBS array index selects the corresponding line from the configuration file. Results and logs are written below: ```text $DATAWORK/Epigenetic/Methylome/out/ $DATAWORK/Epigenetic/Methylome/logs/ ``` PacBio helper jobs - `run_subreads-to-css.pbs`: convert PacBio subreads to CCS/HiFi reads. - `run_bamTOfastq.pbs`: convert BAM files to FASTQ. - `run_indexing_pacbioDATA.pbs`: create PacBio BAM indices. - `run-LongQC.pbs`: run LongQC quality control. - `run_samtoolsSTAT.pbs`: compute alignment statistics. - `00_Subsampling_bam.pbs`: split a BAM into three reproducible subsamples. For BAM subsampling, providing `TOTAL_READS` produces an exact, as-even-as possible split. Omitting it uses fast independent random assignment, so the three output files may have slightly different sizes. 2. EM-seq processing The EM-seq PBS job is an array job. It selects the sorted `*_R1.fastq.gz` file corresponding to `PBS_ARRAY_INDEX` and derives the matching R2 filename. The reference genome is expected at: ```text $DATAWORK/Epigenetic/Methylome/in/Vaestu_circlatorS15_12-016.fasta ``` Submit it after counting the input R1 files: ```bash SAMPLE_COUNT=$(find "$DATAWORK/Epigenetic/Methylome/in/EMseq" \ -name '*_R1.fastq.gz' | wc -l) qsub -J 1-${SAMPLE_COUNT} \ -v DATAWORK="$DATAWORK",SCRATCH="$SCRATCH" \ 01_Sequencing-DATA-processing/00_Scripts-PBS/02_EMseq.pbs ``` The wrapper runs trimming, Bismark genome preparation and mapping, BAM filtering/deduplication, methylation extraction, and coverage filtering. 3. m5C motif finding `02_m5C_methylation_motif_finder/search_motif_V2.py` combines a reference genome FASTA, a context FASTA, and one or more Bismark coverage files. Samples are provided as `NAME:FILE` pairs: ```bash python 02_m5C_methylation_motif_finder/search_motif_V2.py \ path/to/reference.fasta \ path/to/context.fasta \ --samples \ S15-1:path/
Language: English
Open Access status: green
OpenAlex ID: W7224682804
Cites:
Cited by:
Related to: 10