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.
This commit is contained in:
Ross Lazarus
2011-08-04 12:43:30 +10:00
parent 0f1c751800
commit 5b2e7947ea
3 changed files with 29 additions and 40 deletions
+4
View File
@@ -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:
+1 -1
View File
@@ -343,7 +343,7 @@
<tool file="samtools/sam2interval.xml" />
<tool file="samtools/sam_to_bam.xml" />
<tool file="samtools/bam_to_sam.xml" />
<tool file="picard/sam_merge.xml" />
<tool file="samtools/sam_merge.xml" />
<tool file="samtools/sam_pileup.xml" />
<tool file="samtools/pileup_parser.xml" />
<tool file="samtools/pileup_interval.xml" />
+24 -39
View File
@@ -1,18 +1,21 @@
<tool id="sam_merge" name="Merge BAM Files" version="1.1.1">
<tool id="sam_merge2" name="Merge BAM Files" version="1.1.2">
<description>merges BAM files together</description>
<requirements>
<requirement type="package">samtools</requirement>
<requirement type="package">picard</requirement>
</requirements>
<command interpreter="python">
sam_merge.py
$input1
$output1
$input2
<command>
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&gt; $outlog
</command>
<inputs>
<param name="title" label="Name for the output merged bam file" type="text" default="Merged.bam"
help="This name will appear in your history so use it to remember what the new file in your history contains" />
<param name="mergeSD" value="true" type="boolean" label="Merge all component bam file headers into the merged bam file"
truevalue="true" falsevalue="false" checked="yes"
help="Control the MERGE_SEQUENCE_DICTIONARIES flag for Picard MergeSamFiles. Default (true) correctly propagates read groups and other important metadata" />
<param name="input1" label="First file" type="data" format="bam" />
<param name="input2" label="with file" type="data" format="bam" help="Need to add more files? Use controls below." />
<repeat name="inputs" title="Input Files">
@@ -20,57 +23,39 @@
</repeat>
</inputs>
<outputs>
<data format="bam" name="output1" label="${tool.name} on ${on_string}: merged BAM" />
<data format="bam" name="output1" label="${title}.bam" />
<data format="txt" name="outlog" label="${title}_${tool.name}.log" />
</outputs>
<tests>
<!-- TODO: add ability to test framework to test without at least
one repeat element value
<test>
-->
<!--
Bam merge command:
samtools merge test-data/sam_merge_out1.bam test-data/sam_merge_in1.bam test-data/sam_merge_in2.bam
-->
<!--
<test>
<param name="title" value="test1" />
<param name="mergeSD" value="true" />
<param name="input1" value="sam_merge_in1.bam" ftype="bam" />
<param name="input2" value="sam_merge_in2.bam" ftype="bam" />
<output name="output1" file="sam_merge_out1.bam" ftype="bam" />
<output name="outlog" file="sam_merge_out1.log" ftype="txt" lines_diff="8"/>
</test>
-->
<test>
<!--
Bam merge command:
samtools merge sam_merge_out2.bam test-data/sam_merge_in1.bam test-data/sam_merge_in2.bam test-data/sam_merge_in3.bam
-->
<param name="title" value="test2" />
<param name="mergeSD" value="true" />
<param name="input1" value="sam_merge_in1.bam" ftype="bam" />
<param name="input2" value="sam_merge_in2.bam" ftype="bam" />
<param name="input" value="sam_merge_in3.bam" ftype="bam" />
<output name="output1" file="sam_merge_out2.bam" ftype="bam" />
<output name="outlog" file="sam_merge_out2.log" ftype="txt" lines_diff="8"/>
</test>
<!-- TODO: add ability to test code to be able to test with multiple
inputs (parameters with same value)
<test>
-->
<!--
Bam merge command:
samtools merge test-data/sam_merge_out3.bam test-data/sam_merge_in1.bam test-data/sam_merge_in2.bam test-data/sam_merge_in3.bam test-data/sam_merge_in4.bam
-->
<!--
<param name="input1" value="sam_merge_in1.bam" ftype="bam" />
<param name="input2" value="sam_merge_in2.bam" ftype="bam" />
<param name="input" value="sam_merge_in3.bam" ftype="bam" />
<param name="input" value="sam_merge_in4.bam" ftype="bam" />
<output name="output1" file="sam_merge_out3.bam" ftype="bam" />
</test>
-->
</tests>
<help>
**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
</help>
</tool>