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.
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.
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.
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.