twsaari / FeatureSequence

JBrowse plugin to view the sequence of features
GNU General Public License v3.0
7 stars 3 forks source link

Only blank dialog with a hello sentence #1

Closed billzt closed 8 years ago

billzt commented 8 years ago

When I install the plugin, edit the track JSON file, and open the menu, I only get a blank dialog with a hello sentence.

a

twsaari commented 8 years ago

Hmm. It's tough to say what's going on just based on that information. First thing I would do is make sure you have the most recent version.

Then, could you kindly open up a console (probably ctrl+shift+i in your internet browser), try to use the plugin again with that open, and respond with a screenshot of the output of the console (or just copy the text)?

Even better would be if you have a live instance at a URL you can point me to for troubleshooting.

Thanks for the feedback. The plugin is still very new, and has only been tested on a few machines, so there are many possibilities. screenshot from 2016-03-25 18 06 51

billzt commented 8 years ago

Yeah, after I check to console, I see an error:

store 'refseqs' not found

I load my reference sequences by the newest "IndexedFasta" store, not the traditional store. (As the IndexedFasta store generates much less files and makes it much more easier to backup JBrowse data directory)

{
        "urlTemplateFAI": "seq/genome.fa.fai",
        "storeClass": "JBrowse/Store/Sequence/IndexedFasta",
        "urlTemplate": "seq/genome.fa",
        "category": "Reference sequence",
        "type": "SequenceTrack",
        "label": "DNA",
        "key": "Reference sequence"
},
twsaari commented 8 years ago

Aha. I was not aware of the IndexedFasta store; I will have to check that out. I imagine that it would be accessed similarly to the refseqs store. If so, it would be fairly easy to patch.

twsaari commented 8 years ago

So I did a little bit of digging, and it appears that the store name for the indexed fasta track is not given a fixed name such as 'refseqs' when it is created, but rather a name like 'store160129410235'. This makes it a bit tricky to fix, since every user's reference track store name will be different. I've created a new branch for this issue, but it is a very rough patch. It requires you to investigate some objects in the console, and then go in and modify the FeatureSequence/js/main.js file with the name that you find.

Here is a link to the portion of code you would have to change in the patch.

Hopefully this works for you. In the meantime, I will contact the jbrowse developers and see if we can't get a better universal solution worked out.

twsaari commented 8 years ago

I have just created a better patch which should automatically handle indexed_fasta input as well as fasta input. This means on your part, the effort should now be very minimal. Please checkout the branch mentioned above, also linked here.

just go into the FeatureSequence directory and run

git checkout indexed_fasta_roughPatch

Let me know if this works for you.

billzt commented 8 years ago

Thank you. Now it works well. However the "mRNAs" seems failed to recognize spliced sequences, it just directly output the whole unspliced genomic sequence. My GFF file is:

A02     EVM     gene    32174343        32180477        .       +       .       ID=Gh_A02G0895;Name=CIRH1A;Description=Cirhin ;
A02     EVM     mRNA    32174343        32180477        .       +       .       ID=Gh_A02G0895.1;Parent=Gh_A02G0895
A02     EVM     exon    32174343        32174507        .       +       .       ID=Gh_A02G0895.1.exon1;Parent=Gh_A02G0895.1
A02     EVM     CDS     32174343        32174507        .       +       0       ID=cds.Gh_A02G0895.1;Parent=Gh_A02G0895.1
A02     EVM     exon    32174597        32174740        .       +       .       ID=Gh_A02G0895.1.exon2;Parent=Gh_A02G0895.1
A02     EVM     CDS     32174597        32174740        .       +       0       ID=cds.Gh_A02G0895.1;Parent=Gh_A02G0895.1
A02     EVM     exon    32175196        32175508        .       +       .       ID=Gh_A02G0895.1.exon3;Parent=Gh_A02G0895.1
A02     EVM     CDS     32175196        32175508        .       +       0       ID=cds.Gh_A02G0895.1;Parent=Gh_A02G0895.1
A02     EVM     exon    32175601        32175664        .       +       .       ID=Gh_A02G0895.1.exon4;Parent=Gh_A02G0895.1
A02     EVM     CDS     32175601        32175664        .       +       2       ID=cds.Gh_A02G0895.1;Parent=Gh_A02G0895.1
A02     EVM     exon    32176195        32176308        .       +       .       ID=Gh_A02G0895.1.exon5;Parent=Gh_A02G0895.1
A02     EVM     CDS     32176195        32176308        .       +       1       ID=cds.Gh_A02G0895.1;Parent=Gh_A02G0895.1
A02     EVM     exon    32176445        32176691        .       +       .       ID=Gh_A02G0895.1.exon6;Parent=Gh_A02G0895.1
A02     EVM     CDS     32176445        32176691        .       +       1       ID=cds.Gh_A02G0895.1;Parent=Gh_A02G0895.1
A02     EVM     exon    32177214        32177367        .       +       .       ID=Gh_A02G0895.1.exon7;Parent=Gh_A02G0895.1
A02     EVM     CDS     32177214        32177367        .       +       0       ID=cds.Gh_A02G0895.1;Parent=Gh_A02G0895.1
A02     EVM     exon    32177490        32178103        .       +       .       ID=Gh_A02G0895.1.exon8;Parent=Gh_A02G0895.1
A02     EVM     CDS     32177490        32178103        .       +       2       ID=cds.Gh_A02G0895.1;Parent=Gh_A02G0895.1
A02     EVM     exon    32178609        32178790        .       +       .       ID=Gh_A02G0895.1.exon9;Parent=Gh_A02G0895.1
A02     EVM     CDS     32178609        32178790        .       +       0       ID=cds.Gh_A02G0895.1;Parent=Gh_A02G0895.1
A02     EVM     exon    32179304        32179582        .       +       .       ID=Gh_A02G0895.1.exon10;Parent=Gh_A02G0895.1
A02     EVM     CDS     32179304        32179582        .       +       1       ID=cds.Gh_A02G0895.1;Parent=Gh_A02G0895.1
A02     EVM     exon    32180183        32180477        .       +       .       ID=Gh_A02G0895.1.exon11;Parent=Gh_A02G0895.1
A02     EVM     CDS     32180183        32180477        .       +       1       ID=cds.Gh_A02G0895.1;Parent=Gh_A02G0895.1

