commit/galaxy-central: carlfeberhard: Visualizations registry: move built-in vis config files to sample, copying them over on registry start; add vis xml files to .hgignore; fix test data in scatterplot.xml
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/6781bf1f3de1/ Changeset: 6781bf1f3de1 User: carlfeberhard Date: 2013-07-18 22:24:18 Summary: Visualizations registry: move built-in vis config files to sample, copying them over on registry start; add vis xml files to .hgignore; fix test data in scatterplot.xml Affected #: 13 files diff -r 91de48b4fd3b5628d5a434f68bd6cf2473ad62c3 -r 6781bf1f3de1514967d62b6cf4fe4910cf9ec0aa .hgignore --- a/.hgignore +++ b/.hgignore @@ -60,7 +60,7 @@ job_conf.xml data_manager_conf.xml shed_data_manager_conf.xml -visualizations_conf.xml +config/visualizations/*.xml static/welcome.html.* static/welcome.html diff -r 91de48b4fd3b5628d5a434f68bd6cf2473ad62c3 -r 6781bf1f3de1514967d62b6cf4fe4910cf9ec0aa config/visualizations/circster.xml --- a/config/visualizations/circster.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE visualization SYSTEM "visualization.dtd"> -<visualization name="circster"> - <data_sources> - <data_source> - <model_class>HistoryDatasetAssociation</model_class> - <test type="isinstance" test_attr="datatype" result_type="datatype">data.Data</test> - <to_param param_attr="id">dataset_id</to_param> - <to_param assign="hda">hda_ldda</to_param> - </data_source> - <data_source> - <model_class>LibraryDatasetDatasetAssociation</model_class> - <test type="isinstance" test_attr="datatype" result_type="datatype">data.Data</test> - <to_param param_attr="id">dataset_id</to_param> - <to_param assign="ldda">hda_ldda</to_param> - </data_source> - </data_sources> - <params> - <param type="visualization">id</param> - <param type="hda_or_ldda">dataset_id</param> - <param_modifier type="string" modifies="dataset_id">hda_ldda</param_modifier> - <param type="dbkey">dbkey</param> - </params> - <template>circster.mako</template> - <render_location>_top</render_location> -</visualization> diff -r 91de48b4fd3b5628d5a434f68bd6cf2473ad62c3 -r 6781bf1f3de1514967d62b6cf4fe4910cf9ec0aa config/visualizations/circster.xml.sample --- /dev/null +++ b/config/visualizations/circster.xml.sample @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE visualization SYSTEM "visualization.dtd"> +<visualization name="circster"> + <data_sources> + <data_source> + <model_class>HistoryDatasetAssociation</model_class> + <test type="isinstance" test_attr="datatype" result_type="datatype">data.Data</test> + <to_param param_attr="id">dataset_id</to_param> + <to_param assign="hda">hda_ldda</to_param> + </data_source> + <data_source> + <model_class>LibraryDatasetDatasetAssociation</model_class> + <test type="isinstance" test_attr="datatype" result_type="datatype">data.Data</test> + <to_param param_attr="id">dataset_id</to_param> + <to_param assign="ldda">hda_ldda</to_param> + </data_source> + </data_sources> + <params> + <param type="visualization">id</param> + <param type="hda_or_ldda">dataset_id</param> + <param_modifier type="string" modifies="dataset_id">hda_ldda</param_modifier> + <param type="dbkey">dbkey</param> + </params> + <template>circster.mako</template> + <render_location>_top</render_location> +</visualization> diff -r 91de48b4fd3b5628d5a434f68bd6cf2473ad62c3 -r 6781bf1f3de1514967d62b6cf4fe4910cf9ec0aa config/visualizations/example.xml.example --- a/config/visualizations/example.xml.example +++ /dev/null @@ -1,30 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE visualization SYSTEM "visualization.dtd"> -<visualization name="test"> - <data_sources> - <data_source> - <model_class>HistoryDatasetAssociation</model_class> - <test type="isinstance" test_attr="datatype" result_type="datatype">data.Data</test> - <to_param param_attr="id">dataset_id</to_param> - <to_param assign="bler">string</to_param> - <to_param assign="False">boolean</to_param> - <to_param assign="-5">integer</to_param> - <to_param assign="3.14">float</to_param> - <to_param assign="{}">json</to_param> - </data_source> - </data_sources> - <params> - <param>default</param> - <param type="str">string</param> - <param type="bool">boolean</param> - <param type="int">integer</param> - <param type="float">float</param> - <param type="json">json</param> - <param type="str" required="true">string</param> - <param type="visualization" var_name_in_template="visualization">visualization_id</param> - <param type="dataset" var_name_in_template="dataset">dataset_id</param> - <param type="hda_or_ldda">dataset_instance</param> - <param_modifier type="str" modifies="dataset_instance">hda_ldda</param_modifier> - </params> - <template>v_fwork_test.mako</template> -</visualization> diff -r 91de48b4fd3b5628d5a434f68bd6cf2473ad62c3 -r 6781bf1f3de1514967d62b6cf4fe4910cf9ec0aa config/visualizations/phyloviz.xml --- a/config/visualizations/phyloviz.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE visualization SYSTEM "visualization.dtd"> -<visualization name="phyloviz"> - <data_sources> - <data_source> - <model_class>HistoryDatasetAssociation</model_class> - <test type="isinstance" test_attr="datatype" result_type="datatype">data.Newick</test> - <test type="isinstance" test_attr="datatype" result_type="datatype">data.Nexus</test> - <to_param param_attr="id">dataset_id</to_param> - </data_source> - </data_sources> - <params> - <param type="dataset" var_name_in_template="hda" required="true">dataset_id</param> - <param type="integer" default="0">tree_index</param> - </params> - <template>phyloviz.mako</template> - <render_location>_top</render_location> -</visualization> diff -r 91de48b4fd3b5628d5a434f68bd6cf2473ad62c3 -r 6781bf1f3de1514967d62b6cf4fe4910cf9ec0aa config/visualizations/phyloviz.xml.sample --- /dev/null +++ b/config/visualizations/phyloviz.xml.sample @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE visualization SYSTEM "visualization.dtd"> +<visualization name="phyloviz"> + <data_sources> + <data_source> + <model_class>HistoryDatasetAssociation</model_class> + <test type="isinstance" test_attr="datatype" result_type="datatype">data.Newick</test> + <test type="isinstance" test_attr="datatype" result_type="datatype">data.Nexus</test> + <to_param param_attr="id">dataset_id</to_param> + </data_source> + </data_sources> + <params> + <param type="dataset" var_name_in_template="hda" required="true">dataset_id</param> + <param type="integer" default="0">tree_index</param> + </params> + <template>phyloviz.mako</template> + <render_location>_top</render_location> +</visualization> diff -r 91de48b4fd3b5628d5a434f68bd6cf2473ad62c3 -r 6781bf1f3de1514967d62b6cf4fe4910cf9ec0aa config/visualizations/scatterplot.xml --- a/config/visualizations/scatterplot.xml +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE visualization SYSTEM "visualization.dtd"> -<visualization name="scatterplot"> - <data_sources> - <data_source> - <model_class>HistoryDatasetAssociation</model_class> - <test type="isinstance" test_attr="datatype" result_type="datatype">tabular.Tabular</test> - <to_param param_attr="id">dataset_id</to_param> - </data_source> - </data_sources> - <params> - <param type="dataset" var_name_in_template="hda" required="true">dataset_id</param> - <param required="true">bler</param> - </params> - <template>scatterplot.mako</template> -</visualization> diff -r 91de48b4fd3b5628d5a434f68bd6cf2473ad62c3 -r 6781bf1f3de1514967d62b6cf4fe4910cf9ec0aa config/visualizations/scatterplot.xml.sample --- /dev/null +++ b/config/visualizations/scatterplot.xml.sample @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE visualization SYSTEM "visualization.dtd"> +<visualization name="scatterplot"> + <data_sources> + <data_source> + <model_class>HistoryDatasetAssociation</model_class> + <test type="isinstance" test_attr="datatype" result_type="datatype">tabular.Tabular</test> + <to_param param_attr="id">dataset_id</to_param> + </data_source> + </data_sources> + <params> + <param type="dataset" var_name_in_template="hda" required="true">dataset_id</param> + </params> + <template>scatterplot.mako</template> +</visualization> diff -r 91de48b4fd3b5628d5a434f68bd6cf2473ad62c3 -r 6781bf1f3de1514967d62b6cf4fe4910cf9ec0aa config/visualizations/sweepster.xml --- a/config/visualizations/sweepster.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE visualization SYSTEM "visualization.dtd"> -<visualization name="sweepster"> - <data_sources> - <data_source> - <model_class>HistoryDatasetAssociation</model_class> - <test type="isinstance" test_attr="datatype" result_type="datatype">data.Data</test> - <to_param param_attr="id">dataset_id</to_param> - <to_param assign="hda">hda_ldda</to_param> - </data_source> - <data_source> - <model_class>LibraryDatasetDatasetAssociation</model_class> - <test type="isinstance" test_attr="datatype" result_type="datatype">data.Data</test> - <to_param param_attr="id">dataset_id</to_param> - <to_param assign="ldda">hda_ldda</to_param> - </data_source> - </data_sources> - <params> - <param type="visualization" var_name_in_template="viz">visualization</param> - <param type="hda_or_ldda" var_name_in_template="dataset">dataset_id</param> - <param_modifier type="string" modifies="dataset_id">hda_ldda</param_modifier> - </params> - <template>sweepster.mako</template> - <render_location>_top</render_location> -</visualization> diff -r 91de48b4fd3b5628d5a434f68bd6cf2473ad62c3 -r 6781bf1f3de1514967d62b6cf4fe4910cf9ec0aa config/visualizations/sweepster.xml.sample --- /dev/null +++ b/config/visualizations/sweepster.xml.sample @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE visualization SYSTEM "visualization.dtd"> +<visualization name="sweepster"> + <data_sources> + <data_source> + <model_class>HistoryDatasetAssociation</model_class> + <test type="isinstance" test_attr="datatype" result_type="datatype">data.Data</test> + <to_param param_attr="id">dataset_id</to_param> + <to_param assign="hda">hda_ldda</to_param> + </data_source> + <data_source> + <model_class>LibraryDatasetDatasetAssociation</model_class> + <test type="isinstance" test_attr="datatype" result_type="datatype">data.Data</test> + <to_param param_attr="id">dataset_id</to_param> + <to_param assign="ldda">hda_ldda</to_param> + </data_source> + </data_sources> + <params> + <param type="visualization" var_name_in_template="viz">visualization</param> + <param type="hda_or_ldda" var_name_in_template="dataset">dataset_id</param> + <param_modifier type="string" modifies="dataset_id">hda_ldda</param_modifier> + </params> + <template>sweepster.mako</template> + <render_location>_top</render_location> +</visualization> diff -r 91de48b4fd3b5628d5a434f68bd6cf2473ad62c3 -r 6781bf1f3de1514967d62b6cf4fe4910cf9ec0aa config/visualizations/trackster.xml --- a/config/visualizations/trackster.xml +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE visualization SYSTEM "visualization.dtd"> -<visualization name="trackster"> - <!--not tested yet --> - <data_sources> - <data_source> - <model_class>HistoryDatasetAssociation</model_class> - <test type="isinstance" test_attr="datatype" result_type="datatype">data.Data</test> - <to_param param_attr="id">dataset_id</to_param> - <to_param assign="hda">hda_ldda</to_param> - <to_param param_attr="dbkey">dbkey</to_param> - </data_source> - <data_source> - <model_class>LibraryDatasetDatasetAssociation</model_class> - <test type="isinstance" test_attr="datatype" result_type="datatype">data.Data</test> - <to_param param_attr="id">dataset_id</to_param> - <to_param assign="ldda">hda_ldda</to_param> - </data_source> - </data_sources> - <params> - <param type="visualization">id</param> - <param type="dataset">dataset_id</param> - <param type="genome_region">genome_region</param> - <param type="dbkey">dbkey</param> - </params> - <template_root>tracks</template_root> - <template>browser.mako</template> - <render_location>_top</render_location> -</visualization> diff -r 91de48b4fd3b5628d5a434f68bd6cf2473ad62c3 -r 6781bf1f3de1514967d62b6cf4fe4910cf9ec0aa config/visualizations/trackster.xml.sample --- /dev/null +++ b/config/visualizations/trackster.xml.sample @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE visualization SYSTEM "visualization.dtd"> +<visualization name="trackster"> + <!--not tested yet --> + <data_sources> + <data_source> + <model_class>HistoryDatasetAssociation</model_class> + <test type="isinstance" test_attr="datatype" result_type="datatype">data.Data</test> + <to_param param_attr="id">dataset_id</to_param> + <to_param assign="hda">hda_ldda</to_param> + <to_param param_attr="dbkey">dbkey</to_param> + </data_source> + <data_source> + <model_class>LibraryDatasetDatasetAssociation</model_class> + <test type="isinstance" test_attr="datatype" result_type="datatype">data.Data</test> + <to_param param_attr="id">dataset_id</to_param> + <to_param assign="ldda">hda_ldda</to_param> + </data_source> + </data_sources> + <params> + <param type="visualization">id</param> + <param type="dataset">dataset_id</param> + <param type="genome_region">genome_region</param> + <param type="dbkey">dbkey</param> + </params> + <template_root>tracks</template_root> + <template>browser.mako</template> + <render_location>_top</render_location> +</visualization> diff -r 91de48b4fd3b5628d5a434f68bd6cf2473ad62c3 -r 6781bf1f3de1514967d62b6cf4fe4910cf9ec0aa lib/galaxy/visualization/registry.py --- a/lib/galaxy/visualization/registry.py +++ b/lib/galaxy/visualization/registry.py @@ -67,6 +67,7 @@ # load the registry from the xml files located in configuration_filepath using the given parser configuration_filepath = os.path.join( galaxy_root, configuration_filepath ) self.configuration_filepath = self.check_conf_filepath( configuration_filepath ) + self.move_sample_conf_files() self.load() # what to use to parse query strings into resources/vars for the template @@ -82,6 +83,20 @@ raise IOError( 'visualization configuration directory (%s) not found' %( configuration_filepath ) ) return configuration_filepath + def move_sample_conf_files( self ): + """ + Copies any `*.xml.sample` files in `configuration_filepath` to + `.xml` files of the same names if no file with that name already exists. + + :returns: a list of the files moved + """ + files_moved = [] + for sample_file in glob.glob( os.path.join( self.configuration_filepath, '*.sample' ) ): + new_name = os.path.splitext( sample_file )[0] + if not os.path.exists( new_name ): + shutil.copy2( sample_file, new_name ) + files_moved.append( new_name ) + def load( self ): """ Builds the registry by parsing the xml in `self.configuration_filepath` Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org