details: http://www.bx.psu.edu/hg/galaxy/rev/8470f5588775 changeset: 3768:8470f5588775 user: fubar/ross period lazarus at gmail d0t com date: Tue May 11 11:51:49 2010 -0400 description: Add mimetypes to snp/wga datatypes in genetics.py Fix edit_attributes to snp/wga composite files in tests diffstat: lib/galaxy/datatypes/genetics.py | 19 ++++++++++++++++++- lib/galaxy/tools/__init__.py | 2 +- test/functional/test_toolbox.py | 6 ++++-- tools/rgenetics/rgCaCo.xml | 1 + tools/rgenetics/rgClean.xml | 1 + tools/rgenetics/rgEigPCA.xml | 1 + tools/rgenetics/rgGLM.xml | 2 ++ tools/rgenetics/rgGRR.xml | 1 + tools/rgenetics/rgHaploView.xml | 1 + tools/rgenetics/rgLDIndep.xml | 1 + tools/rgenetics/rgPedSub.xml | 1 + tools/rgenetics/rgQC.xml | 1 + tools/rgenetics/rgTDT.xml | 1 + 13 files changed, 34 insertions(+), 4 deletions(-) diffs (200 lines): diff -r 39268be26944 -r 8470f5588775 lib/galaxy/datatypes/genetics.py --- a/lib/galaxy/datatypes/genetics.py Mon May 10 20:59:41 2010 -0400 +++ b/lib/galaxy/datatypes/genetics.py Tue May 11 11:51:49 2010 -0400 @@ -173,6 +173,10 @@ return false return true + def get_mime(self): + """Returns the mime type of the datatype""" + return 'application/vnd.ms-excel' + class rgTabList(Tabular): """ @@ -211,6 +215,10 @@ out = "Can't create peek %s" % exc return out + def get_mime(self): + """Returns the mime type of the datatype""" + return 'text/html' + class rgSampleList(rgTabList): """ @@ -262,7 +270,7 @@ stored in extra files path """ - MetadataElement( name="base_name", desc="base name for all transformed versions of this genetic dataset", + MetadataElement( name="base_name", desc="base name for all transformed versions of this genetic dataset", default='RgeneticsData', readonly=True, set_in_upload=True) composite_type = 'auto_primary_file' @@ -302,6 +310,11 @@ f.write('\n') f.close() + def get_mime(self): + """Returns the mime type of the datatype""" + return 'text/html' + + def set_meta( self, dataset, **kwd ): """ @@ -506,6 +519,10 @@ cannot rename the datasets here - they come with the default unfortunately """ return '<html><head></head><body>AutoGenerated Primary File for Composite Dataset</body></html>' + + def get_mime(self): + """Returns the mime type of the datatype""" + return 'text/html' def get_phecols(self, phenolist=[], maxConc=20): """ diff -r 39268be26944 -r 8470f5588775 lib/galaxy/tools/__init__.py --- a/lib/galaxy/tools/__init__.py Mon May 10 20:59:41 2010 -0400 +++ b/lib/galaxy/tools/__init__.py Tue May 11 11:51:49 2010 -0400 @@ -541,7 +541,7 @@ attrib['composite_data'].append( child ) if composite_data_name is None: #generate a unique name; each test uses a fresh history - composite_data_name = '_COMPOSITE_RENAMED %i_' % ( composite_data_names_counter ) + composite_data_name = '_COMPOSITE_RENAMED_%i_' % ( composite_data_names_counter ) composite_data_names_counter += 1 elif child.tag == 'metadata': attrib['metadata'].append( child ) diff -r 39268be26944 -r 8470f5588775 test/functional/test_toolbox.py --- a/test/functional/test_toolbox.py Mon May 10 20:59:41 2010 -0400 +++ b/test/functional/test_toolbox.py Tue May 11 11:51:49 2010 -0400 @@ -45,8 +45,10 @@ new_name = edit_att.get( 'value', None ) assert new_name, 'You must supply the new dataset name as the value tag of the edit_attributes tag' hda_id = self.get_history_as_data_list()[-1].get( 'id' ) - self.edit_hda_attribute_info( hda_id, new_name = new_name ) - print "Renamed uploaded file to:", new_name + try: + self.edit_hda_attribute_info( hda_id = str(hda_id), new_name = new_name ) + except: + print "### call to edit_hda failed for hda_id",hda_id,"new_name=",new_name else: raise Exception( 'edit_attributes type (%s) is unimplemented' % edit_att.get( 'type', None ) ) # We need to handle the case where we've uploaded a valid compressed file since the upload diff -r 39268be26944 -r 8470f5588775 tools/rgenetics/rgCaCo.xml --- a/tools/rgenetics/rgCaCo.xml Mon May 10 20:59:41 2010 -0400 +++ b/tools/rgenetics/rgCaCo.xml Tue May 11 11:51:49 2010 -0400 @@ -28,6 +28,7 @@ <composite_data value='tinywga.bim' /> <composite_data value='tinywga.bed' /> <composite_data value='tinywga.fam' /> + <edit_attributes type='name' value='tinywga' /> </param> <param name='name' value='rgCaCotest1' /> <output name='out_file1' file='rgCaCotest1_CaCo.xls' ftype='tabular' compare='diff' /> diff -r 39268be26944 -r 8470f5588775 tools/rgenetics/rgClean.xml --- a/tools/rgenetics/rgClean.xml Mon May 10 20:59:41 2010 -0400 +++ b/tools/rgenetics/rgClean.xml Tue May 11 11:51:49 2010 -0400 @@ -57,6 +57,7 @@ <composite_data value='tinywga.bim' /> <composite_data value='tinywga.bed' /> <composite_data value='tinywga.fam' /> + <edit_attributes type='name' value='tinywga' /> </param> <param name='title' value='rgCleantest1' /> <param name="geno" value="1" /> diff -r 39268be26944 -r 8470f5588775 tools/rgenetics/rgEigPCA.xml --- a/tools/rgenetics/rgEigPCA.xml Mon May 10 20:59:41 2010 -0400 +++ b/tools/rgenetics/rgEigPCA.xml Tue May 11 11:51:49 2010 -0400 @@ -40,6 +40,7 @@ <composite_data value='tinywga.bim' /> <composite_data value='tinywga.bed' /> <composite_data value='tinywga.fam' /> + <edit_attributes type='name' value='tinywga' /> </param> <param name='title' value='rgEigPCAtest1' /> <param name="k" value="4" /> diff -r 39268be26944 -r 8470f5588775 tools/rgenetics/rgGLM.xml --- a/tools/rgenetics/rgGLM.xml Mon May 10 20:59:41 2010 -0400 +++ b/tools/rgenetics/rgGLM.xml Tue May 11 11:51:49 2010 -0400 @@ -52,10 +52,12 @@ <composite_data value='tinywga.bim' /> <composite_data value='tinywga.bed' /> <composite_data value='tinywga.fam' /> + <edit_attributes type='name' value='tinywga' /> </param> <param name='phef' value='tinywga' ftype='pphe' > <metadata name='base_name' value='tinywga' /> <composite_data value='tinywga.pphe' /> + <edit_attributes type='name' value='tinywga' /> </param> <param name='title1' value='rgGLMtest1' /> <param name='predvar' value='c1' /> diff -r 39268be26944 -r 8470f5588775 tools/rgenetics/rgGRR.xml --- a/tools/rgenetics/rgGRR.xml Mon May 10 20:59:41 2010 -0400 +++ b/tools/rgenetics/rgGRR.xml Tue May 11 11:51:49 2010 -0400 @@ -27,6 +27,7 @@ <composite_data value='tinywga.bim' /> <composite_data value='tinywga.bed' /> <composite_data value='tinywga.fam' /> + <edit_attributes type='name' value='tinywga' /> </param> <param name='title1' value='rgGRRtest1' /> <param name='n' value='100' /> diff -r 39268be26944 -r 8470f5588775 tools/rgenetics/rgHaploView.xml --- a/tools/rgenetics/rgHaploView.xml Mon May 10 20:59:41 2010 -0400 +++ b/tools/rgenetics/rgHaploView.xml Tue May 11 11:51:49 2010 -0400 @@ -88,6 +88,7 @@ <metadata name='base_name' value='tinywga' /> <composite_data value='tinywga.ped' /> <composite_data value='tinywga.map' /> + <edit_attributes type='name' value='tinywga' /> </param> <param name='ucsc_region' value='' /> <param name='title' value='rgHaploViewtest1' /> diff -r 39268be26944 -r 8470f5588775 tools/rgenetics/rgLDIndep.xml --- a/tools/rgenetics/rgLDIndep.xml Mon May 10 20:59:41 2010 -0400 +++ b/tools/rgenetics/rgLDIndep.xml Tue May 11 11:51:49 2010 -0400 @@ -41,6 +41,7 @@ <composite_data value='tinywga.bim' /> <composite_data value='tinywga.bed' /> <composite_data value='tinywga.fam' /> + <edit_attributes type='name' value='tinywga' /> </param> <param name='title1' value='rgLDIndeptest1' /> <param name="mind" value="1" /> diff -r 39268be26944 -r 8470f5588775 tools/rgenetics/rgPedSub.xml --- a/tools/rgenetics/rgPedSub.xml Mon May 10 20:59:41 2010 -0400 +++ b/tools/rgenetics/rgPedSub.xml Tue May 11 11:51:49 2010 -0400 @@ -73,6 +73,7 @@ <metadata name='base_name' value='tinywga' /> <composite_data value='tinywga.ped' /> <composite_data value='tinywga.map' /> + <edit_attributes type='name' value='tinywga' /> </param> <param name='title' value='rgPedSubtest1' /> <param name="region" value="" /> diff -r 39268be26944 -r 8470f5588775 tools/rgenetics/rgQC.xml --- a/tools/rgenetics/rgQC.xml Mon May 10 20:59:41 2010 -0400 +++ b/tools/rgenetics/rgQC.xml Tue May 11 11:51:49 2010 -0400 @@ -25,6 +25,7 @@ <composite_data value='tinywga.bim' /> <composite_data value='tinywga.bed' /> <composite_data value='tinywga.fam' /> + <edit_attributes type='name' value='tinywga' /> </param> <param name='out_prefix' value='rgQCtest1' /> <output name='html_file' file='rgtestouts/rgQC/rgQCtest1.html' ftype='html' lines_diff='280'> diff -r 39268be26944 -r 8470f5588775 tools/rgenetics/rgTDT.xml --- a/tools/rgenetics/rgTDT.xml Mon May 10 20:59:41 2010 -0400 +++ b/tools/rgenetics/rgTDT.xml Tue May 11 11:51:49 2010 -0400 @@ -27,6 +27,7 @@ <composite_data value='tinywga.bim' /> <composite_data value='tinywga.bed' /> <composite_data value='tinywga.fam' /> + <edit_attributes type='name' value='tinywga' /> </param> <param name='title1' value='rgTDTtest1' /> <output name='out_file1' file='rgTDTtest1_TDT.xls' ftype='tabular' compare="diff"/>