From 5b2e7947eaf0ce6602eff3b9929665edea599e4e Mon Sep 17 00:00:00 2001 From: Ross Lazarus Date: Thu, 4 Aug 2011 12:43:30 +1000 Subject: [PATCH] Fixed sam_merge.xml to call Picard MergeSamFiles.jar so metadata can be propagated through to the new merged bam from all the individual files - the samtools version of merge would require this to be done separately and passed in with the -h option whereas Picard does it automatically. Added one more test. Interesting that the test for that tool has been failing to correctly pass metadata but passing the buildbot anyway. Thanks to Camille Stephan for pointing out the bug. Changes to rgManQQ so the user can obtain a decent pdf image. When millions of points are plotted, these are humongous so GS is called to compress the resulting pdf and they are now of reasonable size. PDF's are now linked from the thumbnails. Some minor fiddling with point size on the Manhatten plots so the intersting ones are a little more obvious. Minor tweak to twilltestcase.py so composite file components are copied correctly to the directory specified by GALAXY_TEST_SAVE. This makes updating test artefacts much simpler because running tests with GALAXY_TEST_SAVE pointing somewhere will now save every tested output file. --- test/base/twilltestcase.py | 4 +++ tool_conf.xml.sample | 2 +- tools/samtools/sam_merge.xml | 63 ++++++++++++++---------------------- 3 files changed, 29 insertions(+), 40 deletions(-) diff --git a/test/base/twilltestcase.py b/test/base/twilltestcase.py index 35823f8a058..44be3112644 100644 --- a/test/base/twilltestcase.py +++ b/test/base/twilltestcase.py @@ -728,6 +728,10 @@ class TwillTestCase( unittest.TestCase ): self.visit_url( "%s/datasets/%s/display/%s" % ( self.url, self.security.encode_id( hda_id ), base_name ) ) data = self.last_page() file( temp_name, 'wb' ).write( data ) + if self.keepOutdir > '': + ofn = os.path.join(self.keepOutdir,base_name) + shutil.copy(temp_name,ofn) + log.debug('## GALAXY_TEST_SAVE=%s. saved %s' % (self.keepOutdir,ofn)) try: # have to nest try-except in try-finally to handle 2.4 try: diff --git a/tool_conf.xml.sample b/tool_conf.xml.sample index a93964a0eef..1e3d8d3f7fa 100644 --- a/tool_conf.xml.sample +++ b/tool_conf.xml.sample @@ -343,7 +343,7 @@ - + diff --git a/tools/samtools/sam_merge.xml b/tools/samtools/sam_merge.xml index 9613c7fab9f..11190b757bd 100644 --- a/tools/samtools/sam_merge.xml +++ b/tools/samtools/sam_merge.xml @@ -1,18 +1,21 @@ - + merges BAM files together - samtools + picard - - sam_merge.py - $input1 - $output1 - $input2 + + java -jar ${GALAXY_DATA_INDEX_DIR}/shared/jars/MergeSamFiles.jar MERGE_SEQUENCE_DICTIONARIES=$mergeSD OUTPUT=$output1 INPUT=$input1 INPUT=$input2 #for $i in $inputs - ${i.input} - #end for + INPUT=${i.input} + #end for + 2> $outlog + + @@ -20,57 +23,39 @@ - + + - - - + + + - - - **What it does** -This tool uses SAMTools_' merge command to merge any number of BAM files together into one BAM file. +This tool uses the Picard_ merge command to merge any number of BAM files together into one BAM file while preserving the BAM +metadata such as read groups -.. _SAMTools: http://samtools.sourceforge.net/samtools.shtml +.. _Picard: http://picard.sourceforge.net/command-line-overview.shtml#MergeSamFiles