OpenTreeOfLife / treemachine

Source tree graph database
Other
16 stars 6 forks source link

No entries in `sourceToMetaMap` for "rootward" nodes #209

Closed jimallman closed 8 years ago

jimallman commented 8 years ago

In calls to getSyntheticTree, it seems we're missing information about non-taxonomy sources for the nodes in the "rootward path" which appears left of the target node. For example, click the "i" (info) icon for Bacteria while on the page for its descendant "aquifer1". The property window fails to display because its supporting source pg_2542_5590_a2c48df995ddc9fd208986c3d4225112550c8452 has no information in sourceToMetaMap.

Note that properties for "cellular organisms" appear as expected, since its only supporting source is taxonomy.

Here's a cURL call that shows the arguson at this location:

curl 'https://api.opentreeoflife.org/cached/treemachine/v1/getSyntheticTree' \
  -H 'Content-Type: application/json' \
  --data-binary '{"treeID":"opentree4.0","format":"arguson","maxDepth":"3","subtreeNodeID":"233952"}'

{
  "name" : "aquifer1",
  "nodeid" : 233952,
  "maxnodedepth" : 0,
  "nTipDescendants" : 0,
  "nleaves" : 0,
  "taxSource" : "silva:JF191423/#2",
  "taxRank" : "no rank - terminal",
  "ottId" : "5246093",
  "pathToRoot" : [ {
    "supporting_sources" : [ "taxonomy", "pg_2542_5590_a2c48df995ddc9fd208986c3d4225112550c8452" ],
    "uniqname" : "Bacteria (domain silva:A16379/#1)",
    "taxSource" : "silva:A16379/#1,ncbi:2,worms:6,gbif:3,irmng:13",
    "name" : "Bacteria",
    "ottId" : "844192",
    "nodeid" : 4,
    "taxRank" : "domain"
  }, {
    "supporting_sources" : [ "taxonomy" ],
    "uniqname" : "cellular organisms",
    "taxSource" : "ncbi:131567",
    "name" : "cellular organisms",
    "ottId" : "93302",
    "nodeid" : 1,
    "taxRank" : "no rank"
  } ],
  "hasChildren" : false,
  "supportedBy" : [ "taxonomy" ],
  "sourceToMetaMap" : {
    "taxonomy" : {
      "version" : "2.9draft12"
    }
  }
}
josephwb commented 8 years ago

Whoops. Thanks for finding this @jimallman. I'll fix it this morning.

josephwb commented 8 years ago

@jimallman Below is how things currently stand on test (no changes made). So I think this was fixed with the tm-lite rewrite?

curl https://test.opentreeoflife.org/treemachine/v1/getSyntheticTree -H 'Content-Type: application/json' --data-binary '{"treeID":"opentree4.0","format":"arguson","maxDepth":"3","node_id":"ott5246093"}'
{
  "name" : "aquifer1",
  "node_id" : "ott5246093",
  "max_node_depth" : 0,
  "n_tip_descendants" : 1,
  "n_leaves" : 0,
  "ott_id" : 5246093,
  "unique_name" : "aquifer1",
  "tax_rank" : "no rank - terminal",
  "tax_sources" : {
    "silva" : "JF191423/#2"
  },
  "path_to_root" : [ {
    "tax_sources" : {
      "irmng" : "13",
      "worms" : "6",
      "silva" : "A16379/#1",
      "gbif" : "3",
      "ncbi" : "2"
    },
    "unique_name" : "Bacteria (domain silva:A16379/#1)",
    "supported_by" : {
      "taxonomy" : "2.9draft12",
      "pg_2542_tree5590" : "node960373"
    },
    "name" : "Bacteria",
    "ott_id" : 844192,
    "tax_rank" : "domain",
    "node_id" : "ott844192"
  }, {
    "tax_sources" : {
      "ncbi" : "131567"
    },
    "unique_name" : "cellular organisms",
    "name" : "cellular organisms",
    "ott_id" : 93302,
    "tax_rank" : "no rank",
    "node_id" : "ott93302"
  } ],
  "has_children" : false,
  "supported_by" : {
    "taxonomy" : "2.9draft12"
  },
  "sourceToMetaMap" : {
    "taxonomy" : {
      "name" : "ott",
      "version" : "2.9draft12"
    },
    "pg_2542_tree5590" : {
      "git_sha" : "c6ce2f9067e9c74ca7b1f770623bde9b6de8bd1f",
      "tree_id" : "tree5590",
      "study_id" : "pg_2542"
    }
  }
}
jimallman commented 8 years ago

Yes, this looks right. Further displayed information is fetched (via AJAX) as needed. You can see this working on ot30: https://test.opentreeoflife.org/opentree/opentree4.1@ott4750919/bacterium-ES1D2

jar398 commented 8 years ago

Sounds like this is finished. Closing.