Closed manulera closed 2 months ago
Hi @manulera you can set forward: true,
for a feature/part and have it display in the forward orientation. That should fix this for you. I'll add an example to the SimpleCircularOrLinearView
demo
Hi @tnrich, thanks that makes it work for me as well.
However, why is this needed only for SimpleCircularOrLinearView
? When I use createVectorEditor
, setting strand
in the features is enough for them to render in the right orientation. Also, when reading a file from genbank format, this forward
attribute does not seem to be set either, perhaps something to do with the feature parser then?
Hi @manulera probably because the createVectorEditor
runs the sequenceData
through the tidyUpSequenceData
function whereas the SimpleCircularOrLinearView
does not do that..? Perhaps we should investigate running the sequenceData
passed to the SimpleCircularOrLinearView
thru the same tidyUpSequenceData
function?
Hi @tnrich, yes that worked, thank you! Do you think tidyUpSequenceData
should be called by convertToTeselaJson
by default before returning the result?
Also, now the sequences look so much better! Is there some docs on the difference between the input and output?
Before
After
@manulera where is the convertToTeselaJson
function you're asking about?
I'm not sold on adding the tidyUpSequenceData step directly to SimpleCircularOrLinear view since I don't want that conversion to be run more than is necessary.
Hi @tnrich, I have made a minimal example that you can test in https://ove-playground.netlify.app/
Essentially, using the bottoms at the top, you can:
genbankToJson
, and the sequence is displayed both SimpleCircularOrLinearView
and using createVectorEditor
.tidyUpSequenceData
is applied or not to the sequence read from the genbank string.All this is in this very short component.
As you can see, when reading a sequence using genbankToJson
:
creteVectorEditor
, it does not matter if you call tidyUpSequenceData
, the strand of the feature is displayed correctly in both cases.SimpleCircularOrLinearView
, you have to call tidyUpSequenceData
for the strand of the feature to be displayed properly.Should I be using another function that runs this post-processing instead of genbankToJson
?
@manulera thanks for catching this. I've updated the genbankToJson to output the .forward property as well. Let me know if the latest release fixes this for you.
Hi @tnrich I updated to the last version of bio-parsers, and as you can see the problem persists (I still have to call tidyUpSequenceData
) when using SimpleCircularOrLinearView
.
See the demo app here: https://ove-playground.netlify.app/
Also, as mentioned above the features are still displayed differently in the UI when you call or not call tidyUp
@manulera seems to work for me off the master branch - https://github.com/TeselaGen/tg-oss/compare/tnwTestEdComparison
I see, that works for me as well, I was just changing strand
in my code when the button was clicked, and I had to change forward
as well. I have changed that in the playground example and now it reverts the feature in the display. Sorry about that.
However, the displayed sequence still looks much better if using tidyUpSequenceData
in the SimpleCircularOrLinearView
, but in the main editor it always looks well. Should this be the case?
With tidyUp
Without tidyUp. All features are shown in purple regardless of type in circular, and names overlap in both linear and circular
You can test again here: https://ove-playground.netlify.app/
Just run tidyUpSeq yourself before passing stuff to SimpleCircLinView ?
I unfortunately don't think it is the best idea to add that fn directly to SimpleCircLinView for fear of running it more than necessary
Alright, will do that!
Thanks! Appreciate all the work you're doing!
Hi @tnrich, I noticed that the
SimpleCircularOrLinearView
editors always display the feature as if it was in the reverse strand, regardless of thefeature.strand
attribute.You can check this in this repo
Also, I made a video of it. An app that changes the strand of the feature, and you can see the main editor changes, but not the
SimpleCircularOrLinearView
.Happy to provide a fix via PR if you point me somewhere.
https://github.com/TeselaGen/tg-oss/assets/22526102/3f604f06-ce40-4b8e-bc62-e3d62325ba22