fix: make -m/–mode a required argument (#34)
When no -m flag is provided, args.mode is None (since action=’append’ defaults to None). This causes a TypeError in print_summary() which iterates over args.mode.
Mark the argument as required=True so argparse emits a clear usage error instead of crashing with an unhelpful traceback. Also remove “[default]” from the help text for mode 0 since there is no longer a default.
Fixes #32
Co-authored-by: themavik themavik@users.noreply.github.com Co-authored-by: Cursor cursoragent@cursor.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
FlexiDot: Highly customizable, ambiguity-aware dotplots for visual sequence analyses
FlexiDot is a cross-platform dotplot suite generating high quality self, pairwise and all-against-all visualizations of transposons and other discrete sequences.
To improve dotplot suitability for comparison of consensus and error-prone sequences, FlexiDot supports strict (k-mer based) and relaxed handling of mismatches and ambiguous residues, as well as plotting of pre-computed alignments (i.e. from BLAST or Nucmer).
The custom shading modules facilitate dotplot interpretation and feature identification by adding information on feature annotations and sequence similarities to the images.
Combined with collage-like outputs, FlexiDot supports simultaneous visual screening of large sequence sets, allowing dotplot use in routine screening workflows.
Citation
If you use FlexiDot in your research, please cite us:
Kathrin M. Seibt, Thomas Schmidt, and Tony Heitkam (2018) “FlexiDot: Highly customizable, ambiguity-aware dotplots for visual sequence analyses”. Bioinformatics 34 (20), 3575–3577, doi: 10.1093/bioinformatics/bty395 - Read article
FlexiDot versions and updates
Current version (Jan 2026): FlexiDot v2.1.1
For an overview of FlexiDot version updates please see the code history.
Documentation
Implementation
FlexiDot is implemented in Python 3, with dependencies:
You can create a Conda environment with these dependencies using the YAML file in this repo.
After activating the flexidot environment you can use
pipto install the latest version of FlexiDot.Installing FlexiDot
Installation options:
Install from PyPI (recommended):
Install from bioconda:
pip install the latest development version directly from this repo.
Test installation.
Setup Development Environment
If you want to contribute to the project or run the latest development version, you can clone the repository and install the package in editable mode.
Use FlexiDot
Processing fasta files
FlexiDot accepts one or more uncompressed fasta files as input. The files can contain multiple sequences.
By default, FlexiDot will use shared k-mers between sequence pairs to generate the dot-plot.
Optional arguments are explained below and in detail with the
--helpoption.Importantly,
-kdefines the word size (e.g.-k 10) and-tspecifies the sequence type (-t nucfor DNA [default];-t aafor proteins). The plotting mode is chosen via-mand described below.Processing pre-computed alignments
FlexiDot can also process pre-calculated alignments from tools such as
blastnornucmer. This approach is often faster than k-mer indexing and is tolerant of gaps and mismatches.See pre-calculated alignment tutorial for detailed examples.
FlexiDot can process BLAST fmt 6 output or PAF alignment files.
Output:
When aligning sequences with
nucmerthe alignment.deltafile can be converted toPAFusingpaftools.jswhich comes bundled withMinimap2.Output:
Plotting modes
FlexiDot allows sequence investigation in three run modes via the option
-m/--mode:-m 0self sequence comparison-m 1pairwise sequence comparison-m 2all-to-all sequence comparisonTo run multiple plotting modes, call the option multiple times i.e.
-m 0 -m 1 -m 2.Self dotplots
with
-m/--mode 0In self dotplot mode, each sequence is compared with itself. The resulting dotplots can be combined to form a collage (with
--collage) or written to separate files.Pairwise comparisons
with
-m/--mode 1For pairwise dotplots, the collage output is recommended for larger numbers of sequences. The collage output of the 15 pairwise dotplots for the test sequences is shown below. By default, dotplot images are in square format (panel A). This maximizes the visibility of matches, if the compared sequences differ drastically in length. To enable scaling according to the respective sequence lengths, the FlexiDot scaling feature is callable via option
-L/--length_scaling(panel B). If scaling is enabled, a red line indicates the end of the shorter sequence in the collage output.Pairwise comparisons can be limited to only pairs that contain the first sequence in a fasta file using
--only_vs_first_seq.All-against-all comparisons
with
-m/--mode 2In all-against-all mode, FlexiDot compares each pair from a set of input sequences. To enable the identification of long shared subsequences at a glance, FlexiDot offers similarity shading (switched on/off via option
-x/--lcs_shading) based on the LCS length in all-against-all comparisons (see below).Major features
Mismatch and ambiguity handling
In diverged or distantly related sequences matches may be interrupted by mismatches, or residues might be represented as ambiguities to refer to frequent variants or mutations. Similarly, relaxed matching is helpful when analyzing error-prone sequences like SMRT reads. Relaxation of the matching conditions thus increases sensitivity, while decreasing specificity.
Firstly, FlexiDot handles ambiguous residues, often found in consensus sequences. This allows the comparison of species-specific representations of multigene or repeat families as well as common variants or sequence subfamilies. The ambiguity handling is controlled via
-w/--wobble_conversion.Secondly, a defined number of mismatches within the window can be allowed with
-S/--substitution_count [number of allowed mismatches (substitutions)]. This is even less stringent than the ambiguity handling. Please note, that only substitution mutations are allowed but not indels.Lastly, both mismatch and ambiguity handling can be combined for the analysis.
Annotation-based shading
Note: See also our tutorial on how to integrate annotation shadings with a real-life example.
In FlexiDot self dotplots, annotated sequence regions can be highlighted by shading to allow clear assignment of dotplot regions to specific sequence contexts (see Seq2 in self dotplots). The underlying annotation information must be provided in general feature format (gff3), either as individual file or file list via the
-g/--input_gff_filesoption. To customize GFF-based shading, a user-defined configuration file can be provided via the-G/--gff_color_config option. Example files are provided in the test-data directory. Please note, that a legend is generated in a separate file.If you wish to find out more on the gff3 file format used here, The Sequence Ontology overview.
[since FlexiDot_v1.03] Annotation-based shading also available for all-against-all dotplots
Previously only available for self dotplots, we added annotation-based shading to all-against-all dotplots, allowing for many new visualizations. As before, annotation information is provided as general feature file (GFF3). These features are added to the middle diagonal (see our example below).
Basic command:
Command plus aesthetics as shown here (+ LCS shading, wordsize 10, change of subplot spacing and line width):
The test files used here are provided:
Similarity shading
In all-against-all mode, FlexiDot compares each pair from a set of input sequences. To enable the identification of long shared subsequences at a glance, FlexiDot offers similarity shading (switched on/off via option
-x/--lcs_shading) based on the LCS length (longest common subsequence, or longest match if mismatches are considered) in all-against-all comparisons. Longer matches are represented by darker background shading. A separate shading legend output file is created written according to mathematical interval notation, where interval boundaries are represented by a pair of numbers. Consequently, the symbols “(” or “)” represent exclusion, whereas “[” or “]” represent inclusion of the respective number.FlexiDot similarity shading is highly customizable with the following parameters, explained in depth in the documentation:
-y/--lcs_shading_ref)-X/--lcs_shading_num)-z/--lcs_shading_ori)Shading examples based on sequence orientation (forward, panel A; reverse, panel B; both, panel C) are shown:
Custom matrix shading
When comparing related sequences, multiple sequence alignments are frequently applied. The resulting pairwise sequence similarities can be integrated in the FlexiDot images by providing a matrix file via
-u/--user_matrix_file <matrix.txt>. This allows a shading of the upper right triangle according to the matrix (here orange). With-U/--user_matrix_printthe matrix values can be printed into the respective fields. Besides, also text information can be provided in the matrix, but then shading is suppressed.In the example, LCS and matrix shading are combined to visualize the relationships between different members of a repeat family.
License
Software provided under GPL-3 license.
Star History