Skip to content
Snippets Groups Projects
Commit a2eab5d5 authored by Anthony Bretaudeau's avatar Anthony Bretaudeau
Browse files

add aureme and orthology stuff

parent 6ff3c935
No related branches found
No related tags found
No related merge requests found
<?php
$feature = $variables['node']->feature;
if ($feature->type_id->name == 'polypeptide') {
foreach ($feature->feature_relationship->subject_id as $rel) {
if ($rel->object_id->type_id->name == 'mRNA') {
$mrna_feat = chado_expand_var($rel->object_id, 'table', 'feature_relationship');
if (count($mrna_feat->feature_relationship->subject_id) == 0) {
// In some cases we might only have mRNA with no genes (brassica napus or transcriptomes
$target_id = $mrna_feat->uniquename;
echo '<a href="' . getenv('ENABLE_AUREME_LINKS') . $target_id . '">View data from metabolic model for ' . $feature->uniquename . '</a>';
break;
}
foreach ($mrna_feat->feature_relationship->subject_id as $rel_g) {
if ($rel_g->type_id->name == 'gene') {
$target_id = $rel_g->uniquename;
echo '<a href="' . getenv('ENABLE_AUREME_LINKS') . $target_id . '">View data from metabolic model for ' . $feature->uniquename . '</a>';
break;
}
}
}
}
}
else if ($feature->type_id->name == 'mRNA') {
if (count($feature->feature_relationship->subject_id) == 0) {
// In some cases we might only have mRNA with no genes (brassica napus or transcriptomes
$target_id = $feature->uniquename;
echo '<a href="' . getenv('ENABLE_AUREME_LINKS') . $target_id . '">View data from metabolic model for ' . $feature->uniquename . '</a>';
}
foreach ($feature->feature_relationship->subject_id as $rel) {
if ($rel->object_id->type_id->name == 'gene') {
$target_id = $rel->object_id->uniquename;
echo '<a href="' . getenv('ENABLE_AUREME_LINKS') . $target_id . '">View data from metabolic model for ' . $feature->uniquename . '</a>';
break;
}
}
}
else if ($feature->type_id->name == 'gene') {
echo '<a href="' . getenv('ENABLE_AUREME_LINKS') . $feature->uniquename . '">View data from metabolic model for ' . $feature->uniquename . '</a>';
}
<?php
$feature = $variables['node']->feature;
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;
}
}
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment