Convert Fasta To Nicely Formatted Html
1
0
Entering edit mode
11.0 years ago
dimkal ▴ 730

Hi everyone, does anybody aware of a simple script (preferably python) that would convert a fasta file (with one protein sequence) to a an HTML code? For example if the sequence is 340 residues long, the script would do the wrapping every 50 residues(or as many as requested), then perhaps color some amino acids according to their properties, etc...

Edit: expanding on this a bit.

fasta sequence • 3.3k views
ADD COMMENT
4
Entering edit mode

What do you mean by HTML code? Do you know HTML? What exactly are you trying to obtain as a result? An html document? A piece of html to add to an html document? Is it the formatting (colour, font type) that you want to be special? Try to be specific please.

ADD REPLY
3
Entering edit mode

Agree with Eric, "a HTML code" does not make sense.

If, as suggested in the title, you want to format the sequence for a web page, can I suggest wrapping it in PRE tags.

ADD REPLY
1
Entering edit mode

Don't forget to escape the '>' to > and check the rest of the contents of the header line to determine if they should also be converted into HTML entities.

ADD REPLY
1
Entering edit mode
11.0 years ago
jackuser1979 ▴ 890

If I am correct, I think your are looking for conversion of plain text to html format. Take a look at this: https://github.com/trentm/python-markdown2

ADD COMMENT

Login before adding your answer.

Traffic: 2364 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6