Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?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>';
}