|
@@ -532,6 +532,17 @@ function tripal_chado_bundle_fields_info_custom(&$info, $details, $entity_type,
|
|
|
'type' => 'field_chado_storage',
|
|
|
),
|
|
|
);
|
|
|
+ $field_name = 'efo__array_design';
|
|
|
+ $field_type = 'efo__array_design';
|
|
|
+ $info[$field_name] = array(
|
|
|
+ 'field_name' => $field_name,
|
|
|
+ 'type' => $field_type,
|
|
|
+ 'cardinality' => 1,
|
|
|
+ 'locked' => FALSE,
|
|
|
+ 'storage' => array(
|
|
|
+ 'type' => 'field_chado_storage',
|
|
|
+ ),
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
// For the pub_id field in the base table.
|
|
@@ -554,7 +565,6 @@ function tripal_chado_bundle_fields_info_custom(&$info, $details, $entity_type,
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -702,8 +712,24 @@ function tripal_chado_bundle_fields_info_linker(&$info, $details, $entity_type,
|
|
|
}
|
|
|
|
|
|
$field_name = strtolower(preg_replace('/[^\w]/','_', $term->dbxref_id->db_id->name . '__' . $term->name));
|
|
|
- $field_name = substr($field_name, 0, 32);
|
|
|
+
|
|
|
+ // The field name can only be 32 chars, but if our name is longer we need
|
|
|
+ // to add some random chars to ensure we don't have naming conflicts
|
|
|
+ // with other terms (e.g. mitochondrial_genetic_code and
|
|
|
+ // mitochondrial_genetic_code_name)
|
|
|
+ if (strlen($field_name) >= 32) {
|
|
|
+ $field_name = substr($field_name, 0, 20) . '_' . $term->cvterm_id;
|
|
|
+ }
|
|
|
$field_type = 'chado_linker__prop';
|
|
|
+
|
|
|
+ // Don't try to add a property that uses the same term as another field.
|
|
|
+ if (array_key_exists($field_name, $info)) {
|
|
|
+ tripal_report_error('chado_fields', TRIPAL_WARNING,
|
|
|
+ 'A field of type !type already exists, yet a property wants to use the same term. The property cannot be added.',
|
|
|
+ ['!type' => $field_name],
|
|
|
+ ['drupal_set_message' => TRUE]);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
$info[$field_name] = array(
|
|
|
'field_name' => $field_name,
|
|
|
'type' => $field_type,
|
|
@@ -832,7 +858,6 @@ function tripal_chado_bundle_instances_info($entity_type, $bundle) {
|
|
|
tripal_chado_bundle_instances_info_base($info, $entity_type, $bundle, $details);
|
|
|
tripal_chado_bundle_instances_info_custom($info, $entity_type, $bundle, $details);
|
|
|
tripal_chado_bundle_instances_info_linker($info, $entity_type, $bundle, $details);
|
|
|
-
|
|
|
return $info;
|
|
|
|
|
|
}
|
|
@@ -1016,11 +1041,11 @@ function tripal_chado_bundle_instances_info_base(&$info, $entity_type, $bundle,
|
|
|
}
|
|
|
if ($base_info['label'] == 'Timeaccessioned') {
|
|
|
$base_info['label'] = 'Time Accessioned';
|
|
|
- $base_info['description'] = 'Please enter the time that this record was first added to the database.';
|
|
|
+ $base_info['description'] = 'The time that this record was first added to the database.';
|
|
|
}
|
|
|
if ($base_info['label'] == 'Timelastmodified') {
|
|
|
$base_info['label'] = 'Time Last Modified';
|
|
|
- $base_info['description'] = 'Please enter the time that this record was last modified. The default is the current time.';
|
|
|
+ $base_info['description'] = 'The time that this record was last modified. The default is the current time.';
|
|
|
}
|
|
|
|
|
|
// Sometimes the boolean fields are listed as integer. We need to
|
|
@@ -1178,6 +1203,8 @@ function tripal_chado_bundle_instances_info_base(&$info, $entity_type, $bundle,
|
|
|
if ($column_name == 'name') {
|
|
|
$base_info['widget']['type'] = 'text_textfield';
|
|
|
$base_info['settings']['text_processing'] = '0';
|
|
|
+ $base_info['required'] = TRUE;
|
|
|
+ $base_info['description'] = 'A unique name for this assay..';
|
|
|
}
|
|
|
if ($column_name == 'protcol_id') {
|
|
|
$base_info['label'] = 'Protocol';
|
|
@@ -1186,20 +1213,24 @@ function tripal_chado_bundle_instances_info_base(&$info, $entity_type, $bundle,
|
|
|
$base_info['label'] = 'Array Batch Identifier';
|
|
|
$base_info['widget']['type'] = 'text_textfield';
|
|
|
$base_info['settings']['text_processing'] = '0';
|
|
|
+ $base_info['description'] = 'A unique identifier for the array batch.';
|
|
|
}
|
|
|
if ($column_name == 'operator_id') {
|
|
|
$base_info['label'] = 'Operator';
|
|
|
+ $base_info['description'] = 'The individual who performed the assay.';
|
|
|
}
|
|
|
if ($column_name == 'arrayidentifier') {
|
|
|
$base_info['label'] = 'Array Identifier';
|
|
|
$base_info['widget']['type'] = 'text_textfield';
|
|
|
$base_info['settings']['text_processing'] = '0';
|
|
|
+ $base_info['description'] = 'A unique alternate identifier for the array.';
|
|
|
}
|
|
|
if ($column_name == 'arraydesign_id') {
|
|
|
$base_info['label'] = 'Array Design';
|
|
|
}
|
|
|
if ($column_name == 'assaydate') {
|
|
|
$base_info['label'] = 'Assay Date';
|
|
|
+ $base_info['description'] = 'The date the assay was performed';
|
|
|
}
|
|
|
}
|
|
|
//
|
|
@@ -1287,6 +1318,9 @@ function tripal_chado_bundle_instances_info_custom(&$info, $entity_type, $bundle
|
|
|
'base_table' => $table_name,
|
|
|
'vocabulary' => $default_vocab,
|
|
|
'parent_term' => $parent_term,
|
|
|
+ 'term_vocabulary' => 'schema',
|
|
|
+ 'term_name' => 'additionalType',
|
|
|
+ 'term_accession' => 'additionalType',
|
|
|
),
|
|
|
'widget' => array(
|
|
|
'type' => 'schema__additional_type_widget',
|
|
@@ -1527,6 +1561,10 @@ function tripal_chado_bundle_instances_info_custom(&$info, $entity_type, $bundle
|
|
|
// BASE DBXREF
|
|
|
if (array_key_exists('dbxref_id', $schema['fields'])) {
|
|
|
$field_name = 'data__accession';
|
|
|
+ $required = FALSE;
|
|
|
+ if ($table == 'phylotree') {
|
|
|
+ $required = TRUE;
|
|
|
+ }
|
|
|
$info[$field_name] = array(
|
|
|
'field_name' => $field_name,
|
|
|
'entity_type' => $entity_type,
|
|
@@ -1534,7 +1572,7 @@ function tripal_chado_bundle_instances_info_custom(&$info, $entity_type, $bundle
|
|
|
'label' => 'Accession',
|
|
|
'description' => 'This field specifies the unique stable accession (ID) for
|
|
|
this record. It requires that this site have a database entry.',
|
|
|
- 'required' => FALSE,
|
|
|
+ 'required' => $required,
|
|
|
'settings' => array(
|
|
|
'auto_attach' => TRUE,
|
|
|
'chado_table' => $table_name,
|
|
@@ -1772,6 +1810,9 @@ function tripal_chado_bundle_instances_info_custom(&$info, $entity_type, $bundle
|
|
|
'chado_table' => 'organism',
|
|
|
'chado_column' => 'type_id',
|
|
|
'base_table' => 'organism',
|
|
|
+ 'term_vocabulary' => 'TAXRANK',
|
|
|
+ 'term_name' => 'infraspecific_taxon',
|
|
|
+ 'term_accession' => '0000046',
|
|
|
),
|
|
|
'widget' => array(
|
|
|
'type' => 'taxrank__infraspecific_taxon_widget',
|
|
@@ -1973,6 +2014,9 @@ function tripal_chado_bundle_instances_info_custom(&$info, $entity_type, $bundle
|
|
|
'chado_table' => $table_name,
|
|
|
'chado_column' => 'pub_id',
|
|
|
'base_table' => $table_name,
|
|
|
+ 'term_accession' => 'publication',
|
|
|
+ 'term_vocabulary' => 'schema',
|
|
|
+ 'term_name' => 'publication',
|
|
|
),
|
|
|
'widget' => array(
|
|
|
'type' => 'schema__publication_widget',
|
|
@@ -2027,7 +2071,80 @@ function tripal_chado_bundle_instances_info_custom(&$info, $entity_type, $bundle
|
|
|
),
|
|
|
),
|
|
|
);
|
|
|
+
|
|
|
+ $field_name = 'efo__array_design';
|
|
|
+ $info[$field_name] = array(
|
|
|
+ 'field_name' => $field_name,
|
|
|
+ 'entity_type' => $entity_type,
|
|
|
+ 'bundle' => $bundle->name,
|
|
|
+ 'label' => 'Array design',
|
|
|
+ 'description' => 'An instrument design which describes the design of the array.',
|
|
|
+ 'required' => TRUE,
|
|
|
+ 'settings' => array(
|
|
|
+ 'auto_attach' => TRUE,
|
|
|
+ 'chado_table' => 'assay',
|
|
|
+ 'chado_column' => 'arraydesign_id',
|
|
|
+ 'base_table' => 'assay',
|
|
|
+ 'term_vocabulary' => 'EFO',
|
|
|
+ 'term_name' => 'array design',
|
|
|
+ 'term_accession' => '0000269',
|
|
|
+
|
|
|
+ ),
|
|
|
+ 'widget' => array(
|
|
|
+ 'type' => 'efo__array_design_widget',
|
|
|
+ 'settings' => array(
|
|
|
+ 'display_label' => 1,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ 'display' => array(
|
|
|
+ 'default' => array(
|
|
|
+ 'label' => 'inline',
|
|
|
+ 'type' => 'efo__array_design_formatter',
|
|
|
+ 'settings' => array(),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ );
|
|
|
}
|
|
|
+ // Analysis Id
|
|
|
+ if (array_key_exists('analysis_id', $schema['fields'])) {
|
|
|
+ $field_name = 'operation__analysis';
|
|
|
+ $is_required = FALSE;
|
|
|
+ if (array_key_exists('not null', $schema['fields']['analysis_id']) and
|
|
|
+ $schema['fields']['analysis_id']['not null']) {
|
|
|
+ $is_required = TRUE;
|
|
|
+ }
|
|
|
+ $info[$field_name] = array(
|
|
|
+ 'field_name' => $field_name,
|
|
|
+ 'entity_type' => $entity_type,
|
|
|
+ 'bundle' => $bundle->name,
|
|
|
+ 'label' => 'Analysis',
|
|
|
+ 'description' => 'Application of analytical methods to existing data of a specific type.',
|
|
|
+ 'required' => $is_required,
|
|
|
+ 'settings' => array(
|
|
|
+ 'auto_attach' => TRUE,
|
|
|
+ 'chado_table' => $table_name,
|
|
|
+ 'chado_column' => 'analysis_id',
|
|
|
+ 'base_table' => $table_name,
|
|
|
+ 'term_vocabulary' => 'operation',
|
|
|
+ 'term_name' => 'Analysis',
|
|
|
+ 'term_accession' => '2945',
|
|
|
+
|
|
|
+ ),
|
|
|
+ 'widget' => array(
|
|
|
+ 'type' => 'operation__analysis_widget',
|
|
|
+ 'settings' => array(
|
|
|
+ 'display_label' => 0,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ 'display' => array(
|
|
|
+ 'default' => array(
|
|
|
+ 'label' => 'inline',
|
|
|
+ 'type' => 'operation__analysis_formatter',
|
|
|
+ 'settings' => array(),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2095,6 +2212,9 @@ function tripal_chado_bundle_instances_info_linker(&$info, $entity_type, $bundle
|
|
|
'chado_table' => $dbxref_table,
|
|
|
'chado_column' => $pkey,
|
|
|
'base_table' => $table_name,
|
|
|
+ 'term_vocabulary' => 'SBO',
|
|
|
+ 'term_name' => 'Database Cross Reference',
|
|
|
+ 'term_accession' => '0000554',
|
|
|
),
|
|
|
'widget' => array(
|
|
|
'type' => 'sbo__database_cross_reference_widget',
|
|
@@ -2377,7 +2497,13 @@ function tripal_chado_bundle_instances_info_linker(&$info, $entity_type, $bundle
|
|
|
}
|
|
|
|
|
|
$field_name = strtolower(preg_replace('/[^\w]/','_', $term->dbxref_id->db_id->name . '__' . $term->name));
|
|
|
- $field_name = substr($field_name, 0, 32);
|
|
|
+ // The field name can only be 32 chars, but if our name is longer we need
|
|
|
+ // to add some random chars to ensure we don't have naming conflicts
|
|
|
+ // with other terms (e.g. mitochondrial_genetic_code and
|
|
|
+ // mitochondrial_genetic_code_name)
|
|
|
+ if (strlen($field_name) >= 32) {
|
|
|
+ $field_name = substr($field_name, 0, 20) . '_' . $term->cvterm_id;
|
|
|
+ }
|
|
|
$info[$field_name] = array(
|
|
|
'field_name' => $field_name,
|
|
|
'entity_type' => $entity_type,
|
|
@@ -2448,6 +2574,9 @@ function tripal_chado_bundle_instances_info_linker(&$info, $entity_type, $bundle
|
|
|
'chado_table' => $term_table,
|
|
|
'chado_column' => $pkey,
|
|
|
'base_table' => $table_name,
|
|
|
+ 'term_vocabulary' => 'SIO',
|
|
|
+ 'term_name' => 'annotation',
|
|
|
+ 'term_accession' => '001166',
|
|
|
),
|
|
|
'widget' => array(
|
|
|
'type' => 'sio__annotation_widget',
|
|
@@ -2483,6 +2612,9 @@ function tripal_chado_bundle_instances_info_linker(&$info, $entity_type, $bundle
|
|
|
'chado_table' => $pub_table,
|
|
|
'chado_column' => $pkey,
|
|
|
'base_table' => $table_name,
|
|
|
+ 'term_accession' => 'publication',
|
|
|
+ 'term_vocabulary' => 'schema',
|
|
|
+ 'term_name' => 'publication',
|
|
|
),
|
|
|
'widget' => array(
|
|
|
'type' => 'schema__publication_widget',
|
|
@@ -2555,6 +2687,9 @@ function tripal_chado_bundle_instances_info_linker(&$info, $entity_type, $bundle
|
|
|
'chado_table' => $rel_table,
|
|
|
'chado_column' => $pkey,
|
|
|
'base_table' => $table_name,
|
|
|
+ 'term_vocabulary' => 'SBO',
|
|
|
+ 'term_name' => 'Relationship',
|
|
|
+ 'term_accession' => '0000374',
|
|
|
),
|
|
|
'widget' => array(
|
|
|
'type' => 'sbo__relationship_widget',
|