New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ATG/Methionin in RefSeq not displayed #858

Closed
Rhinogradentia opened this Issue Mar 1, 2017 · 14 comments

Comments

Projects
None yet
4 participants
@Rhinogradentia

Rhinogradentia commented Mar 1, 2017

Hi there,

I've stumbled upon a display "problem". Normally ATGs/Methionins in the RefSeq are displayed/marked from a certain zoom level on. But I have one case where a certain ATG isn't displayed/colored unless you zoom in to the next-to-last zoom-level. All others are colored all the time.

greater_zoom
smaller_zoom

You can try it here:
http://pichiagenome-ext.boku.ac.at/jbrowse/pichia/?data=data%2Fcbs7435&loc=cbs7435_chr1%3A1872565..1872707&tracks=DNA%2Ccbs7435_gene_2%2Ccbs7435_mRNA&highlight=

Maybe this is something easy to fix...
Thanks

By
Nadine

@cmdcolin

This comment has been minimized.

Contributor

cmdcolin commented Mar 1, 2017

I think it goes back to this issue #435

That was basically the first patch I ever contributed to JBrowse >_<

Here is a fix that I think helps, instead of modifying the "sequence", which truncates the seq and makes it so the M falls out of view (when it is on the block boundary as in your screenshots) it just corrects "which frame" to render into

