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

sessions with cytobandURL data uri #1338

Closed
brentp opened this issue Jun 1, 2021 · 5 comments
Closed

sessions with cytobandURL data uri #1338

brentp opened this issue Jun 1, 2021 · 5 comments

Comments

@brentp
Copy link

brentp commented Jun 1, 2021

Hi, thanks again for this great software.

I am trying to write my own serializer, similar to igv-reports. I have bam, vcf, bed, etc working, but the cytoband is not working. If I copy the base64+gzip encoded data from an igv-reports file, then it works, but if I use another, it does not; there is no error but the bands do not render. I'm not sure how to debug.

Here is the relevant part from the decoded sessionURL:

"cytobandURL": "data:application/gzip;base64,H4sIAAAAAAAAAF2VS27DMAxE185hAs3oY/s4RVFk18Yt0PMXlMShUi8fP+KQoowtbczJvu2Z2z3n7fH58bhBtK5Wbo/n1w/rDeI7LHhGw6OdnouVOaKdgzXCSQ8XRj0XO3qCmm4IA9NyBKJ8x8wtMmARIAP31UMShHmqhnpfNIjn6GC9S4NoLmphvQ8JvYPi+VQBxQ4YAxAteXcFxdL7BMRL0wHFDhjxojXR40f1e5+f01p1OuN00XpoQpyn9wGIt3R4esbpoi3iYemfXyNevJ2qHnbAqF70KMXTw9I/v36Q7AbIcOw+Hy4CRE+4ALqA3gDxU/PhIkD0VH10ASPeORK8A1wUBEZqPkG+aggLAJ8SsvVptCEwUF0HsvXJGxkGYF9y6CIHBpM3c25CH2VgEF4pVinCYFYGk/L2/vFp2ygM1rmPFxBmhyh5lnhZBb9v3xYtiLJPkdfo1OyCMGqat9UcxjYPDTKg+mHmogchMGpTjpcMjlH9ebqYlz4KoyWV+ToLGdB8XJYjqhBG82Fd7FurecqAPc2bbS56WAJjH6uTusOy3GHA3nwe7K/P7KgwjjSSbOaw9kMGHHVecHMJLcI4/Q24/i1pWHBmT7LueWCcx7x75jDEjE0PC5P/WK71sQlMwNVk3/b+2IaB8BfFXKQmMJm97WU816OM4KRSFN6XX4Y42VyteYy2jkJkYdYtMp+oRJy5+E0trqbf9jAwt7mQ5rLkcMyS/a6W0dT+egVmOc7aCrldpWyPz4/H7Q9o0aVRFggAAA=="

and that decodes to:

$ echo H4sIAAAAAAAAAF2VS27DMAxE185hAs3oY/s4RVFk18Yt0PMXlMShUi8fP+KQoowtbczJvu2Z2z3n7fH58bhBtK5Wbo/n1w/rDeI7LHhGw6OdnouVOaKdgzXCSQ8XRj0XO3qCmm4IA9NyBKJ8x8wtMmARIAP31UMShHmqhnpfNIjn6GC9S4NoLmphvQ8JvYPi+VQBxQ4YAxAteXcFxdL7BMRL0wHFDhjxojXR40f1e5+f01p1OuN00XpoQpyn9wGIt3R4esbpoi3iYemfXyNevJ2qHnbAqF70KMXTw9I/v36Q7AbIcOw+Hy4CRE+4ALqA3gDxU/PhIkD0VH10ASPeORK8A1wUBEZqPkG+aggLAJ8SsvVptCEwUF0HsvXJGxkGYF9y6CIHBpM3c25CH2VgEF4pVinCYFYGk/L2/vFp2ygM1rmPFxBmhyh5lnhZBb9v3xYtiLJPkdfo1OyCMGqat9UcxjYPDTKg+mHmogchMGpTjpcMjlH9ebqYlz4KoyWV+ToLGdB8XJYjqhBG82Fd7FurecqAPc2bbS56WAJjH6uTusOy3GHA3nwe7K/P7KgwjjSSbOaw9kMGHHVecHMJLcI4/Q24/i1pWHBmT7LueWCcx7x75jDEjE0PC5P/WK71sQlMwNVk3/b+2IaB8BfFXKQmMJm97WU816OM4KRSFN6XX4Y42VyteYy2jkJkYdYtMp+oRJy5+E0trqbf9jAwt7mQ5rLkcMyS/a6W0dT+egVmOc7aCrldpWyPz4/H7Q9o0aVRFggAAA== | base64 -d | zcat | head
1	0	2300000	p36.33	gneg
1	2300000	5300000	p36.32	gpos25
1	5300000	7100000	p36.31	gneg
1	7100000	9100000	p36.23	gpos25
1	9100000	12500000	p36.22	gneg
1	12500000	15900000	p36.21	gpos50
1	15900000	20100000	p36.13	gneg
1	20100000	23600000	p36.12	gpos25
1	23600000	27600000	p36.11	gneg
1	27600000	29900000	p35.3	gpos25

so it looks fine. I am attaching the full html which shows that the bam and vcf are working.
o.html.gz
I've tried with multiple different cytoband files but can't get it to render.

I'm happy to hear any pointers.

@jrobinso
Copy link
Contributor

jrobinso commented Jun 1, 2021

I would suggest setting a breakpoint in the function loadCytobands of genome.js and see what is going on from there. Make a copy of one of the "dev" htmls and use your decoded session for the "config".

@brentp
Copy link
Author

brentp commented Jun 2, 2021

ok. thanks for the reply. I plan to have a look at this when I get other critical parts sorted.

@brentp
Copy link
Author

brentp commented Jun 3, 2021

For what it's worth, the example from igv-reports show this for the first variant. All other variants render the ideogram correctly, but not the first variant it's almost like the ideogram is zoomed in, only showing a part of the chromosome.

here's the command I ran to see it (directly from igv-reports README):

create_report examples/variants/variants.vcf.gz /data/human/Homo_sapiens_assembly38.fasta \
    --ideogram examples/variants/cytoBandIdeo.txt \
    --flanking 1000 --info-columns GENE TISSUE TUMOR COSMIC_ID GENE SOMATIC \
    --tracks examples/variants/variants.vcf.gz examples/variants/recalibrated.bam 
    examples/variants/refGene.sort.bed.gz \
    --output example1.html

@jrobinso
Copy link
Contributor

I tracked this down, the bug was not in igv-reports but igv.js. To scale the cytoband the bp length of the chromosome was used, which in turn was computed from the sequence length. The report generated fastas contain only a slice of the sequence, and the bp length of the chromosome was == start postition + sequence length. Variants at the beginning of the chromosome looked worse, but they were all wrong. I'm not sure when this crept in. The igv.js fix will be released shortly, then I will update the template and release igv-reports. For your application just use the latest igv.js release, which should be 2.8.5, when its out in the next day or so.

@brentp
Copy link
Author

brentp commented Jun 11, 2021

great! thanks for the fix, and the software!

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

2 participants