# HG changeset patch -- Bitbucket.org # Project galaxy-dist # URL http://bitbucket.org/galaxy/galaxy-dist/overview # User Ross Lazarus <ross.lazarus@gmail.com> # Date 1289322752 18000 # Node ID 9ee40043b826b3bc1e29f84996f9fe14dd119a45 # Parent a77b2888759e94861252ca65437e11ec298b3058 rgHaploView tool version upgrade - now shows thumbnail of ld plots --- a/tools/rgenetics/rgHaploView.xml +++ b/tools/rgenetics/rgHaploView.xml @@ -1,4 +1,4 @@ -<tool id="rgHaploView1" name="LD plots:" version="0.2"> +<tool id="rgHaploView1" name="LD plots:" version="0.3"><description>and comparisons with HapMap data</description> --- a/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.html +++ b/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.html @@ -9,9 +9,11 @@ </head><body><div class="document"> -<h4>rgenetics for Galaxy rgHaploView.py, wrapping HaploView</h4><br><div><hr><ul> +<h4>rgenetics for Galaxy rgHaploView.py, wrapping HaploView</h4><table><tr><td><a href="allnup.pdf"><img src="allnup.png" alt="Main combined LD image" hspace="10" align="middle"></td><td>Click the thumbnail at left to download the main combined LD image <a href=allnup.pdf>allnup.pdf</a></td></tr></table> +<br><div><hr><ul><li><a href="alljoin.pdf">alljoin.pdf - All pdf plots, each on a separate page</a></li><li><a href="allnup.pdf">allnup.pdf - All pdf plots on a single page</a></li> +<li><a href="allnup.png">allnup.png - allnup.png</a></li><li><a href="1_rgHaploViewtest1.pdf">1_rgHaploViewtest1.pdf - 1_rgHaploViewtest1.pdf</a></li><li><a href="1_rgHaploViewtest1.png">1_rgHaploViewtest1.png - 1_rgHaploViewtest1.png</a></li><li><a href="2_HapMap_YRI_22.pdf">2_HapMap_YRI_22.pdf - Hapmap data</a></li> @@ -33,7 +35,7 @@ Haploview 4.2 Java Version: 1.6.0_03 -Arguments: -n -pairwiseTagging -pedfile /opt/galaxy/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.ped -info /opt/galaxy/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.info -tagrsqcounts -tagrsqcutoff 0.8 -ldcolorscheme RSQ -maxDistance 200000 -compressedpng -chromosome 22 +Arguments: -n -pairwiseTagging -pedfile /tmp/foo/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.ped -info /tmp/foo/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.info -tagrsqcounts -tagrsqcutoff 0.8 -ldcolorscheme RSQ -maxDistance 200000 -compressedpng -chromosome 22 @@ -41,9 +43,9 @@ Arguments: -n -pairwiseTagging -pedfile Max LD comparison distance = 200000kb -Using data file: /opt/galaxy/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.ped +Using data file: /tmp/foo/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.ped -Using marker information file: /opt/galaxy/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.info +Using marker information file: /tmp/foo/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.info Writing output to rgHaploViewtest1.ped.LD.PNG @@ -79,27 +81,37 @@ Downloading chromosome 22, analysis pane Writing output to Chromosome22YRI.LD.PNG -This is pdfjoin version 1.20 + ---- -Reading site configuration from /etc/pdfnup.conf + pdfjam: This is pdfjam version 2.06. - Temporary LaTeX file for this job is /var/tmp/22578.tex + pdfjam: Reading any site-wide or user-specific defaults... - Calling pdflatex... + (none found) - Finished: output is /opt/galaxy/test-data/rgtestouts/rgHaploView/alljoin.pdf + pdfjam: Effective call for this run of pdfjam: -This is pdfnup version 1.20 + /usr/local/bin/pdfjam --fitpaper 'true' --rotateoversize 'true' --suffix joined --fitpaper 'true' --outfile alljoin.pdf -- 1_rgHaploViewtest1.pdf - 2_HapMap_YRI_22.pdf - -Reading site configuration from /etc/pdfnup.conf + pdfjam: Calling pdflatex... -Processing alljoin.pdf... + pdfjam: Finished. Output was to 'alljoin.pdf'. - Temporary LaTeX file for this job is /var/tmp/22621-1.tex + ---- - Calling pdflatex... + pdfjam: This is pdfjam version 2.06. - Finished: output is /opt/galaxy/test-data/rgtestouts/rgHaploView/allnup.pdf + pdfjam: Reading any site-wide or user-specific defaults... + + (none found) + + pdfjam: Effective call for this run of pdfjam: + + /usr/local/bin/pdfjam --suffix nup --nup '2x1' --landscape --nup '1x2' --outfile allnup.pdf -- alljoin.pdf - + + pdfjam: Calling pdflatex... + + pdfjam: Finished. Output was to 'allnup.pdf'. PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/rerla/bin @@ -107,7 +119,7 @@ PATH=/usr/kerberos/bin:/usr/local/bin:/b -## executing java -jar /opt/galaxy/tool-data/shared/jars/haploview.jar -n -memory 2048 -pairwiseTagging -pedfile /opt/galaxy/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.ped -info /opt/galaxy/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.info -tagrsqcounts -tagrsqcutoff 0.8 -ldcolorscheme RSQ -maxDistance 200000 -compressedpng -chromosome 22 returned 0 +## executing java -jar /opt/galaxy/tool-data/shared/jars/haploview.jar -n -memory 2048 -pairwiseTagging -pedfile /tmp/foo/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.ped -info /tmp/foo/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.info -tagrsqcounts -tagrsqcutoff 0.8 -ldcolorscheme RSQ -maxDistance 200000 -compressedpng -chromosome 22 returned 0 ## executing mogrify -resize 800x400! *.PNG returned 0 @@ -123,7 +135,9 @@ PATH=/usr/kerberos/bin:/usr/local/bin:/b ## executing mogrify -format pdf -resize 800x400! *.png returned 0 -## executing pdfjoin "*.pdf" --fitpaper true --outfile alljoin.pdf returned 0 +## executing pdfjoin *.pdf --fitpaper true --outfile alljoin.pdf returned 0 ## executing pdfnup alljoin.pdf --nup 1x2 --outfile allnup.pdf returned 0 + +## executing convert -resize x300 allnup.pdf allnup.png returned 0 </pre><hr></div></body></html> Binary file test-data/rgtestouts/rgHaploView/alljoin.pdf has changed Binary file test-data/rgtestouts/rgHaploView/2_HapMap_YRI_22.png has changed Binary file test-data/rgtestouts/rgHaploView/1_rgHaploViewtest1.pdf has changed Binary file test-data/rgtestouts/rgHaploView/2_HapMap_YRI_22.pdf has changed Binary file test-data/rgtestouts/rgHaploView/1_rgHaploViewtest1.png has changed --- a/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.ped.TESTS +++ b/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.ped.TESTS @@ -1,9 +1,9 @@ rs2283804 rs756632 -rs4820537 -rs3788347 -rs2283802 -rs4822363 rs4820539 rs16997606 +rs4822363 rs2267000 +rs3788347 +rs4820537 +rs2283802 Binary file test-data/rgtestouts/rgHaploView/allnup.pdf has changed --- a/tools/rgenetics/rgHaploView.py +++ b/tools/rgenetics/rgHaploView.py @@ -47,7 +47,7 @@ class ldPlot: self.args=argv self.parseArgs(argv=self.args) self.setupRegions() - + def parseArgs(self,argv=[]): """ """ @@ -405,10 +405,10 @@ class ldPlot: p=subprocess.Popen(vcl,shell=True,cwd=self.outfpath,stderr=self.lf,stdout=self.lf) retval = p.wait() self.lf.write('## executing %s returned %d\n' % (vcl,retval)) - #vcl = ['convert', 'allnup.pdf', 'allnup.png'] # this fails - bad pdf? - #p=subprocess.Popen(' '.join(vcl),shell=True,cwd=outfpath) - #retval = p.wait() - #lf.write('## executing %s returned %d\n' % (vcl,retval)) + vcl = '%s -resize x300 allnup.pdf allnup.png' % (self.convert) + p=subprocess.Popen(vcl,shell=True,cwd=self.outfpath,stderr=self.lf,stdout=self.lf) + retval = p.wait() + self.lf.write('## executing %s returned %d\n' % (vcl,retval)) ste.close() # temp file used to catch haploview blather hblather = open(blog,'r').readlines() # to catch the blather os.unlink(blog) @@ -425,20 +425,16 @@ class ldPlot: outf.write(galhtmlprefix % progname) s = '<h4>rgenetics for Galaxy %s, wrapping HaploView</h4>' % (progname) outf.write(s) - """ - as at ashg 2009, convert fails on allnup.pdf - probably too complex... mainthumb = 'allnup.png' mainpdf = 'allnup.pdf' - if os.path.exists(mainpdf): - if not os.path.exists(mainthumb): + if os.path.exists(os.path.join(self.outfpath,mainpdf)): + if not os.path.exists(os.path.join(self.outfpath,mainthumb)): outf.write('<table><tr><td colspan="3"><a href="%s">Main combined LD plot</a></td></tr></table>\n' % (mainpdf)) else: - outf.write('<table><tr><td><a href="%s"><img src="%s" alt="Main combined LD image" hspace="10" align="middle">') - outf.write('</td><td>Click this thumbnail to display the main combined LD image</td></tr></table>\n' % (mainpdf,mainthumb)) + outf.write('<table><tr><td><a href="%s"><img src="%s" alt="Main combined LD image" hspace="10" align="middle">' % (mainpdf,mainthumb)) + outf.write('</td><td>Click the thumbnail at left to download the main combined LD image <a href=%s>%s</a></td></tr></table>\n' % (mainpdf,mainpdf)) else: outf.write('(No main image was generated - this usually means a Haploview error connecting to Hapmap site - please try later)<br/>\n') - outf.write('## Called as %s' % sys.argv) - """ outf.write('<br><div><hr><ul>\n') for i, data in enumerate( flist ): dn = os.path.split(data)[-1] @@ -515,3 +511,4 @@ if __name__ == "__main__": ld.doPlots() + --- a/test-data/rgtestouts/rgHaploView/Log_rgHaploViewtest1.txt +++ b/test-data/rgtestouts/rgHaploView/Log_rgHaploViewtest1.txt @@ -3,12 +3,12 @@ Haploview 4.2 Java Version: 1.6.0_03 ***************************************************** -Arguments: -n -pairwiseTagging -pedfile /opt/galaxy/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.ped -info /opt/galaxy/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.info -tagrsqcounts -tagrsqcutoff 0.8 -ldcolorscheme RSQ -maxDistance 200000 -compressedpng -chromosome 22 +Arguments: -n -pairwiseTagging -pedfile /tmp/foo/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.ped -info /tmp/foo/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.info -tagrsqcounts -tagrsqcutoff 0.8 -ldcolorscheme RSQ -maxDistance 200000 -compressedpng -chromosome 22 Max LD comparison distance = 200000kb -Using data file: /opt/galaxy/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.ped -Using marker information file: /opt/galaxy/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.info +Using data file: /tmp/foo/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.ped +Using marker information file: /tmp/foo/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.info Writing output to rgHaploViewtest1.ped.LD.PNG Starting tagging. Writing output to rgHaploViewtest1.ped.TAGS @@ -26,21 +26,26 @@ Arguments: -n -chromosome 22 -panel YRI Max LD comparison distance = 200000kb Downloading chromosome 22, analysis panel YRI, 21784..21905 from HapMap release 21. Writing output to Chromosome22YRI.LD.PNG -This is pdfjoin version 1.20 -Reading site configuration from /etc/pdfnup.conf - Temporary LaTeX file for this job is /var/tmp/22578.tex - Calling pdflatex... - Finished: output is /opt/galaxy/test-data/rgtestouts/rgHaploView/alljoin.pdf -This is pdfnup version 1.20 -Reading site configuration from /etc/pdfnup.conf -Processing alljoin.pdf... - Temporary LaTeX file for this job is /var/tmp/22621-1.tex - Calling pdflatex... - Finished: output is /opt/galaxy/test-data/rgtestouts/rgHaploView/allnup.pdf + ---- + pdfjam: This is pdfjam version 2.06. + pdfjam: Reading any site-wide or user-specific defaults... + (none found) + pdfjam: Effective call for this run of pdfjam: + /usr/local/bin/pdfjam --fitpaper 'true' --rotateoversize 'true' --suffix joined --fitpaper 'true' --outfile alljoin.pdf -- 1_rgHaploViewtest1.pdf - 2_HapMap_YRI_22.pdf - + pdfjam: Calling pdflatex... + pdfjam: Finished. Output was to 'alljoin.pdf'. + ---- + pdfjam: This is pdfjam version 2.06. + pdfjam: Reading any site-wide or user-specific defaults... + (none found) + pdfjam: Effective call for this run of pdfjam: + /usr/local/bin/pdfjam --suffix nup --nup '2x1' --landscape --nup '1x2' --outfile allnup.pdf -- alljoin.pdf - + pdfjam: Calling pdflatex... + pdfjam: Finished. Output was to 'allnup.pdf'. PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/rerla/bin ## rgHaploView.py looking for 10 rs (['rs2283802', 'rs2267000', 'rs16997606', 'rs4820537', 'rs3788347'])## rgHaploView.py: wrote 10 markers, 40 subjects for region -## executing java -jar /opt/galaxy/tool-data/shared/jars/haploview.jar -n -memory 2048 -pairwiseTagging -pedfile /opt/galaxy/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.ped -info /opt/galaxy/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.info -tagrsqcounts -tagrsqcutoff 0.8 -ldcolorscheme RSQ -maxDistance 200000 -compressedpng -chromosome 22 returned 0 +## executing java -jar /opt/galaxy/tool-data/shared/jars/haploview.jar -n -memory 2048 -pairwiseTagging -pedfile /tmp/foo/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.ped -info /tmp/foo/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.info -tagrsqcounts -tagrsqcutoff 0.8 -ldcolorscheme RSQ -maxDistance 200000 -compressedpng -chromosome 22 returned 0 ## executing mogrify -resize 800x400! *.PNG returned 0 ## executing convert -resize 800x400! rgHaploViewtest1.ped.LD.PNG rgHaploViewtest1.tmp.png returned 0 ## executing convert -pointsize 25 -fill maroon -draw "text 10,300 'rgHaploViewtest1'" rgHaploViewtest1.tmp.png 1_rgHaploViewtest1.png returned 0 @@ -48,5 +53,6 @@ PATH=/usr/kerberos/bin:/usr/local/bin:/b ## executing convert -pointsize 25 -fill maroon -draw "text 10,300 'HapMap YRI'" rgHaploViewtest1.tmp.png 2_HapMap_YRI_22.png returned 0 ### nimages=2 ## executing mogrify -format pdf -resize 800x400! *.png returned 0 -## executing pdfjoin "*.pdf" --fitpaper true --outfile alljoin.pdf returned 0 +## executing pdfjoin *.pdf --fitpaper true --outfile alljoin.pdf returned 0 ## executing pdfnup alljoin.pdf --nup 1x2 --outfile allnup.pdf returned 0 +## executing convert -resize x300 allnup.pdf allnup.png returned 0 --- a/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.ped.TAGS +++ b/test-data/rgtestouts/rgHaploView/rgHaploViewtest1.ped.TAGS @@ -14,12 +14,12 @@ rs2267006 rs2283804 1.0 rs4822363 rs4822363 1.0 Test Alleles Captured -rs2283804 rs2283804,rs2267006 +rs2283804 rs2267006,rs2283804 rs756632 rs756632 -rs4820537 rs4820537 -rs3788347 rs3788347 -rs2283802 rs2283802 -rs4822363 rs4822363 rs4820539 rs4820539 rs16997606 rs16997606 +rs4822363 rs4822363 rs2267000 rs2267000 +rs3788347 rs3788347 +rs4820537 rs4820537 +rs2283802 rs2283802 Binary file test-data/rgtestouts/rgHaploView/rgHaploViewtest1.ped.LD.PNG has changed