Convert Fasta To Nicely Formatted Html
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.
• 3,952 views
•
link
1 answer
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
• 114 views
•
link
Log in to answer this question.
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.