Plot mutations either by comparing two sequences or by comparing a bunch of sequences to another sequence.

This command is still under a bit of development so bare with the nuances


You can view the usage of degen_regions via:

plot_muts --help

Example comparing multiple sequences against a query sequence

--refs is a fasta file containing multiple sequences where the sequence that has the earliest date will be used as the base reference.

--query is a fasta file containing a single sequence to be plotted in a different color to see how it compares.

plot_muts --refs tests/testinput/refs.fas --query tests/testinput/query.fas --out plot.png

The --out option is optional. If it is not provided, the plot will pop up on the user’s screen automatically. If this does not work, try saving the image using --out instead.

Example Output


Plot muts also outputs a csv file named after the --out with .csv appended


Input File Requirements

The input must be fasta format. Both the query and ref files can have any number of sequences.

The year should be the last part of the ID, preceded by a quadruple underscore. e.g.:


If the ID uses ‘/’ rather than underscore, plot_muts currently accepts the year as the fourth field. e.g.:


Example using cluster method to use two references as x and y axis

This is useful when you only have two references and no dates as all the sequences will be compared against these two sequences to give you a ‘clustered’ view

--refs is a fasta file that contains two references. The first being the x-axis and the second representing the y-axis --queries is a fasta file that contains multiple sequences that will be plotted against the --refs sequences

plot_muts --query tests/testinput/ha/refall.ha.fasta --refs tests/testinput/ha/refall.ha.fasta --cluster --out cluster.png

Example Output


Generating html graphics that are interactive

For both --cluster and non-cluster graphics you can optionally supply --html which will utilize the bokeh python project to build an interactive html output that you can open in your web browser.