[Gmod-ajax] JBrowse capture script - with http_basic & auto sizing of image to tracks

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Gmod-ajax] JBrowse capture script - with http_basic & auto sizing of image to tracks

Keiran Raine
Hi all,

I've put together a script for capturing a set of images based on a BED input file using casperjs.


The advantages of this over looping on the standard phantomjs rasterize.js are:

  • Cache of data is maintained
  • Also works with sites secured with http_basic (password in text file, set permissions accordingly)
  • Trims images back to correct height (except pdf)
  • Attempts to automatically compensate for track loading times based on requested base URL
  • Hides tracklist automatically

Usage is simple, get the user to set up the display with relevant tracks in the browser and then just copy the URL and give it to the script:

$ casperjs jbrowse_rasterize.js --passwdFile=myPwd.txt --width=1200 --imgType=png --locs=places.bed --outdir=wibble1 --baseUrl='http://localhost:8999/JBrowse/?data=auto%2F1404&loc=1%3A115102801..115404000&tracks=...'

I'm sure this can be improved upon ('waitForResouce()' on each track div, instead of a naive 'wait()' if you know what to test for) but this is as far as I have time to take it.

Regards,

Keiran Raine
Principal Bioinformatician
Cancer Genome Project
Wellcome Trust Sanger Institute

Tel:+44 (0)1223 834244 Ext: 4983
Office: H104

Examples:




-- The Wellcome Trust Sanger Institute is operated by Genome Research Limited, a charity registered in England with number 1021457 and a company registered in England with number 2742969, whose registered office is 215 Euston Road, London, NW1 2BE.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax