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

better jbrowse links

parent 923aafba
Branches
No related tags found
No related merge requests found
...@@ -102,36 +102,69 @@ if(count($alignments) > 0){ ?> ...@@ -102,36 +102,69 @@ if(count($alignments) > 0){ ?>
if ($alignment->type == 'contig' && getenv('ENABLE_JBROWSE')) { if ($alignment->type == 'contig' && getenv('ENABLE_JBROWSE')) {
$links = getenv(JBROWSE_LINKS); $links = getenv(JBROWSE_LINKS);
$found_link = false;
if ($links) { if ($links) {
$dlist = explode(';', $links); $dlist = explode(';', $links);
foreach ($dlist as $delem) { foreach ($dlist as $delem) {
$d = explode('>', $delem); $d = explode('>', $delem);
if (substr($alignment->name, 0, strlen($d[0])) === $d[0]) { if (substr($alignment->name, 0, strlen($d[0])) === $d[0]) {
$dataset = "data=data/".$d[1]."&"; $url = "/jbrowse?data=data/".$d[1]."&";
$found_link = true;
break; break;
} }
} }
} }
$feature_loc = "<a href='".$GLOBALS['base_url']."/../jbrowse?".$dataset."loc=".$alignment->name."%3A".($alignment->fmin + 1)."..".$alignment->fmax."'>".$feature_loc."</a>";
if (!$found_link) {
if (getenv('ENABLE_JBROWSE') == "1")
$url = '/jbrowse?';
else {
// Some url was given
$url = getenv('ENABLE_JBROWSE');
if (strpos($url, '?') !== false)
$url .= '&';
else
$url .= '?';
}
}
$feature_loc = "<a href='".$GLOBALS['base_url'].$url."loc=".$alignment->name."%3A".($alignment->fmin + 1)."..".$alignment->fmax."'>".$feature_loc."</a>";
} }
if ($alignment->type == 'contig' && getenv('ENABLE_APOLLO')) { if ($alignment->type == 'contig' && getenv('ENABLE_APOLLO')) {
$links = getenv(APOLLO_LINKS); $links = getenv(APOLLO_LINKS);
if (!$links && getenv(JBROWSE_LINKS)) if (!$links && getenv(JBROWSE_LINKS))
$links = getenv(JBROWSE_LINKS); $links = getenv(JBROWSE_LINKS);
$links = getenv(JBROWSE_LINKS);
$found_link = false;
if ($links) { if ($links) {
$dlist = explode(';', $links); $dlist = explode(';', $links);
foreach ($dlist as $delem) { foreach ($dlist as $delem) {
$d = explode('>', $delem); $d = explode('>', $delem);
if (substr($alignment->name, 0, strlen($d[0])) === $d[0]) { if (substr($alignment->name, 0, strlen($d[0])) === $d[0]) {
$dataset = "data=data/".$d[1]."&"; $url = "/apollo/jbrowse?data=data/".$d[1]."&";
$found_link = true;
break; break;
} }
} }
} }
$feature_loc .= " <a href='".$GLOBALS['base_url']."/../apollo/jbrowse?".$dataset."loc=".$alignment->name."%3A".($alignment->fmin + 1)."..".$alignment->fmax."'>Apollo</a>";
if (!$found_link) {
if (getenv('ENABLE_JBROWSE') == "1")
$url = '/apollo/jbrowse?';
else {
// Some url was given
$url = getenv('ENABLE_JBROWSE');
if (strpos($url, '?') !== false)
$url .= '&';
else
$url .= '?';
}
}
$feature_loc .= " <a href='".$GLOBALS['base_url'].$url."loc=".$alignment->name."%3A".($alignment->fmin + 1)."..".$alignment->fmax."'>Apollo</a>";
} }
$rows[] = array( $rows[] = array(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment