You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2017/02/20 14:27:47 UTC
[1/2] airavata-php-gateway git commit: Rbase64; remove queue name;
download link
Repository: airavata-php-gateway
Updated Branches:
refs/heads/dreg-gateway 75929d779 -> 8f3d7621e
Rbase64; remove queue name; download link
Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/d4263980
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/d4263980
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/d4263980
Branch: refs/heads/dreg-gateway
Commit: d4263980c860a943560482f58bf9c7bd1321b780
Parents: d5533b0
Author: root <ro...@osboxes>
Authored: Sat Feb 18 00:24:13 2017 +0000
Committer: root <ro...@osboxes>
Committed: Sat Feb 18 00:24:13 2017 +0000
----------------------------------------------------------------------
app/libraries/basecode.php | 119 +++++---------------
app/routes.php | 24 ++--
app/views/partials/experiment-info.blade.php | 16 ++-
app/views/partials/experiment-inputs.blade.php | 11 +-
4 files changed, 58 insertions(+), 112 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d4263980/app/libraries/basecode.php
----------------------------------------------------------------------
diff --git a/app/libraries/basecode.php b/app/libraries/basecode.php
index bab9fd2..d61f2f9 100644
--- a/app/libraries/basecode.php
+++ b/app/libraries/basecode.php
@@ -1,98 +1,35 @@
<?php
-class Base32
+class RBase64
{
- const BITS_5_RIGHT = 31;
- protected static $CHARS = '0123456789abcdefghijklmnopqrstuv';
-
- public static function encode($data)
- {
- $dataSize = strlen($data);
- $res = '';
- $remainder = 0;
- $remainderSize = 0;
-
- for ($i = 0; $i < $dataSize; $i++)
- {
- $b = ord($data[$i]);
- $remainder = ($remainder << 8) | $b;
- $remainderSize += 8;
- while ($remainderSize > 4)
- {
- $remainderSize -= 5;
- $c = $remainder & (self::BITS_5_RIGHT << $remainderSize);
- $c >>= $remainderSize;
- $res .= self::$CHARS[$c];
- }
- }
- if ($remainderSize > 0)
- {
- // remainderSize < 5:
- $remainder <<= (5 - $remainderSize);
- $c = $remainder & self::BITS_5_RIGHT;
- $res .= self::$CHARS[$c];
- }
-
- return $res;
- }
-
- public static function decode($data)
- {
- $data = strtolower($data);
- $dataSize = strlen($data);
- $buf = 0;
- $bufSize = 0;
- $res = '';
-
- for ($i = 0; $i < $dataSize; $i++)
- {
- $c = $data[$i];
- $b = strpos(self::$CHARS, $c);
- if ($b === false)
- throw new Exception('Encoded string is invalid, it contains unknown char #'.ord($c));
- $buf = ($buf << 5) | $b;
- $bufSize += 5;
- if ($bufSize > 7)
- {
- $bufSize -= 8;
- $b = ($buf & (0xff << $bufSize)) >> $bufSize;
- $res .= chr($b);
- }
- }
-
- return $res;
+ public static function encode($string){
+ $string = base64_encode($string);
+ $reversed_string="";
+ $string_length = strlen($string);
+
+ for($i=$string_length-1;$i>-1;$i--)
+ {
+ if ($string[$i]==='=')
+ $reversed_string .= '_';
+ else
+ $reversed_string .= $string[$i];
+ }
+ return $reversed_string;
}
-}
-
-function rbase64_encode($string){
- $string = base64_encode($string);
- $reversed_string="";
- $string_length = strlen($string);
-
- for($i=$string_length-1;$i>-1;$i--)
- {
- if ($string[$i]==='=')
- $reversed_string .= '_';
- else
- $reversed_string .= $string[$i];
- }
- return $reversed_string;
-}
-function rbase64_decode($rstring){
- $string="";
- $string_length = strlen($rstring);
-
- for($i=$string_length-1;$i>-1;$i--)
- {
- if ($rstring[$i]==='_')
- $string .= '=';
- else
- $string .= $rstring[$i];
- }
-
- return base64_decode($string);
+ public static function decode($rstring){
+ $string="";
+ $string_length = strlen($rstring);
+
+ for($i=$string_length-1;$i>-1;$i--)
+ {
+ if ($rstring[$i]==='_')
+ $string .= '=';
+ else
+ $string .= $rstring[$i];
+ }
+
+ return base64_decode($string);
+ }
}
-
-
?>
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d4263980/app/routes.php
----------------------------------------------------------------------
diff --git a/app/routes.php b/app/routes.php
index 81e1ca5..522aac9 100755
--- a/app/routes.php
+++ b/app/routes.php
@@ -166,17 +166,17 @@ Route::get("gbrowser/{filelist}", function($filelist){
if ( isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
$protocol = 'https';
+ include("libraries/basecode.php");
+
$dataRoot = Config::get("pga_config.airavata")["experiment-data-absolute-path"];
- $filelist = explode("\n", base64_decode( $filelist ) );
+ $filelist = explode("\n", RBase64::decode( $filelist ) );
$folder_path=$filelist[0]. "ARCHIVE" ;
$content = "[ \n";
-
- include("libraries/basecode.php");
-
+
for($i=1; $i<3; $i++){
$content = $content . ' {
type:"bigwig",
- url:"'.$protocol.'://'. $_SERVER['HTTP_HOST'] .'/gbfile/'.rbase64_encode($filelist[$i*2]). '",
+ url:"'.$protocol.'://'. $_SERVER['HTTP_HOST'] .'/gbfile/'.RBase64::encode($filelist[$i*2]). '",
name: "'. $filelist[$i*2-1] .'",
#fixedscale:{min:0,max:20},
colorpositive:"#B30086",
@@ -189,7 +189,7 @@ Route::get("gbrowser/{filelist}", function($filelist){
$content = $content . '{
type:"bedgraph",
- url:"'.$protocol.'://'. $_SERVER['HTTP_HOST'] .'/gbfile/'.rbase64_encode($folder_path . '/out.dREG.pred.gz').'",
+ url:"'.$protocol.'://'. $_SERVER['HTTP_HOST'] .'/gbfile/'.RBase64::encode($folder_path . '/out.dREG.pred.gz').'",
name: "dREG informative pos.:",
mode: "show",
colorpositive:"#B30086",
@@ -201,7 +201,7 @@ Route::get("gbrowser/{filelist}", function($filelist){
$content = $content . '{
type:"bedgraph",
- url:"'.$protocol.'://'. $_SERVER['HTTP_HOST'] .'/gbfile/'.rbase64_encode( $folder_path . '/out.dREG.peak.gz').'",
+ url:"'.$protocol.'://'. $_SERVER['HTTP_HOST'] .'/gbfile/'.RBase64::encode( $folder_path . '/out.dREG.peak.gz').'",
name: "dREG Peak Calling:",
mode: "show",
colorpositive:"#B30086",
@@ -213,7 +213,7 @@ Route::get("gbrowser/{filelist}", function($filelist){
$content = $content . '{
type:"bigwig",
- url:"'.$protocol.'://'. $_SERVER['HTTP_HOST'] .'/gbfile/'.rbase64_encode( $folder_path . '/out.dREG.HD.imputedDnase.bw').'",
+ url:"'.$protocol.'://'. $_SERVER['HTTP_HOST'] .'/gbfile/'.RBase64::encode( $folder_path . '/out.dREG.HD.imputedDnase.bw').'",
name: "imputed DNase-I signal:",
#fixedscale:{min:0,max:20},
colorpositive:"#00B306",
@@ -223,7 +223,7 @@ Route::get("gbrowser/{filelist}", function($filelist){
$content = $content . '{
type:"bedgraph",
- url:"'.$protocol.'://'. $_SERVER['HTTP_HOST'] .'/gbfile/'.rbase64_encode( $folder_path . '/out.dREG.HD.relaxed.bed.gz').'",
+ url:"'.$protocol.'://'. $_SERVER['HTTP_HOST'] .'/gbfile/'.RBase64::encode( $folder_path . '/out.dREG.HD.relaxed.bed.gz').'",
name: "dREG.HD relaxed peaks:",
mode: "show",
colorpositive:"#0000e5/#B30086",
@@ -234,7 +234,7 @@ Route::get("gbrowser/{filelist}", function($filelist){
$content = $content . '{
type:"bedgraph",
- url:"'.$protocol.'://'. $_SERVER['HTTP_HOST'] .'/gbfile/'.rbase64_encode( $folder_path . '/out.dREG.HD.stringent.bed.gz').'",
+ url:"'.$protocol.'://'. $_SERVER['HTTP_HOST'] .'/gbfile/'.RBase64::encode( $folder_path . '/out.dREG.HD.stringent.bed.gz').'",
name: "dREG.HD stringent peaks:",
mode: "show",
colorpositive:"#0000e5/#B30086",
@@ -256,9 +256,9 @@ Route::get("gbfile/{file}", function($file){
include("libraries/basecode.php");
if( $fileext != "")
- $file = rbase64_decode( $filename ) .".".$fileext;
+ $file = RBase64::decode( $filename ) .".".$fileext;
else
- $file = rbase64_decode( $filename );
+ $file = RBase64::decode( $filename );
if(0 === strpos($file, '/')){
$file = substr($file, 1);
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d4263980/app/views/partials/experiment-info.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/experiment-info.blade.php b/app/views/partials/experiment-info.blade.php
index a11465a..df72b4f 100755
--- a/app/views/partials/experiment-info.blade.php
+++ b/app/views/partials/experiment-info.blade.php
@@ -216,10 +216,6 @@ function download(d) {
<option value="out.dREG.peak.gz">dREG regions</option>
<option value="out.dREG.pred.gz">dREG scores</option>
</select>
-
-
-<a href="/download?path={{$expDataDir}}/ARCHIVE/out.dREG.tar.gz" target="_blank">Download All Results <span class="glyphicon glyphicon-save" style="width:20px"></span></a>
-
<?php
$filelist="";
@@ -251,10 +247,18 @@ function download(d) {
$expDataDir = $experiment->userConfigurationData->experimentDataDir;
}
- $filelist=$expDataDir ."\n". $filelist;
+ $filelist = $expDataDir ."\n". $filelist;
+ $fileAllPath = $dataRoot . '/' . $expDataDir. '/ARCHIVE/out.dREG.tar.gz';
?>
-<a href="http://epigenomegateway.wustl.edu/browser/?genome=hg19&datahub={{ $protocol .'://'. $_SERVER['HTTP_HOST']. '/gbrowser/'. base64_encode( $filelist ) }}" target="_blank">
+
+
+@if(file_exists($fileAllPath) )
+ <a href="/download?path={{$expDataDir}}/ARCHIVE/out.dREG.tar.gz" target="_blank">Download All Results <span class="glyphicon glyphicon-save" style="width:20px"></span></a>
+
+@endif
+
+<a href="http://epigenomegateway.wustl.edu/browser/?genome=hg19&datahub={{ $protocol .'://'. $_SERVER['HTTP_HOST']. '/gbrowser/'. RBase64::encode( $filelist ) }}" target="_blank">
Genome Browser <span class="glyphicon glyphicon-new-window" style="width:20px"></span></a>
</td>
</tr>
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d4263980/app/views/partials/experiment-inputs.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/experiment-inputs.blade.php b/app/views/partials/experiment-inputs.blade.php
old mode 100644
new mode 100755
index 479101c..41d58dc
--- a/app/views/partials/experiment-inputs.blade.php
+++ b/app/views/partials/experiment-inputs.blade.php
@@ -92,16 +92,21 @@
@endif
</div>
</div>
---}}
+ --}}
+ <div class="queue-block" style="display: none;">
+ <div class="queue-view" style="height:0px">
+ </div>
+ <input name="share-settings" id="share-settings" value="{}" type="hidden">
+ </div>
-{{-- set default value by dREG --}}
+{{-- set default value by dREG (remove on 2/17/2017)
<input name="queue-name" value="GPU" type="hidden">
<input name="node-count" value="1" type="hidden">
<input name="cpu-count" id="cpu-count" value="16" type="hidden">
<input name="wall-time" id="wall-time" value="30" hidden="hidden">
<input name="total-physical-memory" id="memory-count" value="" type="hidden">
<input name="share-settings" id="share-settings" value="{}" type="hidden">
-{{-- dREG --}}
+--}}
</div>
<h3>Notifications</h3>
[2/2] airavata-php-gateway git commit: Merge branch 'dreg-gateway' of
https://github.com/Danko-Lab/airavata-php-gateway into dreg-gateway
Posted by ma...@apache.org.
Merge branch 'dreg-gateway' of https://github.com/Danko-Lab/airavata-php-gateway into dreg-gateway
Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/8f3d7621
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/8f3d7621
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/8f3d7621
Branch: refs/heads/dreg-gateway
Commit: 8f3d7621e592880e83f9a86bb5aeb779b34ff525
Parents: 75929d7 d426398
Author: Marcus Christie <ma...@iu.edu>
Authored: Mon Feb 20 09:27:17 2017 -0500
Committer: Marcus Christie <ma...@iu.edu>
Committed: Mon Feb 20 09:27:17 2017 -0500
----------------------------------------------------------------------
app/libraries/basecode.php | 119 +++++---------------
app/routes.php | 24 ++--
app/views/partials/experiment-info.blade.php | 16 ++-
app/views/partials/experiment-inputs.blade.php | 11 +-
4 files changed, 58 insertions(+), 112 deletions(-)
----------------------------------------------------------------------