Question: Plotting "sequence alignments" in python (matplotlib)?
gravatar for knpayne2
4.4 years ago by
knpayne20 wrote:

Hi all,

My boss has given me a task to do the following:

1. Take fasta files, parse them using biopython

2. Take the corresponding sequences and take the part of each sequence

that is between two restriction sites (KpnI and BamHI).

3. Then, I am to plot the sequences together on one plot, sorted by length, and highlight the bases that correspond 

to a certain kind of amino acid sequence that these code for. 


The end result is supposed to look like a pretty version of: (the parts in brackets are supposed to be the highlighted bases)

Seq 1 | ATCGGATC .... [ATCG .. ] ...

Seq 2 | ACCATC ... [ some more highlighted bases, not necessarily in the same position, or with the same length] ...


Seq p | Some more bases.


My boss would like this to be put together with python, preferably with matplotlib. I am a lowly statistician by training, and could probably crack something like this off in R, but am not as familiar with matplotlib.

By trying to look at some examples, I imagine I could try something like this plot,

but I'm unsure how to get started. Is there anyone that has come across a similar problem?


sequencing matplotlib python gene • 2.3k views
ADD COMMENTlink modified 4.4 years ago • written 4.4 years ago by knpayne20

a. If your boss has given you a task, you should try something yourself before asking for help.

b. If you're asking for help, you should give us a lot more details, including the steps you've taken to solve the problem, so we know you're not taking a shortcut.

ADD REPLYlink written 4.4 years ago by RamRS24k

hahaha, sorry I hit enter too quickly. 


ADD REPLYlink written 4.4 years ago by knpayne20
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1301 users visited in the last hour