plot_enrichment

plot_enrichment(fileNames, sampleNames, bedFiles, basemod, outDir, threshA=129, threshC=129, colors=['#2D1E2F', '#A9E5BB', '#610345', '#559CAD', '#5E747F'], cores=None)
fileNames

name(s) of bam file with Mm and Ml tags

sampleNames

name(s) of sample for output file name labelling; valid names contain [a-zA-Z0-9_].

bedFiles

specified windows for region(s) of interest

basemod

One of the following (only valid to look at one type of mod):

  • 'A' - extract mA only

  • 'CG' - extract mCpG only

outDir

directory to output plot

threshA

threshold for calling mA; default 129

threshC

threshold for calling mCG; default 129

colors

color list in hex for overlay; default is [“#2D1E2F”, “#A9E5BB”, “#610345”, “#559CAD”, “#5E747F”]

cores

number of cores over which to parallelize; default is all available

Example

>>> dm.plot_enrichment(["dimelo/test/data/mod_mappings_subset.bam", "dimelo/test/data/mod_mappings_subset.bam"], ["test1", "test2"], "dimelo/test/data/test.bed", "CG", "dimelo/dimelo_test", threshC=129)
>>> dm.plot_enrichment("dimelo/test/data/mod_mappings_subset.bam", ["test1", "test2"], ["dimelo/test/data/test.bed", "dimelo/test/data/test.bed"], "CG", "dimelo/dimelo_test", threshC=129)

Return

Barplot with overall fraction of bases modified within regions of interest specified by bedFile(s)

Example Plots

dimelo-plot-enrichment - CLI interface

Plot DiMeLo methylation enrichment

dimelo-plot-enrichment [-h] -f FILENAMES [FILENAMES ...] -s SAMPLENAMES [SAMPLENAMES ...] -b
                       BEDFILES [BEDFILES ...] -m {A,CG} -o OUTDIR
                       [--colors COLORS [COLORS ...]] [-A THRESHA] [-C THRESHC] [-p CORES]

dimelo-plot-enrichment optional arguments

  • -h, --help - show this help message and exit

  • -A THRESHA, --threshA THRESHA - threshold above which to call an A base methylated (default: 129)

  • -C THRESHC, --threshC THRESHC - threshold above which to call a C base methylated (default: 129)

  • -p CORES, --cores CORES - number of cores over which to parallelize (default: None)

dimelo-plot-enrichment required arguments

  • -f FILENAMES, --fileNames FILENAMES - bam file name(s) (default: None)

  • -s SAMPLENAMES, --sampleNames SAMPLENAMES - sample name(s) for output file labelling (default: None)

  • -b BEDFILES, --bedFiles BEDFILES - name of bed file(s) defining region(s) of interest (default: None)

  • -m BASEMOD, --basemod BASEMOD - which base modification to extract (default: None)

  • -o OUTDIR, --outDir OUTDIR - directory to output plot (default: None)

dimelo-plot-enrichment plotting options

  • --colors COLORS - color list in hex (e.g. "#BB4430") for overlay plots (default: ['#2D1E2F', '#A9E5BB', '#610345', '#559CAD', '#5E747F'])