[Genome] download browser graphics programmatically

Hiram Clawson hiram at soe.ucsc.edu
Wed May 16 10:03:34 PDT 2007


Good Morning Bob:

To set the width of your gif image, use a pix=N argument in your
URL, for example: ... hgTracks?pix=1000&hgt.customText= ...
to set size of 1000.  The maximum allowed width is 5000.

Your later email indicated you found the bottom of your gif image.

At this time we do not have a simple mechanism to set some sub-tracks
on and some sub-tracks off for a single composite track.  You would have
to laboriously set each sub-track on or off in your URL, it would be
a lot of variables.  For example:
encodeSangerChip=full  - to get any of the "on" sub-tracks in full mode
then each individual track, is a 1 or 0 for on or off, here is an example
with only three tracks on:
encodeSangerChipH4acHeLa_sel=1
encodeSangerChipH3K4me3HeLa_sel=1
encodeSangerChipH3acHeLa_sel=1
encodeSangerChipCTCF_sel=0
encodeSangerChipH3K27me3_sel=0
encodeSangerChipH3K36me3_sel=0
encodeSangerChipH3K4me1HFL1_sel=0
encodeSangerChipH3K4me1HeLa_sel=0
encodeSangerChipH3K4me1Molt4_sel=0
encodeSangerChipH3K4me1Ptr8_sel=0
encodeSangerChipH3K4me1_sel=0
encodeSangerChipH3K4me2HFL1_sel=0
encodeSangerChipH3K4me2HeLa_sel=0
encodeSangerChipH3K4me2K562_sel=0
encodeSangerChipH3K4me2Molt4_sel=0
encodeSangerChipH3K4me2Ptr8_sel=0
encodeSangerChipH3K4me2_sel=0
encodeSangerChipH3K4me3HFL1_sel=0
encodeSangerChipH3K4me3K562_sel=0
encodeSangerChipH3K4me3Molt4_sel=0
encodeSangerChipH3K4me3Ptr8_sel=0
encodeSangerChipH3K4me3_sel=0
encodeSangerChipH3K79me3_sel=0
encodeSangerChipH3K9me3_sel=0
encodeSangerChipH3acHFL1_sel=0
encodeSangerChipH3acK562_sel=0
encodeSangerChipH3acMolt4_sel=0
encodeSangerChipH3ac_sel=0
encodeSangerChipH4acHFL1_sel=0
encodeSangerChipH4acK562_sel=0
encodeSangerChipH4acMolt4_sel=0
encodeSangerChipH4ac_sel=0

To find these variables for any particular track, set it up as you would
like to see in the genome browser, then alter your WEB browser URL
to read cartDump where it says hgTracks

--Hiram

Bob Thurman wrote:
> Great, I can get this to work, but I'm still running into a couple of 
> problems.
> 
> 1) I would like to control the width of the display (and hence the 
> gif).  The help on " Displaying Your Own Annotations in the Genome 
> Browser*" *says "Browser lines allow you to configure such things as the 
> genome position that the Genome Browser will initially open to, the 
> width of the display, and the configuration of the other annotation 
> tracks that are shown (or hidden) in the initial display."  But I don't 
> see any attribute name in the "Browser Lines" section that will allow me 
> to control the width.
> 
> 2) My gif seems to be getting cut off at the bottom for all the tracks I 
> want to display.  Is there a fixed height for the gif and, if so, is 
> there a way to get around this limit?
> 
> 3) I'd like to display individual subtracks from the ENCODE SangerChip 
> tracks (there are over 30).  But the help on Browser Lines says "It is 
> not possible to display only a subset of the subtracks at this time."  
> True?  Any way around this?
> 
> Thanks for your help so far.
> 
> Bob Thurman
> 
> Hiram Clawson wrote:
>> Good Morning Bob:
>>
>> You can use wget to fetch the browser page and its associated .gif
>> graphic.  The resulting html file ends up with an unusual name,
>> but the .gif file is there too.  For example:
>>
>> wget --no-directories --recursive --follow-tags=img --html-extension \
>> --convert-links \
>> 'http://genome.ucsc.edu/cgi-bin/hgTracks?hgt.customText=http://genome-test.cse.ucsc.edu/~hiram/ctDb/bedWigGtfPsl.txt' 
>>
>>
>> This causes the loading of the custom tracks specified, which also 
>> controls which tracks are
>> displayed and position, note the browser specifications in the custom 
>> track file:
>>     http://genome-test.cse.ucsc.edu/~hiram/ctDb/bedWigGtfPsl.txt
>>
>> The resulting .gif file is named something like: 
>> hgt_genome_34c6_9eae80.gif
>> The hex ID numbers there will be different each time.
>> For this particular example, as a bonus, you also get the ideogram 
>> graphic:
>>      hgtIdeo_genome_34c6_9eae80.gif
>>
>> --Hiram
>>
>> Bob Thurman wrote:
>>> Hi,
>>>
>>> I would like a way to generate from within a program or from a unix 
>>> command line, a browser screen shot displaying tracks that I load 
>>> myself and download that graphic (as with the "PDF/PS" link at the 
>>> top of your page). Is this possible?  Is there a way to do this by 
>>> piping output through a wget command or something?
>>>
>>> Thanks,
>>>
>>> Bob Thurman
>>>
>>> Dept. of Genome Sciences
>>> University of Washington
> 



More information about the Genome mailing list