tripal_analysis.api.inc 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <?php
  2. /****************************************************************************
  3. * @section Chado Table Descriptions
  4. ****************************************************************************/
  5. /**
  6. * Implements hook_chado_analysis_schema()
  7. * Purpose: To add descriptions and foreign keys to default table description
  8. * Note: This array will be merged with the array from all other implementations
  9. *
  10. * @return
  11. * Array describing the analysis table
  12. *
  13. * @ingroup tripal_analysis
  14. */
  15. function tripal_analysis_chado_analysis_schema() {
  16. $description = array();
  17. // Default table description in tripal_core.schema.api.inc: tripal_core_chado_analysis_schema()
  18. $referring_tables = array(
  19. 'analysisfeature',
  20. 'analysisprop',
  21. 'phylotree',
  22. 'quantification'
  23. );
  24. $description['referring_tables'] = $referring_tables;
  25. return $description;
  26. }
  27. /****************************************************************************
  28. * Implements hook_chado_analysisfeature_schema()
  29. * Purpose: To add descriptions and foreign keys to default table description
  30. * Note: This array will be merged with the array from all other implementations
  31. *
  32. * @return
  33. * Array describing the analysisfeature table
  34. */
  35. function tripal_analysis_chado_analysisfeature_schema() {
  36. $description = array();
  37. $description['foreign keys']['feature'] = array(
  38. 'table' => 'feature',
  39. 'columns' => array(
  40. 'feature_id' => 'feature_id',
  41. ),
  42. );
  43. $description['foreign keys']['analysis'] = array(
  44. 'table' => 'analysis',
  45. 'columns' => array(
  46. 'analysis_id' => 'analysis_id',
  47. ),
  48. );
  49. return $description;
  50. }
  51. /****************************************************************************
  52. * Implements hook_chado_analysisfeatureprop_schema()
  53. * Purpose: To add descriptions and foreign keys to default table description
  54. * Note: This array will be merged with the array from all other implementations
  55. *
  56. * @return
  57. * Array describing the analysisfeatureprop table
  58. */
  59. function tripal_analysis_chado_analysisfeatureprop_schema() {
  60. $description = array();
  61. $description['foreign keys']['analysisfeature'] = array(
  62. 'table' => 'analysisfeature',
  63. 'columns' => array(
  64. 'analysisfeature_id' => 'analysisfeature_id',
  65. ),
  66. );
  67. $description['foreign keys']['cvterm'] = array(
  68. 'table' => 'cvterm',
  69. 'columns' => array(
  70. 'type_id' => 'cvterm_id',
  71. ),
  72. );
  73. return $description;
  74. }
  75. /****************************************************************************
  76. * Implements hook_chado_analysisprop_schema()
  77. * Purpose: To add descriptions and foreign keys to default table description
  78. * Note: This array will be merged with the array from all other implementations
  79. *
  80. * @return
  81. * Array describing the analysisprop table
  82. */
  83. function tripal_analysis_chado_analysisprop_schema() {
  84. $description = array();
  85. $description['foreign keys']['cvterm'] = array(
  86. 'table' => 'cvterm',
  87. 'columns' => array(
  88. 'type_id' => 'cvterm_id',
  89. ),
  90. );
  91. $description['foreign keys']['analysis'] = array(
  92. 'table' => 'analysis',
  93. 'columns' => array(
  94. 'analysis_id' => 'analysis_id',
  95. ),
  96. );
  97. return $description;
  98. }
  99. /**
  100. *
  101. * @ingroup tripal_api
  102. */
  103. function tripal_analysis_get_property($analysis_id,$property){
  104. return tripal_core_get_property('analysis',$analysis_id,$property,'tripal');
  105. }
  106. /**
  107. *
  108. * @ingroup tripal_api
  109. */
  110. function tripal_analysis_insert_property($analysis_id,$property,$value,$update_if_present = 0){
  111. return tripal_core_insert_property('analysis',$analysis_id,$property,'tripal',$value,$update_if_present);
  112. }
  113. /**
  114. *
  115. * @ingroup tripal_api
  116. */
  117. function tripal_analysis_update_property($analysis_id,$property,$value,$insert_if_missing = 0){
  118. return tripal_core_update_property('analysis',$analysis_id,$property,'tripal',$value, $insert_if_missing);
  119. }
  120. /**
  121. *
  122. * @ingroup tripal_api
  123. */
  124. function tripal_analysis_delete_property($analysis_id,$property){
  125. return tripal_core_delete_property('analysis',$analysis_id,$property,'tripal');
  126. }