diff --git a/src/JBrowse/View/Track/Sequence.js b/src/JBrowse/View/Track/Sequence.js
index b3f7360..24de6b5 100644
--- a/src/JBrowse/View/Track/Sequence.js
+++ b/src/JBrowse/View/Track/Sequence.js
@@ -132,7 +132,8 @@ return declare( [BlockBased, ExportMixin, CodonTable],
 
         var extStart = blockStart-2;
         var extEnd = blockStart+2;
-        var extStartSeq = seq.substring( 0, seq.length - 2 - ((seq.length-2)%3) );// align frames across blocks by forcing mod3
+        var leftover = (seq.length - 2) % 3;
+        var extStartSeq = seq.substring( 0, seq.length - 2 );
         var extEndSeq = seq.substring( 2 );
 
         if( this.config.showForwardStrand && this.config.showTranslation ) {
@@ -174,7 +175,7 @@ return declare( [BlockBased, ExportMixin, CodonTable],
                 var frameDiv = [];
                 for(var i = 0; i < 3; i++) {
                     var transStart = blockStart + 1 - i;
-                    var frame = (transStart % 3 + 3) % 3;
+                    var frame = (transStart % 3 + 3 + leftover) % 3;
                     var translatedDiv = this._renderTranslation( extStartSeq, i, blockStart, blockEnd, blockLength, scale, true );
                     frameDiv[frame] = translatedDiv;
                     domClass.add( translatedDiv, "frame" + frame );
@Rhinogradentia

This comment has been minimized.

Rhinogradentia commented Mar 2, 2017

Thank you - I will try it

Best Regards,
Nadine

@Rhinogradentia

This comment has been minimized.

Rhinogradentia commented Mar 2, 2017

Hi Colin,
I've replaced/added the lines you've mentioned above and even rerun setup.sh. Unfortunately this didn't solve it.
By the way I forgot to mention before that I have JBrowse 1.12.1 and 1.12.0 running currently on my development machine and I've tried it with both. What did you ment when you wrote "modifying the sequence"? Is there something wrong with the reference sequence there?
Best
Nadine

@cmdcolin

This comment has been minimized.

Contributor

cmdcolin commented Mar 2, 2017

You're welcome to test it! Ideally the fix it can go into a release too. To test it, you may need to get a "development setup" to see the effects of making a code change. see http://gmod.org/wiki/JBrowse_FAQ#What_is_the_difference_between_JBrowse-1.12.1.zip_and_JBrowse-1.12.1-dev.zip.3F

just in case it wasn't clear in my comment, the lines that have a '+' means lines of code added and '-' means lines of code removed

also, the comment about modifying the sequence was a technical detail about why it happened, not anything specific to your data (this can be seen on volvox sample data too).

@Rhinogradentia

This comment has been minimized.

Rhinogradentia commented Mar 6, 2017

Thank you again.
I've cloned the sources from githup and included your fix there. This made it somehow better, but I think there is still one thing not quite right. The beforementioned ATG ist displayed now in a lesser zoom level, but until one zooms in almost completely it is located in the wrong reading frame, then it switches to the correct frame. Additionally the other ATGs and Stop-Codons seem to have slipped into another reading frame as well....
I hope my explanation is not that confusing - I attached 2 screenshots again:
auswahl_043

auswahl_042

@cmdcolin

This comment has been minimized.

Contributor

cmdcolin commented Mar 6, 2017

That is interesting (as it is same problem as #435) but it's not something I saw after applying my patch.

Can you confirm that you applied the patch correctly? For example, if you have the github clone, you could try looking at the "fix_sequence_zoom_out" branch (git checkout origin/fix_sequence_zoom_out)

Same branch as shown here #859

@Rhinogradentia

This comment has been minimized.

Rhinogradentia commented Mar 9, 2017

Hi, sorry for the late reply.
Yes, I can confirm I've applied the patch correctly. I removed the lines marked with "-" and added the lines marked with "+".

auswahl_044
left the clone from #859, right "my" source.

auswahl_045
on top the clone from #859, bottom "my" source.

What I see is that in the second picture there is a difference. I removed the line
var frame = (transStart % 3 + 3) % 3; and replaced it by var frame = (transStart % 3 + 3 + leftover) % 3; as you mentioned in your first answer, but this change can't be found in the clone of #859

I've tried this combination out, but it changed nothing.

@cmdcolin

This comment has been minimized.

Contributor

cmdcolin commented Mar 9, 2017

thanks for the detailed report. I guess the only other thing I could recommend is clearing cache to ensure that your changes are applied

if it is still a problem it might be good to get test data on this case

I thought maybe a good approach would be to add unit testing for this so I started adding jasmine tests on #859 but using my test cases, they pass, so need to find a failing test case in order to fix any further.

@Rhinogradentia

This comment has been minimized.

Rhinogradentia commented Mar 14, 2017

I emptied the cache and it has still not changed.

Can I provide you more information to solve this?

@cmdcolin

This comment has been minimized.

Contributor

cmdcolin commented Mar 14, 2017

Sure! if you have a public instance of jbrowse with link to region where it occurs that would be fine (if not public instance, maybe look on the volvox sample data to find region where it occurs)

@Rhinogradentia

This comment has been minimized.

Rhinogradentia commented Apr 6, 2017

I have a public instance running, but it is not the "corrected" development version.
You can access it here:
http://pichiagenome-ext.boku.ac.at/jbrowse/pichia/?data=data%2Fcbs7435&loc=cbs7435_chr1%3A1775796..1779244&tracks=DNA%2Ccbs7435_gene_2&highlight=

And the affected feature is: PP7435_Chr1-1036

@cmdcolin

This comment has been minimized.

Contributor

cmdcolin commented Apr 7, 2017

If I download the sequence data from your remote web server, then I can view it locally with the patched genome browser (#859 changes)

The command to get sequence dir just for completeness sake "wget -r -k -np -p http://pichiagenome-ext.boku.ac.at/jbrowse/pichia/data/cbs7435/seq/"

And, with the patched genome browser, I see it as fixed now!

@Rhinogradentia

This comment has been minimized.

Rhinogradentia commented Apr 7, 2017

Thank you for trying. I will have a look again, what I have might done wrong. To this point I thought I did everything as you've mentioned.
I will come back next week and maybe I can tell more.

@cmdcolin

This comment has been minimized.

Contributor

cmdcolin commented Apr 28, 2017

I'm pretty certain that the #859 solves it. If anyone wants to check it out and verify that might be I didn't mean to leave burden on your @Rhinogradentia

cc @enuggetry @nathandunn @erasche

@rbuels rbuels added the bug label Jan 30, 2018

@rbuels rbuels added this to the 1.12.4 milestone Jan 30, 2018

@rbuels rbuels closed this in #859 Jan 30, 2018

@wafflebot wafflebot bot removed the in progress label Jan 30, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment