21 if ($rank ==
'subkingdom') {
26 $fetch =
new EFetch(
'taxonomy');
27 $fetch->addParam(
'id',
"$id");
28 $response = $fetch->get()->xml();
29 if (empty($response->Taxon->LineageEx->Taxon)) {
30 drupal_set_message(t(
'Unable to load Lineage information from NCBI for organism: @org', array(
'@org' => $organism)));
34 $lineage = $response->Taxon->LineageEx->Taxon;
35 foreach ($lineage as $item) {
36 if ($item->Rank == $rank) {
37 return $item->ScientificName;
40 drupal_set_message(
"Unable to determine $rank from NCBI for organism: $organism");
55 $fetch =
new EFetch(
'taxonomy');
56 $fetch->addParam(
'id',
"$id");
57 $response = $fetch->get()->xml();
58 if (empty($response->Taxon->Lineage)) {
59 drupal_set_message(t(
'Unable to load Lineage information from NCBI for organism: @org', array(
'@org' => $organism)));
63 $lineage = $response->Taxon->Lineage;
64 if (preg_match(
'/(angiosperm|gymnosperm)/', $lineage, $matches)) {
65 if (!empty($matches[1])) {
69 drupal_set_message(t(
'Unable to determine subkingdom from NCBI for organism: @org', array(
'@org' => $organism)));
83 $formatted_org = implode(
'+', explode(
' ', $organism));
84 $search =
new ESearch(
'taxonomy');
85 $search->addParam(
'term',
"{$formatted_org}[Scientific+Name]");
87 $err_msg =
'Unable to load Taxon ID from NCBI for organism named: ' . $organism;
89 $response = $search->get()->xml();
90 if (empty($response->IdList->Id)) {
91 drupal_set_message($err_msg);
95 return $response->IdList->Id;
97 return $response->IdList;
99 catch (\Exception $e) {
100 drupal_set_message($err_msg .
' EUtils Error: ' . $e->getMessage());
tpps_ncbi_get_taxon_id($organism, $list=FALSE)
tpps_ncbi_get_taxonomy($organism, $rank)
tpps_ncbi_get_subkingdom($organism)