diff --git a/app/views/private_api/ecnumbers.json.jbuilder b/app/views/private_api/ecnumbers.json.jbuilder new file mode 100644 index 0000000..11f06f4 --- /dev/null +++ b/app/views/private_api/ecnumbers.json.jbuilder @@ -0,0 +1,4 @@ +json.array! @ecnumbers do |ecnumber| + json.code ecnumber.code + json.name ecnumber.name +end diff --git a/app/views/private_api/error.json.jbuilder b/app/views/private_api/error.json.jbuilder new file mode 100644 index 0000000..1ad1d0d --- /dev/null +++ b/app/views/private_api/error.json.jbuilder @@ -0,0 +1,2 @@ +json.name @error_name +json.message @error_message diff --git a/app/views/private_api/goterms.json.jbuilder b/app/views/private_api/goterms.json.jbuilder new file mode 100644 index 0000000..051139d --- /dev/null +++ b/app/views/private_api/goterms.json.jbuilder @@ -0,0 +1,5 @@ +json.array! @goterms do |goterm| + json.code goterm.code + json.name goterm.name + json.namespace goterm.namespace +end diff --git a/app/views/private_api/interpros.json.jbuilder b/app/views/private_api/interpros.json.jbuilder new file mode 100644 index 0000000..b33b2b1 --- /dev/null +++ b/app/views/private_api/interpros.json.jbuilder @@ -0,0 +1,5 @@ +json.array! @interpros do |interpro| + json.code interpro.code + json.category interpro.category + json.name interpro.name +end diff --git a/app/views/private_api/metadata.json.jbuilder b/app/views/private_api/metadata.json.jbuilder new file mode 100644 index 0000000..edb1ae2 --- /dev/null +++ b/app/views/private_api/metadata.json.jbuilder @@ -0,0 +1 @@ +json.db_version @data[:db_version] diff --git a/app/views/private_api/proteins.json.jbuilder b/app/views/private_api/proteins.json.jbuilder new file mode 100644 index 0000000..ca149b1 --- /dev/null +++ b/app/views/private_api/proteins.json.jbuilder @@ -0,0 +1,10 @@ +json.lca @lca_taxon ? @lca_taxon.id : -1 +json.common_lineage(@common_lineage.map(&:id)) +json.proteins @entries do |entry| + json.uniprotAccessionId entry.uniprot_accession_number + json.name entry.name + json.organism entry.taxon_id + json.ecNumbers(entry.ec_cross_references.map(&:ec_number_code)) + json.goTerms(entry.go_cross_references.map(&:go_term_code)) + json.interproEntries(entry.interpro_cross_references.map(&:interpro_entry_code)) +end diff --git a/app/views/private_api/taxa.json.jbuilder b/app/views/private_api/taxa.json.jbuilder new file mode 100644 index 0000000..82584da --- /dev/null +++ b/app/views/private_api/taxa.json.jbuilder @@ -0,0 +1,6 @@ +json.array! @taxa do |taxon| + json.id taxon.id + json.name taxon.name + json.rank taxon.rank + json.lineage(Lineage.ranks.map { |rank| taxon.lineage.send(rank) }) +end