Python3 wrapper for running MUMmer and parsing the output.
###Pre-requisites###
The MUMmer package must be installed. Instructions to install MUMmer can be found here
###Installation###
Install with
pip3 install pymummer
Example showing how pymummer can be used to run nucmer on a fasta file and parse the output file to produce a set of alignment objects:
from pymummer import coords_file, alignment, nucmer
...
runner = nucmer.Runner(reference_file, query_file, results_file)
runner.run()
file_reader = coords_file.reader(results_file)
alignments = [coord for coord in file_reader if not coord.is_self_hit()] #Remove self hits
...
###pymummer nucmer class###
Wraps the nucmer
, delta-filter
, show-coords
and show-snps
commands.
Arguments:
ref reference file
query query file
outfile output file
min_id min_id for delta-filter command (default None)
min_length min_length for delta-filter command (default None)
breaklen breaklen for nucmer command (nucmer's default is 200)
coords_header print header in show-coords output (default True)
maxmatch maxmatch for nucmer (default False)
show_snps run show-snps (default False)
snps_header print header in show-snps output (default True)
###pymummer promer class###
[TODO]
###pymummer coords_file class###
Parses the nucmer output and populate an alignment object for each hit in the output
###pymummer alignment class###
Check attributes of a hit, swap the reference and query, check if it's a self hit and so on
Authors: Martin Hunt, Nishadi De Silva
Affiliation: Wellcome Trust Sanger Institute, Hinxton, UK
Email: path-help@sanger.ac.uk