parasail-python
parasail-python copied to clipboard
How to use the traceback for alignment visualization?
Is it possible to visualize the output of a traceback alignment as seen in C version? See below:
For reference I'm running this alignment:
result = parasail.sw_trace(seq1, seq2, 5, 1, parasail.blosum62)
What can I do with result.traceback to visualize the alignment?
The C function prints to stdout and that didn't seem correct to me to do from python. You weren't getting a python string back to manipulate on your own, or what if you wanted to print that output to something other than the console?
The result.traceback attribute has the properties query, comp, and ref. That should correspond to the 3 character sequences in your sample above. But of course these aren't formatted like that. I agree it would be nice to have similar output like that from python, but written in pure python using the 3 traceback character sequences and outputting to a user-specified output buffer, defaulting to sys.stdout. I would accept a PR. I don't have a ton of time to work on this these days, but I'll keep this issue as a feature request.