123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458 |
- <?php
- require_once 'api/tripal_feature.DEPRECATED.inc';
- require_once 'theme/tripal_feature.theme.inc';
- require_once 'includes/tripal_feature.admin.inc';
- require_once 'includes/tripal_feature.delete.inc';
- require_once 'includes/tripal_feature.chado_node.inc';
- function tripal_feature_views_api() {
- return array(
- 'api' => 3.0,
- );
- }
- function tripal_feature_help($path, $arg) {
- $output = '';
- switch ($path) {
- case "admin/help#tripal_feature":
- $output='<p>' . t("Displays links to nodes created on this date") . '</p>';
- break;
- }
- return $output;
- }
- function tripal_feature_permission() {
- return array(
-
- );
- }
- function tripal_feature_menu() {
- $items = array();
-
- $items['admin/tripal/legacy/tripal_feature'] = array(
- 'title' => 'Features',
- 'description' => 'A biological sequence or a section of a biological sequence, or a collection of such sections.',
- 'page callback' => 'tripal_feature_admin_feature_view',
- 'access arguments' => array('administer tripal feature'),
- 'type' => MENU_NORMAL_ITEM,
- );
- $items['admin/tripal/legacy/tripal_feature/delete'] = array(
- 'title' => ' Delete',
- 'description' => 'Delete multiple features from Chado',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_feature_delete_form'),
- 'access arguments' => array('administer tripal feature'),
- 'type' => MENU_LOCAL_TASK,
- 'weight' => 2
- );
- $items['admin/tripal/legacy/tripal_feature/sync'] = array(
- 'title' => ' Sync',
- 'description' => 'Create pages on this site for features stored in Chado',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('chado_node_sync_form', 'tripal_feature', 'chado_feature'),
- 'access arguments' => array('administer tripal feature'),
- 'type' => MENU_LOCAL_TASK,
- 'weight' => 1
- );
- $items['admin/tripal/legacy/tripal_feature/chado_feature_toc'] = array(
- 'title' => ' TOC',
- 'description' => 'Manage the table of contents for feature nodes.',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_core_content_type_toc_form', 'chado_feature'),
- 'access arguments' => array('administer tripal feature'),
- 'type' => MENU_LOCAL_TASK,
- 'file' => 'includes/tripal_core.toc.inc',
- 'file path' => drupal_get_path('module', 'tripal_core'),
- 'weight' => 3
- );
- $items['admin/tripal/legacy/tripal_feature/configuration'] = array(
- 'title' => 'Settings',
- 'description' => 'Configure the Tripal Feature module.',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_feature_admin'),
- 'access arguments' => array('administer tripal feature'),
- 'type' => MENU_LOCAL_TASK,
- 'weight' => 5
- );
- $items['admin/tripal/legacy/tripal_feature/help'] = array(
- 'title' => 'Help',
- 'description' => 'Help with the Tripal Feature module.',
- 'page callback' => 'theme',
- 'page arguments' => array('tripal_feature_help'),
- 'access arguments' => array('administer tripal feature'),
- 'type' => MENU_LOCAL_TASK,
- 'weight' => 10
- );
-
- $items['admin/tripal/legacy/tripal_feature/views/features/enable'] = array(
- 'title' => 'Enable feature Administrative View',
- 'page callback' => 'tripal_enable_view',
- 'page arguments' => array('tripal_feature_admin_features', 'admin/tripal/legacy/tripal_feature'),
- 'access arguments' => array('administer tripal feature'),
- 'type' => MENU_CALLBACK,
- );
- return $items;
- }
- function tripal_feature_search_biological_data_views() {
- return array(
- 'tripal_feature_user_features' => array(
- 'machine_name' => 'tripal_feature_user_features',
- 'human_name' => 'Features',
- 'description' => 'A biological sequence or a section of a biological sequence, or a collection of such sections.',
- 'link' => 'chado/feature'
- ),
- );
- }
- function tripal_feature_theme($existing, $type, $theme, $path) {
- $core_path = drupal_get_path('module', 'tripal_core');
-
- $items = array(
- 'node__chado_feature' => array(
- 'template' => 'node--chado-generic',
- 'render element' => 'node',
- 'base hook' => 'node',
- 'path' => "$core_path/theme/templates",
- ),
- 'tripal_feature_alignments' => array(
- 'variables' => array('node' => NULL),
- 'template' => 'tripal_feature_alignments',
- 'path' => "$path/theme/templates",
- ),
- 'tripal_feature_analyses' => array(
- 'variables' => array('node' => NULL),
- 'template' => 'tripal_feature_analyses',
- 'path' => "$path/theme/templates",
- ),
- 'tripal_feature_base' => array(
- 'variables' => array('node' => NULL),
- 'template' => 'tripal_feature_base',
- 'path' => "$path/theme/templates",
- ),
- 'tripal_feature_sequence' => array(
- 'variables' => array('node' => NULL),
- 'template' => 'tripal_feature_sequence',
- 'path' => "$path/theme/templates",
- ),
- 'tripal_feature_proteins' => array(
- 'variables' => array('node' => NULL),
- 'template' => 'tripal_feature_proteins',
- 'path' => "$path/theme/templates",
- ),
- 'tripal_feature_publications' => array(
- 'variables' => array('node' => NULL),
- 'template' => 'tripal_feature_publications',
- 'path' => "$path/theme/templates",
- ),
- 'tripal_feature_synonyms' => array(
- 'variables' => array('node' => NULL),
- 'template' => 'tripal_feature_synonyms',
- 'path' => "$path/theme/templates",
- ),
- 'tripal_feature_references' => array(
- 'variables' => array('node' => NULL),
- 'template' => 'tripal_feature_references',
- 'path' => "$path/theme/templates",
- ),
- 'tripal_feature_properties' => array(
- 'variables' => array('node' => NULL),
- 'template' => 'tripal_feature_properties',
- 'path' => "$path/theme/templates",
- ),
- 'tripal_feature_terms' => array(
- 'variables' => array('node' => NULL),
- 'template' => 'tripal_feature_terms',
- 'path' => "$path/theme/templates",
- ),
- 'tripal_feature_relationships' => array(
- 'variables' => array('node' => NULL),
- 'template' => 'tripal_feature_relationships',
- 'path' => "$path/theme/templates",
- ),
- );
-
- $items['tripal_feature_teaser'] = array(
- 'variables' => array('node' => NULL),
- 'template' => 'tripal_feature_teaser',
- 'path' => "$path/theme/templates",
- );
-
-
- $items['tripal_organism_feature_browser'] = array(
- 'variables' => array('node' => NULL),
- 'template' => 'tripal_organism_feature_browser',
- 'path' => "$path/theme/templates",
- );
- $items['tripal_organism_feature_counts'] = array(
- 'variables' => array('node' => NULL),
- 'template' => 'tripal_organism_feature_counts',
- 'path' => "$path/theme/templates",
- );
-
- $items['tripal_feature_help'] = array(
- 'template' => 'tripal_feature_help',
- 'variables' => array(NULL),
- 'path' => "$path/theme/templates"
- );
-
-
- $items['tripal_feature_bar_chart_type_organism_summary'] = array(
- 'template' => 'tripal_feature_bar_chart_type_organism_summary',
- 'variables' => array(NULL),
- 'path' => "$path/theme/templates"
- );
- return $items;
- }
- function tripal_feature_job_describe_args($callback, $args) {
- $new_args = array();
- if ($callback == 'tripal_feature_load_fasta') {
- $new_args['FASTA file'] = $args[0];
- $organism = chado_select_record('organism', array('genus', 'species'), array('organism_id' => $args[1]));
- $new_args['Organism'] = $organism[0]->genus . " " . $organism[0]->species;
- $new_args['Sequence Type'] = $args[2];
- $new_args['Name Match Type'] = $args[14];
- $new_args['Name RE'] = $args[4];
- $new_args['Unique Name RE'] = $args[5];
-
- $new_args['Relationship Type'] = $args[8];
- $new_args['Relationship Parent RE'] = $args[9];
- $new_args['Relationship Parent Type'] = $args[10];
-
- if ($args[7]) {
- $db = chado_select_record('db', array('name'), array('db_id' => $args[7]));
- }
- $new_args['Database Reference'] = $db[0]->name;
- $new_args['Accession RE'] = $args[6];
- $new_args['Method'] = $args[11];
-
- if ($args[13]) {
- $analysis = chado_select_record('analysis', array('name'), array('analysis_id' => $args[13]));
- }
- $new_args['Analysis'] = $analysis[0]->name;
- }
- if ($callback == 'tripal_feature_delete_features') {
- if ($args[0]) {
- $organism = chado_select_record('organism', array('genus', 'species'), array('organism_id' => $args[0]));
- $new_args['Organism'] = $organism[0]->genus . " " . $organism[0]->species;
- }
- else {
- $new_args['Organism'] = '';
- }
- if ($args[1]) {
- $analysis = chado_select_record('analysis', array('name'), array('analysis_id' => $args[1]));
- $new_args['Analysis'] = $analysis[0]->name;
- }
- else {
- $new_args['Analysis'] = '';
- }
- $new_args['Sequence Type'] = $args[2];
- $new_args['Is Unique Name'] = $args[3] ? 'Yes' : 'No';
- $new_args['Features Names'] = $args[4];
- }
- elseif ($callback == 'tripal_feature_load_gff3') {
- $new_args['GFF File'] = $args[0];
- $organism = chado_select_record('organism', array('genus', 'species'), array('organism_id' => $args[1]));
- $new_args['Organism'] = $organism[0]->genus . " " . $organism[0]->species;
- $analysis = chado_select_record('analysis', array('name'), array('analysis_id' => $args[2]));
- $new_args['Analysis'] = $analysis[0]->name;
- $new_args['Use a Transaction'] = ($args[7] == 1) ? "Yes" : "No";
- $new_args['Import only new features'] = ($args[3] == 1) ? "Yes" : "No";
- $new_args['Import all and update'] = ($args[4] == 1) ? "Yes" : "No";
- $new_args['Import all and replace'] = ($args[5] == 1) ? "Yes" : "No";
- $new_args['Delete features'] = ($args[6] == 1) ? "Yes" : "No";
- if ($args[8]) {
- $target_organism = chado_select_record('organism', array('genus', 'species'), array('organism_id' => $args[8]));
- $new_args['Target organism'] = $target_organism[0]->genus . " " . $target_organism[0]->species;
- }
- else {
- $new_args['Target organism'] = '';
- }
- $new_args['Target type'] = $args[9];
- $new_args['Create target'] = ($args[10] == 1) ? "Yes" : "No";
- $new_args['Starting line'] = $args[11];
- $new_args['Landmark Type'] = $args[12];
- $new_args['Alternate ID attribute'] = $args[13];
- $new_args['Create Organism'] = ($args[14] == 1) ? "Yes" : "No";
- }
- return $new_args;
- }
- function tripal_feature_coder_ignore() {
- return array(
- 'path' => drupal_get_path('module', 'tripal_feature'),
- 'line prefix' => drupal_get_path('module', 'tripal_feature'),
- );
- }
- function tripal_feature_form_alter(&$form, &$form_state, $form_id) {
-
- if ($form_id == "chado_feature_node_form") {
- $form['actions']['preview']['#access'] = FALSE;
-
- unset($form['body']);
- }
- }
- function tripal_feature_exclude_field_from_feature_by_default() {
- return array('residues' => 'TRUE');
- }
|