diff --git a/src/couchapp/secreton/views/by_replicon_taxonomy/map.js b/src/couchapp/secreton/views/by_replicon_taxonomy/map.js index 2d3d50fd6ff343f7033dc7bccb64dfc9e1719167..f22363c576c0beb31c3cfe639005375902c24585 100644 --- a/src/couchapp/secreton/views/by_replicon_taxonomy/map.js +++ b/src/couchapp/secreton/views/by_replicon_taxonomy/map.js @@ -1,8 +1,17 @@ function(doc) { - var taxo = doc.replicon.taxonomy; - for( var i=0; i<taxo.length; i++ ){ - emit(taxo[i], doc._id); - } + taxonomy = doc.replicon.taxonomy; + for( var j=0; j< taxonomy.length ; j++ ){ + emit(taxonomy[j], { + "id" : doc._id, + "code" : doc.code , + "name" : doc.replicon.name , + "T3SS_family" : doc.T3SS_family, + "taxid" : doc.replicon.taxid, + "strain" : doc.replicon.strain , + "taxonomy" : doc.replicon.taxonomy.join( ", ") , + "type" : doc.replicon.type + }); + } } diff --git a/src/couchapp/secreton/views/taxonomy_terms/map.js b/src/couchapp/secreton/views/taxonomy_terms/map.js new file mode 100644 index 0000000000000000000000000000000000000000..3bf2081081c3ac873b5030eca70949ba672cf2fe --- /dev/null +++ b/src/couchapp/secreton/views/taxonomy_terms/map.js @@ -0,0 +1,13 @@ +function(doc) { + taxonomy = doc.replicon.taxonomy; + for( var j=0; j< taxonomy.length ; j++ ){ + var term= taxonomy[j]; + for( var syllabe_l = 3 ; syllabe_l <= term.length ; syllabe_l++){ + for(var i=0; i<= term.length-syllabe_l; i++){ + var key = term.substring(i, i+syllabe_l); + key = key.toLowerCase(); + emit( [key, term] , 1 ); + } + } + } +} diff --git a/src/couchapp/secreton/views/taxonomy_terms/reduce.js b/src/couchapp/secreton/views/taxonomy_terms/reduce.js new file mode 100644 index 0000000000000000000000000000000000000000..b2c12764f630bc43f3c5dbee49925069d640b3a1 --- /dev/null +++ b/src/couchapp/secreton/views/taxonomy_terms/reduce.js @@ -0,0 +1,3 @@ +function(keys, values, rereduce){ + return sum(values); +} \ No newline at end of file