A Python package to visualize multiple sequence alignment (MSA). MASplot is inspired by the package pyMSAviz and ggmsa. The major feature of MSAplot is customizable panels for plotting MSA, seqlogo, annotation, and consensus histogram.
- Clone the GitHub repo, e.g. with
git clone https://github.com/mourisl/msaplot
. - Copy "msaplot" folder to your project folder or run "python3 setup.py install" to install.
I will try to add msaplot to PyPi in future.
Here is a minimal example:
import matplotlib.pyplot as plt
from msaplot import msaplot
msaplot.DrawComplexMSA(msa=["AC-GAT", "A-CGT-"],
panels=[msaplot.DrawSeqLogo, msaplot.DrawMSA, msaplot.DrawConsensusHisto])
There are four drawinging functions that can be used in the panels option:
- DrawMSA: visualize multiple sequence alignment
- DrawSeqLogo: represent the seqlogo of the alignment
- DrawConsensusHisto: represent the fraction of the consensus character for each position
- DrawAnnotation: need to take a list to specify the name for each annotated region and region coordinate.
See more examples in example.ipynb.
- Python >= 3.6
- seaborn >= 0.9
- matplotlib >= 2.2.2