Any thing OK?

twsaari commented 8 years ago

Yes there are two potential issues here. The first is that you have three-leveled features. The second is that the exons and CDS's are covering the same genomic space.

The three-leveled features is most likely what is causing your current problem. What I mean by this is, the current heirarchy is gene->mRNA->exon. JBrowse generally only represents two levels at a time from what I understand.

With the CDSs and exons covering the same genomic regions, this is a case of overlapping features (an extreme case), which causes the plugin to use an old algorithm which may cause it to run very slowly. I would recommend choosing one or the other feature to load.

In summary, I would re-load the GFF track if possible with the --type flag to keep only the mRNA->CDS or the mRNA->exon features in the track. You could create a separate track for this, or keep it in the current track. The following should work from within the jbrowse/bin/ directory

perl ./flatfile-to-json --gff <your_file> --trackLabel <new label to create new track or re-use previous label to overwrite> --type 'mRNA,CDS' <or> 'mRNA,exon'
billzt commented 8 years ago

JBrowse can represents three levels features. As we know, alternative splice is very common in higher organisms. For example, if one gene locus A has three isoforms A.1, A.2, A.3, when we load the three-level GFF file into JBrowse, it could group A.1, A.2, A.3 in a single point. (That is, they could be clicked together)

a

Of course we could also load two-level features. However in such situation, JBrowse would only display A.1, A.2, A.3 in parallel

twsaari commented 8 years ago

I have not configured my data in this way, so this is new information to me as well. In the past, I have only been able to load two-levels tracks for things to display correctly. This may have been a limitation of HTMLFeature tracks - which look like they're becoming a thing of the past.

Do you have a way of selecting a transcript individually from that grouping? Can you right click on A.2 and access A.2's attributes, subfeatures, etc? If so, then our solution may lie in just changing how we execute callFxn. If not, then we'd need to build a few new things, which will take some effort (Selection menu to move between transcripts, recursion of all the data preparation over the transcripts, etc).

twsaari commented 8 years ago

I have a live instance here, with zebrafish chromosome 16. The gene track, ensGene, was loaded directly from the UCSC database with the script ucsc-to-json.pl I've just uploaded the latest commits, and it should give you a good idea of how the FeatureSequence plugin should work.

billzt commented 8 years ago

Do you have a way of selecting a transcript individually from that grouping

No. In such group, the whole group should be selected together. Infromation for each transcript could be seen in a single pop-up dialog, just like the default JBrowse "View detail" dialog.

I'm a newer to JBrowse. The first version I use is 1.11.6, and now I use 1.12.1. I'm using CanvasFeatures all the time (Perhaps it sounds more cool. ^_^). JBrowse is an actively developing project. Many new features are keepping added. Thanks for your nice work and hope it could become more and more rubust.

twsaari commented 8 years ago

No. In such group, the whole group should be selected together.

This is the main issue. You can really only view one transcript sequence at a time on the plugin - this is by design. Since JBrowse doesn't natively have a way to select a single transcript from a 3-level track, there's no way to ask the plugin to look at a specific one. I can see how this would be useful though, and I think a selection menu within the popup would be a reasonable way to select between transcripts. I will keep these ideas in mind for future releases.

In the meantime, you could very easily upload an extra 2-level track such as mRNA->exon. I would definitely recommend this approach. Simply run flatfile-to-json.pl as I mentioned a few days ago. You will not overwrite any data unless you give the track the same trackLabel as the one you previously loaded.

Thanks for checking out the plugin. I'm going to close this issue now.