Skip to content
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

flatfile-to-json.pl --bed does not generate subfeatures anymore #1511

Open
mpoelchau opened this issue May 29, 2020 · 16 comments
Open

flatfile-to-json.pl --bed does not generate subfeatures anymore #1511

mpoelchau opened this issue May 29, 2020 · 16 comments

Comments

@mpoelchau
Copy link

  • JBrowse version: 1.16.6

In previous versions of jbrowse (up to 1.16.5 as far as i can tell), running flatfile-to-json.pl with the --bed and --subfeatureClasses options would give you a glyph with subfeatures (see track 'TM-tophat-junctions' in the image). Running the exact same flatfile-to-json.pl command on the same data in Jbrowse 1.16.6 generates a glyph without subfeatures (see track 'TM-tophat-junctions-new' in the image).

Screen Shot 2020-05-29 at 1 27 19 PM

Having the subfeatures is quite useful in the case of junctions from RNA-Seq aligners, since it shows users where the alignment starts/ends vs where the intron starts/ends. There are probably other use cases where this feature is handy.

I looked at the changes between 1.16.5 and 1.16.6, and couldn't find any likely culprits. So I am wondering if there's a change in bioperl that might need to be accommodated?

Command used: flatfile-to-json.pl --bed junctions.bed --arrowheadClass trellis-arrowhead --getSubfeatures --subfeatureClasses '{"UTR": "webapollo-UTR","CDS": "junction-cds","exon": "container-100pct","intron": null, "wholeCDS": null, "start_codon": null,"stop_codon": null, "match_part": "darkblue-80pct"}' --cssClass container-16px --trackLabel TM_tophat_junctions-new -key TM_tophat_junctions-new --config '{ "category": "Transcriptome/Splice Junctions"}'

@cmdcolin
Copy link
Contributor

Not sure I can reproduce this, e.g. it doesn't work for me at any point. If you accept canvasfeatures+bedtabix, then for me this seems like a nice workaround

bgzip junctions.bed
tabix junctions.bed.gz

trackList.json entry

{
  "label": "junctions",
  "urlTemplate": "junctions.bed.gz"
}

Screenshot from 2020-05-29 16-46-10

I know canvasfeatures aren't draggable but they do have the right click create so that could help

There are sort of a lot of variables debugging this otherwise especially since I can't reproduce e.g. is it jbrowse version, is it webapollo version, is it a css change, is it htmlfeatures or bioperl, etc. If it can be narrowed down maybe it can be addressed but hard to say without that

@mpoelchau
Copy link
Author

Okay, thanks - I'll give canvasfeatures+tabix a try.

@childers
Copy link

childers commented Jun 4, 2020

@cmdcolin I'm not sure about your comment, does this not work for you at all? or does it look like normal when you do it?

@cmdcolin
Copy link
Contributor

cmdcolin commented Jun 4, 2020

@childers I tried running a bin/flatfile-to-json on 1.16.5 on a simple junctions.bed file and I did not get subfeatures

I don't have the apollo setup but I figured that it should work in jbrowse itself. if you can confirm a file and command that works in one version of plain jbrowse and then stops working in another version that would probably be the best for reproducibility of this error for me

@cmdcolin
Copy link
Contributor

cmdcolin commented Jun 4, 2020

This was the junctions.bed I used

chr20	9353709	9360718	JUNC00000552	2	+	9353709	9360718	255,0,0	2	42,18	0,6991
chr20	9365023	9368124	JUNC00000553	1	+	9365023	9368124	255,0,0	2	35,15	0,3086
chr20	9368172	9370544	JUNC00000554	2	+	9368172	9370544	255,0,0	2	31,19	0,2353
chr20	9371222	9374262	JUNC00000555	7	+	9371222	9374262	255,0,0	2	40,28	0,3012
chr20	9374285	9376179	JUNC00000556	1	+	9374285	9376179	255,0,0	2	40,10	0,1884
chr20	9376224	9382178	JUNC00000557	5	+	9376224	9382178	255,0,0	2	41,42	0,5912
chr20	9385955	9388573	JUNC00000558	1	+	9385955	9388573	255,0,0	2	40,10	0,2608
chr20	9388666	9389312	JUNC00000559	4	+	9388666	9389312	255,0,0	2	39,33	0,613
chr20	9389328	9389741	JUNC00000560	6	+	9389328	9389741	255,0,0	2	36,38	0,375
chr20	9389783	9391703	JUNC00000561	3	+	9389783	9391703	255,0,0	2	45,20	0,1900

