Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SWMM — SeqWord Motif Mapper

SWMM (SeqWord Motif Mapper) is a Python program for visualizing and statistically evaluating the distribution of epigenetically modified nucleotides and motifs in bacterial genomes and metagenomic contigs.

SWMM provides two main workflows:

  • sort-contigs — sorts previously binned metagenomic contigs according to their methylation-motif patterns.
  • methylation-pattern — visualizes genome methylation patterns and evaluates the distribution of epigenetically modified bases.

Contents

General usage

Display the main help message:

python3 swmm.py --help
usage: swmm.py [-h] [-v]
Option Description
-h, --help Show the help message and exit.
-v, --version Show the program version and exit.

Sort contigs

The sort-contigs command sorts binned contigs based on patterns of methylated motifs.

Help

python3 swmm.py sort-contigs --help

Usage

usage: sort_contigs.py [-h]
                       [-i INPUT_FOLDER]
                       [-o OUTPUT_FOLDER]
                       [-p PROJECT_FOLDER]
                       [-g GFF_FILE]
                       [-m MOTIFS]
                       [--output_graph_format {SVG,HTML,PDF,EPS,JPG,JPEG,TIF,TIFF,PNG,BMP}]
                       [-u {keep,split}]
                       [--filter_chimeric_contigs FILTER_CHIMERIC_CONTIGS]
                       [-c {Y,y,N,n}]
                       [--dpi DPI]
                       [--mqs MQS]
                       [-l SLIDING_WINDOW_LENGTH]
                       [-w SLIDING_WINDOW_STEP]
                       [--file_name_separator FILE_NAME_SEPARATOR]
                       [-s {Y,N,y,n}]

Arguments

Option Description Default
-h, --help Show the help message and exit.
-i INPUT_FOLDER, --input_folder INPUT_FOLDER Input folder. input
-o OUTPUT_FOLDER, --output_folder OUTPUT_FOLDER Output folder. output
-p PROJECT_FOLDER, --project_folder PROJECT_FOLDER Project folder. Current directory
-g GFF_FILE, --gff_file GFF_FILE GFF file containing epigenetic predictions. If omitted, the program searches for bin-specific GFF files. Empty
-m MOTIFS, --motifs MOTIFS Semicolon-separated motif definitions, for example GATC,2,-2; CCWGG,2,-2.
--output_graph_format FORMAT Output format: SVG, HTML, PDF, EPS, JPG, JPEG, TIF, TIFF, PNG, or BMP. SVG
-u {keep,split}, --unresolved_contigs {keep,split} Keep or split unresolved contigs with statistically insignificant methylation patterns. keep
--filter_chimeric_contigs VALUE Filter contigs with a non-random distribution of modified sites. Accepts Yes, No, or a p-value satisfying 0 < p <= 0.05. No
-c {Y,y,N,n}, --circular_graph {Y,y,N,n} Produce a circular graph. Y
--dpi DPI Output image resolution in dots per inch. 600
--mqs MQS Minimum methylation quality score. 20
-l LENGTH, --sliding_window_length LENGTH Sliding-window length. 2000
-w STEP, --sliding_window_step STEP Sliding-window step. 500
--file_name_separator SEPARATOR Separator used to select the basename as the first part of a filename. Empty
-s {Y,N,y,n}, --save_graphs {Y,N,y,n} Save generated graphs. Y

Methylation pattern

The methylation-pattern command processes GFF files generated by ipdSummary, produces graphical representations, and performs statistical analysis of the distribution of epigenetically modified bases.

Help

python3 swmm.py methylation-pattern --help

General usage

python run.py [arguments]
python run.py -h
python run.py --help
python run.py -v
python run.py --version

Example

python program.py \
    -i input.gff \
    -g genome.gbk \
    -d example \
    -mm Y \
    -w GATC,2,-2 \
    -p 100 \
    -sp Y

This example:

  1. Reads input.gff and genome.gbk from ./input/example.
  2. Writes graphical and text output to ./output/example.
  3. Searches for the motif GATC,2,-2.
  4. Treats the second nucleotide from the left on the direct strand and the second nucleotide from the right on the reverse-complement strand as modified positions.
  5. Sets the promoter length to 100 bp.
  6. Enables circular-map visualization and motif-distribution statistics.

General settings

Option Description Default
-d FOLDER, --project_directory FOLDER Project subfolder. Empty
-i FILE, --input_GFF FILE Input GFF filename. Required. Empty
-g FILE, --input_GBK FILE Input GenBank filename. Required. Empty
-m FILE, --filter_file FILE File defining regions to filter. Empty
-ft NAME, --generic_file_name NAME Generic output filename. Empty
-ogf FORMAT, --output_graph_format FORMAT Output format: SVG, HTML, PDF, EPS, JPG, JPEG, TIF, TIFF, PNG, or BMP. HTML
-dpi DPI, --dpi DPI Raster-image resolution from 100 to 1200 dpi. 300
-p LENGTH, --promoter_length LENGTH Promoter-region length. 75
-r NUMBER, --maximum_sites NUMBER Maximum number of sites to verify. Use 0 to skip checking. 10000
-n NUMBER, --blast_context_mismatch NUMBER Allowed number of context mismatches. 2
-z Yes/No, --blast_motif_mismatch Yes/No Allow motif mismatches. Yes
-u FOLDER, --input_folder FOLDER Input folder. input
-o FOLDER, --output_folder FOLDER Output folder. output
-x FOLDER Executable folder. ./lib/bin
-tmp FOLDER Temporary folder. ./lib/bin/tmp

Circular-map settings

Option Description Default
-mm Y/N, --circular_map Y/N Generate a circular plot. Y
-w MOTIF, --cmap_motif MOTIF Motif definition, for example GATC,2,-2.
-s MODE, --sites_or_motifs MODE Search for sites or motifs. Accepted values include sites, motifs, S, and M. sites
-f M/U, --modified_or_unmodified M/U Display modified or unmodified motifs. M
-wl LENGTH, --window_length LENGTH Sliding-window length. 8000
-ws STEP, --window_step STEP Sliding-window step. 2000
-c SCORE, --cmap_score_cutoff SCORE Circular-plot score cutoff. 21
-cmt TITLE, --cmap_graph_title TITLE Circular-map graph title. Empty

Dot-plot settings

Option Description Default
-dp Y/N, --dotplot Y/N Generate a dot plot. N
-dpn BASES, --nucleotides BASES Nucleotides to display: A, C, G, T, or an empty value. A,C
-dpm TYPES, --methylation_types TYPES Methylation types to display, such as m6A or m4C. Empty
-dpf MOTIFS, --dotplot_motifs MOTIFS Motifs to include or exclude, for example GATC,2,-2; -CRGKGATC,1,6,-2.
-dpc SCORE, --dotplot_score_cutoff SCORE Dot-plot score cutoff. 21
-dpw VALUE, --maximum_coverage VALUE Maximum coverage on the x-axis. Use 0 for automatic scaling. 0
-dps VALUE, --maximum_score VALUE Maximum score on the y-axis. Use 0 for automatic scaling. 0
-dpt TITLE, --dp_graph_title TITLE Dot-plot graph title. Empty

Statistics settings

Option Description Default
-sp Y/N, --statplot Y/N Generate a statistics panel. Y
-tsk TASKS, --tasks TASKS Statistical tasks, such as gc, gcs, and mge. gc,gcs
-std MODE, --strand MODE Exclude the leading or lagging strand, or use off to disable strand exclusion. off
-spt TITLE, --sp_graph_title TITLE Statistical-panel graph title. Empty

Contact

For further information, refer to the project documentation or contact:

Oleg Reva
University of Pretoria
Email: oleg.reva@up.ac.za Library / README.md

SWMM — SeqWord Motif Mapper

SWMM (SeqWord Motif Mapper) is a Python program for visualizing and statistically evaluating the distribution of epigenetically modified nucleotides and motifs in bacterial genomes and metagenomic contigs.

SWMM provides two main workflows:

  • sort-contigs — sorts previously binned metagenomic contigs according to their methylation-motif patterns.
  • methylation-pattern — visualizes genome methylation patterns and evaluates the distribution of epigenetically modified bases.

Contents

General usage

Display the main help message:

python3 swmm.py --help
usage: swmm.py [-h] [-v]
Option Description
-h, --help Show the help message and exit.
-v, --version Show the program version and exit.

Sort contigs

The sort-contigs command sorts binned contigs based on patterns of methylated motifs.

Help

python3 swmm.py sort-contigs --help

Usage

usage: sort_contigs.py [-h]
                       [-i INPUT_FOLDER]
                       [-o OUTPUT_FOLDER]
                       [-p PROJECT_FOLDER]
                       [-g GFF_FILE]
                       [-m MOTIFS]
                       [--output_graph_format {SVG,HTML,PDF,EPS,JPG,JPEG,TIF,TIFF,PNG,BMP}]
                       [-u {keep,split}]
                       [--filter_chimeric_contigs FILTER_CHIMERIC_CONTIGS]
                       [-c {Y,y,N,n}]
                       [--dpi DPI]
                       [--mqs MQS]
                       [-l SLIDING_WINDOW_LENGTH]
                       [-w SLIDING_WINDOW_STEP]
                       [--file_name_separator FILE_NAME_SEPARATOR]
                       [-s {Y,N,y,n}]

Arguments

Option Description Default
-h, --help Show the help message and exit.
-i INPUT_FOLDER, --input_folder INPUT_FOLDER Input folder. input
-o OUTPUT_FOLDER, --output_folder OUTPUT_FOLDER Output folder. output
-p PROJECT_FOLDER, --project_folder PROJECT_FOLDER Project folder. Current directory
-g GFF_FILE, --gff_file GFF_FILE GFF file containing epigenetic predictions. If omitted, the program searches for bin-specific GFF files. Empty
-m MOTIFS, --motifs MOTIFS Semicolon-separated motif definitions, for example GATC,2,-2; CCWGG,2,-2.
--output_graph_format FORMAT Output format: SVG, HTML, PDF, EPS, JPG, JPEG, TIF, TIFF, PNG, or BMP. SVG
-u {keep,split}, --unresolved_contigs {keep,split} Keep or split unresolved contigs with statistically insignificant methylation patterns. keep
--filter_chimeric_contigs VALUE Filter contigs with a non-random distribution of modified sites. Accepts Yes, No, or a p-value satisfying 0 < p <= 0.05. No
-c {Y,y,N,n}, --circular_graph {Y,y,N,n} Produce a circular graph. Y
--dpi DPI Output image resolution in dots per inch. 600
--mqs MQS Minimum methylation quality score. 20
-l LENGTH, --sliding_window_length LENGTH Sliding-window length. 2000
-w STEP, --sliding_window_step STEP Sliding-window step. 500
--file_name_separator SEPARATOR Separator used to select the basename as the first part of a filename. Empty
-s {Y,N,y,n}, --save_graphs {Y,N,y,n} Save generated graphs. Y

Methylation pattern

The methylation-pattern command processes GFF files generated by ipdSummary, produces graphical representations, and performs statistical analysis of the distribution of epigenetically modified bases.

Help

python3 swmm.py methylation-pattern --help

General usage

python run.py [arguments]
python run.py -h
python run.py --help
python run.py -v
python run.py --version

Example

python program.py \
    -i input.gff \
    -g genome.gbk \
    -d example \
    -mm Y \
    -w GATC,2,-2 \
    -p 100 \
    -sp Y

