You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Q. Inquiry for the Alignment Render in the BioJava. #983
I am software developer (new to biojava) currently using the Biojava API [biojava-core - 4.0.0 , alignment -1.9.3] for an application.
We are trying to accomplish Alignment render of the Query and the target
on Blast search like the image below. We are using the SmithWaterman algorithm for local Alignment. Now we are looking for a different way to visualize exactly where the sequence was aligned in our frontend application (we are using biojava in our backend side), like the following.
AAGAA
||| |
AAGGA
I found SimpleAlignment to render query and target alignment using TranslatedSequencePanel. but SimpleAlignment does not handle different length sequences and does not contain any gap-editing concepts. Upon further research I also came across formatOut which return string with the format we were looking for. But formatOut is only available in biojava-legacy. Is there any way i can get the result like this one?
I looked into couple of thing you mention @willishf , I believe they are the AWT or Swing based component that render the alignment. I was really looking for the class that can return the alignments as the "Text" so that i can return it to the frontend application( of different stack) via API call and render their instead. Thanks
Hello @RoshanShrestha123 You are welcome to extract the text based rendering and share it to (current) BioJava.
Alternatively, you may request it to be ported to BioJava and provide the ability to expose the text alignment. But the drawback of this approach is that you will have to wait until of the developers have time to do it for you.
I may have time in December if you want.
@RoshanShrestha123 Take a look at SimpleProfile.toString(StringFormat). In particular, maybe the PDBWEB format would work for you. It outputs an HTML DIV like
seq 2 ERNDKK 7
||||
seq 1 ER-DNK 5
Legend:Green - identical residues | Pink - similar residues | Blue - sequence mismatch | Brown - insertion/deletion |
(legend included, and some css has to be defined appropriately to enable colors).
If you really want to match the text output above, this can either be implemented as a new Profile.StringFormat (easy but needs a BioJava PR) or you can do it in app code.
I started working on this, thinking it would be an easy fix. However there are some things I need to clarify about how the StringFormat methods are intended to work (see separate issue). There are some commits in sbliven/biojava-sbliven/fix983 which will need to be ammended and rebased. However ProfileFormatTest.java has a method for printing the desired format in BioJava 6.0.
Activity
willishf commentedon Oct 20, 2021
RoshanShrestha123 commentedon Oct 21, 2021
Thank you @willishf , 🎉
I will look into the link you shared.
RoshanShrestha123 commentedon Oct 22, 2021
I looked into couple of thing you mention @willishf , I believe they are the AWT or Swing based component that render the alignment. I was really looking for the class that can return the alignments as the "Text" so that i can return it to the frontend application( of different stack) via API call and render their instead. Thanks
aalhossary commentedon Oct 22, 2021
Hello @RoshanShrestha123 You are welcome to extract the text based rendering and share it to (current) BioJava.
Alternatively, you may request it to be ported to BioJava and provide the ability to expose the text alignment. But the drawback of this approach is that you will have to wait until of the developers have time to do it for you.
I may have time in December if you want.
sbliven commentedon Jan 4, 2022
@RoshanShrestha123 Take a look at
SimpleProfile.toString(StringFormat). In particular, maybe the PDBWEB format would work for you. It outputs an HTML DIV like(legend included, and some css has to be defined appropriately to enable colors).
If you really want to match the text output above, this can either be implemented as a new Profile.StringFormat (easy but needs a BioJava PR) or you can do it in app code.
Temporary commit. Needs to be amended!
sbliven commentedon Jan 27, 2022
I started working on this, thinking it would be an easy fix. However there are some things I need to clarify about how the StringFormat methods are intended to work (see separate issue). There are some commits in sbliven/biojava-sbliven/fix983 which will need to be ammended and rebased. However ProfileFormatTest.java has a method for printing the desired format in BioJava 6.0.