Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • frozenlyse
    replied

    Leave a comment:


  • jiaco
    replied
    Yeah, something fun to do first thing this morning. Despite the functional hack by R Finney, here is another that gets you the image in pdf format.


    Put the first code block in wgetUcscPdfs.sh and chmod +x it

    Be sure to change the hgsid to a value from your browser session
    Code:
    #!/bin/bash
    
    baseurl="http://genome.ucsc.edu/"
    hgsid=12345678
    
    cat $1 | while read chr beg end;
    do
    	position=$chr":"$beg"-"$end;
    	pdf_fname="auto_"$chr"_"$beg"_"$end".pdf";
    
    	s=$baseurl"cgi-bin/hgTracks?hgt.psOutput=on&hgsid="$hgsid"&position="$position
    	wget $s -O XXX
    	s2=`grep 'hgt_genome.*.pdf' XXX | sed 's/.*hgt_genome/hgt_genome/' | sed 's/[.]pdf.*/.pdf/'`
    	tgt=$baseurl"/trash/hgt/"$s2
    	wget $tgt -O $pdf_fname
    done
    Here is a sample input, albeit a stupid one, the regions are all Ns

    Code:
    chr1	50000	50100
    chr22	100000	100100
    And the command line to make it happen.
    Code:
    ./wget_UcscPdfs.sh test_wgetUcscPdfs.txt
    You can make the file names how you want and even clean up url escaping if you like. It uses 2 rounds of wget but in the end you can get pdfs of each region.

    Leave a comment:


  • Richard Finney
    replied
    (I tought it would be hard in that I thought the individual tracks had separate images)
    Set up your session by hand. Set up the tracks you want and the track mode (squish, full, dense, whatever). Set up your custom track.
    Cut the URL for an initial query to hgTracks (the genome you want and any old position).
    You'll need an "hgsid" variable. Make sure you have this in your URL. Your command line wget will mimick
    the user you are in a browser by using this hgsid variable.
    Use that as base URL to hack. Hack position parameter as needed ...

    Here's an example, you can parameterize the position using your favorite shell code ...

    wget "http://genome.ucsc.edu/cgi-bin/hgTracks?hgHubConnect.destUrl=..%2Fcgi-bin%2FhgTracks&clade=mammal&org=Human&db=hg19&position=chr21%3A33%2C031%2C597-33%2C041%2C570&hgt.positionInput=chr21%3A33%2C031%2C597-33%2C041%2C570&hgt.suggestTrack=knownGene&Submit=submit&hgsid=317627943&pix=1180" -O x
    grep png x | grep trash | grep png | sed 's/src=...//' | tr -d "'" | grep png | awk 'BEGIN{p=0};{print "wget \"http://genome.ucsc.edu/" $3"\" -O "p"\.png"; p++}' | grep 3.png > tmp.get.job
    . ./tmp.get.job
    cp 3.png final.png


    # I thought the images were in chunks , but they are not, third image will do.
    #the following code using imagemagick are not necessary to "concatenate images".
    #odds=`ls 3.png 5.png 7.png 9.png 11.png 13.png 15.png 17.png 19.png 21.png 22.png 23.png 25.png 27.png`
    #evens=`ls 2.png 4.png 6.png 8.png 10.png 12.png 14.png 16.png 18.png 20.png 22.png 24.png 26.png`
    #convert $odds -append left.png
    #convert $evens -append right.png
    #convert left.png right.png +append final.png

    This just wgets the URL to a file called "x" and gets the third (4th ?) png in the resulting file which you can then wget. The final.png is the file you want to look at. You can rename it as necessary, perhaps using a parameter to your script.

    There are likely more elegant ways, but what the heck it's a hack that works.

    Regardless this should be a good enough hint for some wizard to fix up.

    Resulting image may need alpha channel removed. I think. I"m not sure. It looks transparent in gimp but appears okay in browser.
    Use imagemagick for this .
    Last edited by Richard Finney; 12-17-2012, 07:26 PM.

    Leave a comment:


  • larsgt
    replied
    Generating UCSC screen dumps in batch Reply to Thread

    Originally posted by rfilbert View Post
    You could script almost anything. Can you be more specific what is in your "batch"?
    Sorry for being a bit unclear.

    What I want to do is write a script that takes in a number of regions say
    chr1:234234234-2342424234 and gives me back a PNG/JPG/whatever of
    the UCSC browser with a few tracks and a custom track.

    /Lars

    Leave a comment:


  • rfilbert
    replied
    You could script almost anything. Can you be more specific what is in your "batch"?

    Leave a comment:


  • larsgt
    started a topic Generating UCSC screen dumps in batch

    Generating UCSC screen dumps in batch

    Hello,

    Is there a good way of dumping images from UCSC in batch?

    Probably going to use some form of web testing tool but I was
    wondering if there was an easier way.

    /Lars

Latest Articles

Collapse

  • SEQadmin2
    Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
    by SEQadmin2



    Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

    Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
    ...
    10-14-2026, 09:55 AM
  • SEQadmin2
    New Genomics Technologies Take Aim at Long-Standing Limits
    by SEQadmin2


    Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

    We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
    ...
    09-28-2026, 10:25 AM

ad_right_rmr

Collapse

News

Collapse

Topics Statistics Last Post
Started by SEQadmin2, 10-22-2026, 11:13 AM
0 responses
26 views
0 reactions
Last Post SEQadmin2  
Started by SEQadmin2, 10-22-2026, 10:48 AM
0 responses
20 views
0 reactions
Last Post SEQadmin2  
Started by SEQadmin2, 10-15-2026, 10:52 AM
0 responses
36 views
0 reactions
Last Post SEQadmin2  
Started by SEQadmin2, 10-14-2026, 05:39 AM
0 responses
43 views
0 reactions
Last Post SEQadmin2  
Working...