mummer_alignment()
Align neighbouring clusters with MUMmer, for links between them.
Each cluster is a file in path named after it: <cluster>.fasta, or a GenBank file (.gbk, .gb) that is written to FASTA first. Clusters are aligned in order, each with the next. Needs MUMmer (nucmer or promer, delta-filter and show-coords) in the PATH.
The files are copied into a new folder in output_dir, where MUMmer writes its files; with remove_files the folder is removed after. Files already in path or output_dir are never changed.
Usage
from geneviewer import mummer_alignment
mummer_alignment(
path,
cluster=None,
maptype='many-to-many',
seqtype='protein',
mummer_options='',
filter_options='',
remove_files=True,
output_dir=tempfile.gettempdir(),
)Arguments
| Argument | Type | Description |
|---|---|---|
path | path | The folder of sequence files. Its path may have spaces; the names of the files may not. |
cluster | list of str, optional | The clusters, in order. Default: every file, by name. |
maptype | str | "many-to-many" (default) or "one-to-one". |
seqtype | str | "protein" (default, promer) or "nucleotide" (nucmer). |
mummer_options | str | More options for nucmer/promer. |
filter_options | str | More options for delta-filter. |
remove_files | bool | Whether to remove MUMmer's files afterwards. Default True. |
output_dir | path | Where the working folder goes, without spaces in its path (MUMmer cannot use it otherwise). Default: the temporary folder. |
Value
pandas.DataFrame or None: One row per alignment: start1, end1, start2, end2, length1, length2, identity (and for protein similarity, stop, frame1, frame2), tag1, tag2, cluster1 and cluster2. A pair without alignments gives no rows; when no pair has any, the table is empty, without the cluster columns (as R). A pair that fails gives a warning and no rows; None when every pair fails.
