$analysis_id, 'feature_id' => $feature_id); $result = tripal_core_chado_select('analysisfeature', $columns, $values); $analysisfeature_id = $result[0]->analysisfeature_id; } // get the property. return tripal_core_get_property('analysisfeature', $analysisfeature_id, $property, $cv_name); } /** * Insert a property for an analysis feature * * @param $analysis_id * The analysis ID for the analysis feature. This argument is optional but * if specified it must also be accompanied with a feature ID. * @param $feature_id * The feature ID for the analysis feature. This argument is optional but * if specified it must also be accompanied with an analysis ID. * @param $analysisfeature_id * The analysis feature ID for the analysis feature. This argument is * optional and can be used rather than specifying the $analysis_id and * $feature_id arguments. If all three arguments are specified (e.g. * an $analysis_id, $feature_id and $analysisfeature_id, then the * $analysisfeature_id is used and the other two arguments are ignored. * @param $property * The cvterm name of the property to insert * @param $value * The value of the property to insert * @param $update_if_present * A boolean indicated whether to update the record if it's already present * @param $cv_name * Optional. The name of the cv to which the property belongs. By * default this is the 'tripal' cv. * * @return * True of success, False otherwise * * @ingroup tripal_feature_api */ function tripal_feature_analysis_insert_property($analysis_id = NULL, $feature_id = NUll, $analysisfeature_id = NULL, $property, $value, $update_if_present = 0, $cv_name = 'tripal') { // check that the incoming arguments are correct if (($analysis_id and !$feature_id) or (!$analysis_id and $feature_id)) { watchdog('tripal_feature', 'tripal_feature_analysis_insert_property: Both an analysis ID and feature ID should be specified', array(), WATCHDOG_WARNING); } // get the analysisfeature_id if one is not provided if (!$analysisfeature_id) { $columns = array('analysisfeature_id'); $values = array('analysis_id' => $analysis_id, 'feature_id' => $feature_id); $result = tripal_core_chado_select('analysisfeature', $columns, $values); $analysisfeature_id = $result[0]->analysisfeature_id; } // insert the property. return tripal_core_insert_property('analysisfeature', $analysisfeature_id, $property, $cv_name, $value, $update_if_present); } /** * Update an analysis feature property using the property name. Use this * when a property only exists once for a given analysis feature. When more * than one value can exist for the same property use the * tripal_feature_analysis_update_property_by_id() function. * * @param $analysis_id * The analysis ID for the analysis feature. This argument is optional but * if specified it must also be accompanied with a feature ID. * @param $feature_id * The feature ID for the analysis feature. This argument is optional but * if specified it must also be accompanied with an analysis ID. * @param $analysisfeature_id * The analysis feature ID for the analysis feature. This argument is * optional and can be used rather than specifying the $analysis_id and * $feature_id arguments. If all three arguments are specified (e.g. * an $analysis_id, $feature_id and $analysisfeature_id, then the * $analysisfeature_id is used and the other two arguments are ignored. * @param $property * The cvterm name of the property to update * @param $value * The value of the property to update * @param $insert_if_missing * A boolean indicated whether to insert the record if it's absent * @param $cv_name * Optional. The name of the cv to which the property belongs. By * default this is the 'tripal' cv. * * Note: The property will be identified using the unique combination of the $analysis_id and $property * and then it will be updated with the supplied value * * @return * True of success, False otherwise * * @ingroup tripal_feature_api */ function tripal_feature_analysis_update_property($analysis_id = NULL, $feature_id = NUll, $analysisfeature_id = NULL, $property, $value, $insert_if_missing = 0, $cv_name = 'tripal') { // check that the incoming arguments are correct if (($analysis_id and !$feature_id) or (!$analysis_id and $feature_id)) { watchdog('tripal_feature', 'tripal_feature_analysis_update_property: Both an analysis ID and feature ID should be specified', array(), WATCHDOG_WARNING); } // get the analysisfeature_id if one is not provided if (!$analysisfeature_id) { $columns = array('analysisfeature_id'); $values = array('analysis_id' => $analysis_id, 'feature_id' => $feature_id); $result = tripal_core_chado_select('analysisfeature', $columns, $values); $analysisfeature_id = $result[0]->analysisfeature_id; } // update the property. return tripal_core_update_property('analysisfeature', $analysisfeature_id, $property, $cv_name, $value, $insert_if_missing); } /** * Update a property for an analysis feature using the analysisfeatureprop_id. * * @param $analysisfeatureprop_id * The analysis feature property ID for the analysis feature. * @param $property * The cvterm name of the property * @param $value * The value of the property * @param $cv_name * Optional. The name of the cv to which the property belongs. By * default this is the 'tripal' cv. * * * @return * True of success, False otherwise * * @ingroup tripal_feature_api */ function tripal_feature_analysis_update_property_by_id($analysisfeatureprop_id, $property, $value, $cv_name = 'tripal') { // update the property. return tripal_core_update_property_by_id('analysisfeature', $analysisfeatureprop_id, $property, $cv_name, $value); } /** * Delete an analysis feature property using the property name. Use this * when a property only exists once for a given analysis feature. When more * than one value can exist for the same property use the * tripal_feature_analysis_delete_property_by_id() function. * * @param $analysis_id * The analysis ID for the analysis feature. This argument is optional but * if specified it must also be accompanied with a feature ID. * @param $feature_id * The feature ID for the analysis feature. This argument is optional but * if specified it must also be accompanied with an analysis ID. * @param $analysisfeature_id * The analysis feature ID for the analysis feature. This argument is * optional and can be used rather than specifying the $analysis_id and * $feature_id arguments. If all three arguments are specified (e.g. * an $analysis_id, $feature_id and $analysisfeature_id, then the * $analysisfeature_id is used and the other two arguments are ignored. * @param $property * The cvterm name of the property to delete * @param $cv_name * Optional. The name of the cv to which the property belongs. By * default this is the 'tripal' cv. * * Note: The property will be identified using the unique combination of the $analysis_id and $property * and then it will be deleted * * @return * True of success, False otherwise * * @ingroup tripal_feature_api */ function tripal_feature_analysis_delete_property($analysis_id = NULL, $feature_id = NUll, $analysisfeature_id = NULL, $property, $cv_name = 'tripal') { // check that the incoming arguments are correct if (($analysis_id and !$feature_id) or (!$analysis_id and $feature_id)) { watchdog('tripal_feature', 'tripal_feature_analysis_delete_property: Both an analysis ID and feature ID should be specified', array(), WATCHDOG_WARNING); } // get the analysisfeature_id if one is not provided if (!$analysisfeature_id) { $columns = array('analysisfeature_id'); $values = array('analysis_id' => $analysis_id, 'feature_id' => $feature_id); $result = tripal_core_chado_select('analysisfeature', $columns, $values); $analysisfeature_id = $result[0]->analysisfeature_id; } // get the property. return tripal_core_delete_property('analysisfeature', $analysisfeature_id, $property, $cv_name); } /** * Delete a property using the analysisfeatureprop_id * * @param $analysisfeatureprop_id * The analysis feature property ID for the analysis feature. * * @return * True of success, False otherwise * * @ingroup tripal_feature_api */ function tripal_feature_analysis_delete_property_by_id($analysisfeatureprop_id) { // get the property. return tripal_core_delete_property_by_id('analysisfeature', $analysisfeatureprop_id); } /** * Retrieve properties of a given type for a given feature * * @param $feature_id * The feature_id of the properties you would like to retrieve * @param $property * The cvterm name of the properties to retrieve * @param $cv_name * Optional. The name of the cv to which the property belongs. By * default this is the 'tripal' cv. * * @return * A feature chado variable with the specified properties expanded * * @ingroup tripal_feature_api */ function tripal_feature_get_property($feature_id, $property, $cv_name='tripal') { return tripal_core_get_property('feature', $feature_id, $property, $cv_name); } /** * Insert a given property * * @param $feature_id * The feature_id of the property to insert * @param $property * The cvterm name of the property to insert * @param $value * The value of the property to insert * @param $update_if_present * A boolean indicated whether to update the record if it's already present * @param $cv_name * Optional. The name of the cv to which the property belongs. By * default this is the 'tripal' cv. * * @return * True of success, False otherwise * * @ingroup tripal_feature_api */ function tripal_feature_insert_property($feature_id, $property, $value, $update_if_present = 0, $cv_name = 'tripal') { return tripal_core_insert_property('feature', $feature_id, $property, $cv_name, $value, $update_if_present); } /** * Update a feature property using the property name. Only use this * if the property is unique and only exist once for the feature. * * @param $feature_id * The feature_id of the property to update * @param $property * The cvterm name of the property to update * @param $value * The value of the property to update * @param $insert_if_missing * A boolean indicated whether to insert the record if it's absent * @param $cv_name * Optional. The name of the cv to which the property belongs. By * default this is the 'tripal' cv. * * Note: The property will be identified using the unique combination of the $feature_id and $property * and then it will be updated with the supplied value * * @return * True of success, False otherwise * * @ingroup tripal_feature_api */ function tripal_feature_update_property($feature_id, $property, $value, $insert_if_missing = 0, $cv_name = 'tripal') { return tripal_core_update_property('feature', $feature_id, $property, $cv_name, $value, $insert_if_missing); } /** * Update a given feature property using the featureprop_id * * @param $featureprop_id * The featureprop_id of the property to update * @param $property * The cvterm name of the property * @param $value * The value of the property * @param $cv_name * Optional. The name of the cv to which the property belongs. By * default this is the 'tripal' cv. * * @return * True of success, False otherwise * * @ingroup tripal_feature_api */ function tripal_feature_update_property_by_id($featureprop_id, $property, $value, $cv_name = 'tripal') { return tripal_core_update_property_by_id('feature', $featureprop_id, $property, $cv_name, $value); } /** * Delete a given feature property using the property name. Only use this * if the property is unique and only exists once for the feature. * * @param $feature_id * The feature_id of the property to delete * @param $property * The cvterm name of the property to delete * @param $cv_name * Optional. The name of the cv to which the property belongs. By * default this is the 'tripal' cv. * * Note: The property will be identified using the unique combination of the $feature_id and $property * and then it will be deleted * * @return * True of success, False otherwise * * @ingroup tripal_feature_api */ function tripal_feature_delete_property($feature_id, $property, $cv_name='tripal') { return tripal_core_delete_property('feature', $feature_id, $property, $cv_name); } /** * Delete a given feature property using the featureprop_id * * @param $featureprop_id * The feature_id of the property to delete * * @return * True of success, False otherwise * * @ingroup tripal_feature_api */ function tripal_feature_delete_property_by_id($featureprop_id) { return tripal_core_delete_property_by_id('feature', $featureprop_id); }