This example:

  1. Reads input.gff and genome.gbk from ./input/example.
  2. Writes graphical and text output to ./output/example.
  3. Searches for the motif GATC,2,-2.
  4. Treats the second nucleotide from the left on the direct strand and the second nucleotide from the right on the reverse-complement strand as modified positions.
  5. Sets the promoter length to 100 bp.
  6. Enables circular-map visualization and motif-distribution statistics.

General settings

Option Description Default
-d FOLDER, --project_directory FOLDER Project subfolder. Empty
-i FILE, --input_GFF FILE Input GFF filename. Required. Empty
-g FILE, --input_GBK FILE Input GenBank filename. Required. Empty
-m FILE, --filter_file FILE File defining regions to filter. Empty
-ft NAME, --generic_file_name NAME Generic output filename. Empty
-ogf FORMAT, --output_graph_format FORMAT Output format: SVG, HTML, PDF, EPS, JPG, JPEG, TIF, TIFF, PNG, or BMP. HTML
-dpi DPI, --dpi DPI Raster-image resolution from 100 to 1200 dpi. 300
-p LENGTH, --promoter_length LENGTH Promoter-region length. 75
-r NUMBER, --maximum_sites NUMBER Maximum number of sites to verify. Use 0 to skip checking. 10000
-n NUMBER, --blast_context_mismatch NUMBER Allowed number of context mismatches. 2
-z Yes/No, --blast_motif_mismatch Yes/No Allow motif mismatches. Yes
-u FOLDER, --input_folder FOLDER Input folder. input
-o FOLDER, --output_folder FOLDER Output folder. output
-x FOLDER Executable folder. ./lib/bin
-tmp FOLDER Temporary folder. ./lib/bin/tmp

Circular-map settings

Option Description Default
-mm Y/N, --circular_map Y/N Generate a circular plot. Y
-w MOTIF, --cmap_motif MOTIF Motif definition, for example GATC,2,-2.
-s MODE, --sites_or_motifs MODE Search for sites or motifs. Accepted values include sites, motifs, S, and M. sites
-f M/U, --modified_or_unmodified M/U Display modified or unmodified motifs. M
-wl LENGTH, --window_length LENGTH Sliding-window length. 8000
-ws STEP, --window_step STEP Sliding-window step. 2000
-c SCORE, --cmap_score_cutoff SCORE Circular-plot score cutoff. 21
-cmt TITLE, --cmap_graph_title TITLE Circular-map graph title. Empty

Dot-plot settings

Option Description Default
-dp Y/N, --dotplot Y/N Generate a dot plot. N
-dpn BASES, --nucleotides BASES Nucleotides to display: A, C, G, T, or an empty value. A,C
-dpm TYPES, --methylation_types TYPES Methylation types to display, such as m6A or m4C. Empty
-dpf MOTIFS, --dotplot_motifs MOTIFS Motifs to include or exclude, for example GATC,2,-2; -CRGKGATC,1,6,-2.
-dpc SCORE, --dotplot_score_cutoff SCORE Dot-plot score cutoff. 21
-dpw VALUE, --maximum_coverage VALUE Maximum coverage on the x-axis. Use 0 for automatic scaling. 0
-dps VALUE, --maximum_score VALUE Maximum score on the y-axis. Use 0 for automatic scaling. 0
-dpt TITLE, --dp_graph_title TITLE Dot-plot graph title. Empty

Statistics settings

Option Description Default
-sp Y/N, --statplot Y/N Generate a statistics panel. Y
-tsk TASKS, --tasks TASKS Statistical tasks, such as gc, gcs, and mge. gc,gcs
-std MODE, --strand MODE Exclude the leading or lagging strand, or use off to disable strand exclusion. off
-spt TITLE, --sp_graph_title TITLE Statistical-panel graph title. Empty

Contact

For further information, refer to the project documentation or contact:

Oleg Reva
University of Pretoria
Email: oleg.reva@up.ac.za

About

SWMM (SeqWord Motif Mapper) is a Python program for visualizing and statistically evaluating the distribution of epigenetically modified nucleotides and motifs in bacterial genomes and metagenomic contigs.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages