Skip to content

Commit

Permalink
clustal as input format
Browse files Browse the repository at this point in the history
  • Loading branch information
wilzbach committed Oct 15, 2014
1 parent 845e928 commit d771be1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
5 changes: 5 additions & 0 deletions visualizations/biojs-msa/config/biojs-msa.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
<test type="isinstance" test_attr="datatype" result_type="datatype">sequence.Fasta</test>
<to_param param_attr="id">dataset_id</to_param>
</data_source>
<data_source>
<model_class>HistoryDatasetAssociation</model_class>
<test type="isinstance" test_attr="datatype" result_type="datatype">sequences</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>
Expand Down
16 changes: 14 additions & 2 deletions visualizations/biojs-msa/templates/biojs-msa.mako
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,31 @@ ${h.javascript_link( root + 'plugins/visualizations/biojs-msa/static/msa.min.js'

<script type="text/javascript">
var config = ${h.dumps( config )};
var hdaJson = ${h.dumps( trans.security.encode_dict_ids( hda.to_dict() ), indent=2 )};
var title = "${title or default_title}";
var url = "/api/datasets/"+config.dataset_id+"?data_type=raw_data&provider=base";
var xhr = require("nets");
xhr(url, function(err, response,text){
var data = JSON.parse(text).data;
var seqs = require("biojs-io-fasta").parse.parse(data);
if(hdaJson.data_type == "galaxy.datatypes.sequence.Fasta"){
var seqs = require("biojs-io-fasta").parse.parse(data);
}else{
// it could be clustal
var seqs = require("biojs-io-clustal").parse(data);
}
var msa = require("biojs-vis-msa");
// msa opts
var opts = {};
opts.el = document.getElementById('msa_menu');
opts.seqs = seqs;
//opts.zoomer = { textVisible: false};
opts.vis = {overviewbox: true};
//opts.columns = {hidden: [1,2,3]};
var m = new msa.msa(opts);
// the menu is independent to the MSA container
Expand Down

0 comments on commit d771be1

Please sign in to comment.