Tripal v1.0 (6.x-1.0)
tripal_feature.module File Reference

Go to the source code of this file.

Functions

 tripal_feature_init ()
 tripal_feature_views_api ()
 tripal_feature_help ($path, $arg)
 tripal_feature_node_info ()
 tripal_feature_perm ()
 chado_feature_access ($op, $node, $account)
 tripal_feature_menu ()
 tf_node_load ($nid)
 tripal_feature_theme ()
 tripal_feature_block ($op= 'list', $delta=0, $edit=array())
 chado_feature_insert ($node)
 chado_feature_update ($node)
 chado_feature_delete ($node)
 chado_feature_add_synonyms ($synonyms, $feature_id)
 chado_feature_add_gbaccession ($accession, $feature_id)
 chado_feature_form ($node, $param)
 chado_feature_validate ($node)
 chado_feature_load ($node)
 tripal_feature_load_organism ($organism_id)
 tripal_feature_load_synonyms ($feature_id)
 tripal_feature_load_properties ($feature_id)
 tripal_feature_load_references ($feature_id)
 tripal_feature_load_featurelocs ($feature_id, $side= 'as_parent', $aggregate=1)
 tripal_feature_sort_locations ($a, $b)
 tripal_feature_load_relationships ($feature_id, $side= 'as_subject')
 tripal_feature_get_aggregate_relationships ($feature_id, $substitute=1, $levels=0, $base_type_id=NULL, $depth=0)
 tripal_feature_load_featureloc_sequences ($feature_id, $featurelocs)
 tripal_feature_get_matched_alignments ($feature)
 tripal_feature_load_organism_feature_counts ($organism)
 tripal_feature_load_organism_feature_browser ($organism)
 tripal_feature_load_library_feature_browser ($library)
 tripal_feature_load_analysis_feature_browser ($analysis)
 tripal_feature_sort_rel_objects ($a, $b)
 tripal_feature_sort_rel_parts_by_start ($a, $b)
 tripal_feature_sort_rel_parts_by_end ($a, $b)
 tripal_feature_color_sequence ($sequence, $parts, $defline)
 chado_feature_view ($node, $teaser=FALSE, $page=FALSE)
 tripal_feature_nodeapi (&$node, $op, $teaser, $page)
 tripal_feature_preprocess_tripal_feature_relationships (&$variables)
 tripal_feature_preprocess_tripal_feature_alignments (&$variables)
 tripal_feature_preprocess_tripal_organism_feature_counts (&$variables)
 tripal_feature_preprocess_tripal_organism_feature_browser (&$variables)
 tripal_feature_preprocess_tripal_library_feature_browser (&$variables)
 tripal_feature_preprocess_tripal_analysis_feature_browser (&$variables)
 tripal_feature_cv_chart ($chart_id)
 tripal_feature_cv_tree ($tree_id)
 tripal_feature_del_vocabulary ()
 tripal_feature_return_fasta ($feature, $desc)
 tripal_feature_job_describe_args ($callback, $args)
 tripal_feature_coder_ignore ()
 tripal_feature_match_features_page ($id)

Detailed Description

Definition in file tripal_feature.module.


Function Documentation

tripal_feature_coder_ignore ( )

Implements hook_coder_ignore(). Defines the path to the file (tripal_core.coder_ignores.txt) where ignore rules for coder are stored

Definition at line 2274 of file tripal_feature.module.

                                       {
  return array(
    'path' => drupal_get_path('module', 'tripal_feature'),
    'line prefix' => drupal_get_path('module', 'tripal_feature'),
  );
}
tripal_feature_match_features_page ( id)

Definition at line 2287 of file tripal_feature.module.

                                                 {

  $sql = "
    SELECT 
      F.name, F.uniquename, F.feature_id, 
      O.genus, O.species, O.organism_id, 
      CVT.cvterm_id, CVT.name as type_name, 
      CF.nid, 
      array_agg(S.name) as synonyms 
    FROM feature F 
      INNER JOIN organism O on F.organism_id = O.organism_id 
      INNER JOIN cvterm CVT on CVT.cvterm_id = F.type_id 
      LEFT JOIN feature_synonym FS on FS.feature_id = F.feature_id 
      LEFT JOIN synonym S on S.synonym_id = FS.synonym_id 
      INNER JOIN public.chado_feature CF on CF.feature_id = F.feature_id 
    WHERE 
      F.uniquename = '%s' or 
      F.name = '%s' or 
      S.name = '%s' 
    GROUP BY F.name, F.uniquename, F.feature_id, O.genus, O.species, 
      O.organism_id, CVT.cvterm_id, CVT.name, CF.nid
  ";
  $results = chado_query($sql, $id, $id, $id);
  
  $num_matches = 0;
  
  // iterate through the matches and build the table for showing matches
  $header = array('Uniquename', 'Name', 'Type', 'Species', 'Synonyms');
  $rows = array();
  $curr_match;
  while ($match = db_fetch_object($results)) {
    $curr_match = $match;
    $synonyms = $match->synonyms;
    $synonyms = preg_replace('/[\"\{\}]/', '', $synonyms);
    $rows[] = array(
       $match->uniquename,
       "<a href=\"" . url("node/". $match->nid) ."\">" . $match->name . "</a>",
       $match->type_name,
       '<i>' . $match->genus . ' ' . $match->species . '</i>',
       $synonyms,
    ); 
    $num_matches++;   
  }
  
  // if we have more than one match then generate the table, otherwise, redirect
  // to the matched feature
  if ($num_matches == 1) {
    drupal_goto(url("node/". $curr_match->nid));
  }
  if ($num_matches == 0) {
    return "<p>No features matched the given name '$id'</p>";
  }
  
  $table_attrs = array(
    'class' => 'tripal-table tripal-table-horz'
  );
  $output = "<p>The following features match the name '$id'.</p>";
  $output .= theme_table($header, $rows, $table_attrs, $caption);
  return $output;
}
 All Classes Files Functions Variables