Skip to content
Snippets Groups Projects
Select Git revision
  • 6249a54effc5c8de89ba89ebff8df303b78ad62f
  • master default protected
  • dev
  • master_gitlab_inria_tripal_bipaa
  • u_pinnafitida
5 results

tripal_orthology_links.tpl.php

Blame
  • tripal_orthology_links.tpl.php 1.57 KiB
    <?php
    $feature = $variables['node']->feature;
    
    if (preg_match('/v2.1b/', $feature->analysisfeature[0]->analysis_id->name) >= 1) {
        echo "";
    }
    else if ($feature->type_id->name == 'polypeptide') {
        $target_id = $feature->uniquename;
        echo '<a href="' . getenv('ENABLE_ORTHOLOGY_LINKS') . 'chado_gene_phylotree?gene_name=' . $target_id . '">View orthology data for ' . $feature->uniquename . '</a>';
    }
    else if ($feature->type_id->name == 'mRNA') {
        foreach ($feature->feature_relationship->object_id as $rel) {
            if ($rel->subject_id->type_id->name == 'polypeptide') {
                $target_id = $rel->subject_id->uniquename;
                echo '<a href="' . getenv('ENABLE_ORTHOLOGY_LINKS') . 'chado_gene_phylotree?gene_name=' . $target_id . '">View orthology data for ' . $feature->uniquename . '</a>';
                break;
            }
        }
    }
    else if ($feature->type_id->name == 'gene') {
        foreach ($feature->feature_relationship->object_id as $rel) {
            if ($rel->subject_id->type_id->name == 'mRNA') {
                $mrna_feat = chado_expand_var($rel->subject_id, 'table', 'feature_relationship');
                foreach ($mrna_feat->feature_relationship->object_id as $rel_g) {
                    if ($rel_g->subject_id->type_id->name == 'polypeptide') {
                        $target_id = $rel_g->subject_id->uniquename;
                        echo '<p><a href="' . getenv('ENABLE_ORTHOLOGY_LINKS') . 'chado_gene_phylotree?gene_name=' . $target_id . '">View orthology data for ' . $rel_g->subject_id->uniquename . '</a></p>';
                        break;
                    }
                }
            }
        }
    }