@mpoelchau
Copy link
Author

Sorry about the delayed response on this issue, Colin! I've finally given canvasfeatures+tabix a try (needed to update our servers first...). Bed files display fine that way in Jbrowse, but in the older version of Jbrowse we have on production (I believe it's 1.13 but I could be wrong) I get the warning Unable to determine an appropriate data store to use with track 'SRR3883760 Splice junctions', please explicitly specify a storeClass in the configuration. Logging on to Apollo (2.1.1-SNAPSHOT) I then get various show-stopping errors (bed tracks display at first then don't anymore, Apollo2.1.1 Tracks menu in the right-hand panel won't load).

I figured I'd start with the storeClass. I dug around in the jbrowse docs but couldn't find any information on this - do you know what storeClass should be used? Thanks!

@cmdcolin
Copy link
Contributor

{
  "label": "junctions",
  "urlTemplate": "junctions.bed.gz",
"storeClass": "JBrowse/Store/SeqFeature/BEDTabix"
}

More recent versions of jbrowse try to automatically guess storeClass based on file extension but for older jbrowse can manually supply it like above as BEDTabix storeClass

@cmdcolin
Copy link
Contributor

Might be a good reminder to document that if we are missing... Let me know if that helps though:)

@mpoelchau
Copy link
Author

Yeah, it might be nice to have a list of all of the different storeClasses.

Adding "storeClass": "JBrowse/Store/SeqFeature/BEDTabix" made the above error go away, but the track data won't display. I also get a TypeError: null is not an object (evaluating 'mid.match') console error when I click on the track radio button. Perhaps the Jbrowse version is too old?

I am also working with this on our test server with jbrowse 1.16 and apollo2.1.1 - the tracks work fine there in jbrowse, but there are interesting apollo issues. I think I'll hop over to the apollo github issue queue since perhaps the best fix for the jbrowse problem is to upgrade.

@cmdcolin
Copy link
Contributor

Hmm...hard to tell what is going on there. Do you have a link to the instance? You are also saying that it works in 1.16-ish but not in 1.13-ish?

@mpoelchau
Copy link
Author

Sure, here you go: https://apollo.nal.usda.gov/apollo/4271957/jbrowse/index.html?loc=NW_022170249.1%3A37405952..37406327&tracks=DNA%2CAnnotations&highlight=

The bed track is the 'Splice junctions' track at the bottom of the list

Yep, it works in 1.16-ish but not in 1.13-ish. Here's a screenshot from 1.16.9:

staging-jbrowse

@mpoelchau
Copy link
Author

also per @childers the jbrowse version is maint/1.12.5-apollo

@cmdcolin
Copy link
Contributor

@mpoelchau sorry I forgot something in the track config...have to specify both type and storeClass...the newer jbrowse versions automatically infers both but in older versions specifying both is needed

{
  "label": "junctions",
  "urlTemplate": "junctions.bed.gz",
  "storeClass": "JBrowse/Store/SeqFeature/BEDTabix",
  "type": "CanvasFeatures"
}

@mpoelchau
Copy link
Author

Awesome, that helps! Apollo seems to work now too on our prod setup... Is there a different type/style that would display the subfeatures? Right now the features display as contiguous blocks:

Screen Shot 2021-02-12 at 10 16 35 AM

But we need them to look more like this:

subfeats

@cmdcolin
Copy link
Contributor

@mpoelchau looks like only later versions of jbrowse add subfeature parsing of bedtabix. if needed in 1.12.5, could make a subclass of BEDTabix in a plugin that does the subfeature parsing

@mpoelchau
Copy link
Author

got it, thanks for the feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants