Marvelous Misadventures in Bioinformatics

A blog on some snippets of my work in bioinformatics. Hopefully you find something useful here and avoid stupid mistakes I made.

View My GitHub Profile

Plotting MSA

Pymsaviz is a great local and offline multiple sequence alignment (MSA) viewer and plotter alternative to the NCBI online MSA viewer. No frills, easy to install and use and is fantastic for creating publication-grade figures.

I will be using this example to visulise the alignment.

Prerequisite

Installation

pip install pygenomeviz

or

conda install -c conda-forge -c bioconda pymsaviz

Usage

  1. Import package
     from pymsaviz import MsaViz
    
  2. Assuming you have run a MSA with an output file called msa.out.fa in the same directory
     msa_file = "./msa.out.fa"
    
  3. Create the MSA object.
     mv = MsaViz(msa_file, wrap_length=60, show_count=True)
    
  4. Plot and Save.
     mv.savefig("./msa_plot.png")
    

You should see an output like this. (excerpt) MSA plot

back