airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [2/2] airavata-php-gateway git commit: customized gateway for dREG
Date Fri, 03 Feb 2017 15:30:54 GMT
customized gateway for dREG


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/e1197002
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/e1197002
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/e1197002

Branch: refs/heads/dreg-gateway
Commit: e11970022cdc2b7cc56810667425d4ed002e1bb8
Parents: 2533937
Author: root <root@osboxes>
Authored: Wed Feb 1 18:27:04 2017 +0000
Committer: root <root@osboxes>
Committed: Wed Feb 1 18:27:04 2017 +0000

----------------------------------------------------------------------
 app/libraries/CommonUtilities.php              |  33 +++++-
 app/routes.php                                 | 125 ++++++++++++++++++++
 app/views/account/dashboard.blade.php          |  39 ++++--
 app/views/experiment/create-complete.blade.php |   4 +-
 app/views/experiment/create.blade.php          |   3 +
 app/views/partials/experiment-info.blade.php   |  41 +++++++
 app/views/partials/experiment-inputs.blade.php |  16 +++
 7 files changed, 245 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/e1197002/app/libraries/CommonUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/CommonUtilities.php b/app/libraries/CommonUtilities.php
index 585016f..6792dcc 100644
--- a/app/libraries/CommonUtilities.php
+++ b/app/libraries/CommonUtilities.php
@@ -111,11 +111,13 @@ class CommonUtilities
                 (
                     array('label' => 'Create', 'url' => URL::to('/') . '/project/create',
"nav-active" => "project"),
                     array('label' => 'Browse', 'url' => URL::to('/') . '/project/browse',
"nav-active" => "project")
-                ),
-                'Experiment' => array
-                (
-                    array('label' => 'Create', 'url' => URL::to('/') . '/experiment/create',
"nav-active" => "experiment"),
-                    array('label' => 'Browse', 'url' => URL::to('/') . '/experiment/browse',
"nav-active" => "experiment")
+                // ->> REMOVE in dREG
+                //),
+                //'Experiment' => array
+                //(
+                //    array('label' => 'Create', 'url' => URL::to('/') . '/experiment/create',
"nav-active" => "experiment"),
+                //    array('label' => 'Browse', 'url' => URL::to('/') . '/experiment/browse',
"nav-active" => "experiment")
+                // <<- dREG
                 )
             );
 
@@ -188,6 +190,27 @@ class CommonUtilities
             $navbar .= '</ul></li>';
         }
 
+        // ->> Adding in dREG
+        if( count( $menus) == 0)
+            $navbar .= '<li class="brand-logo"></li>';
+
+        $active = "";
+        if(Session::has('loggedin') && (Session::has('authorized-user') || Session::has('admin')
+                || Session::has('admin-read-only'))){
+            if( Session::get("nav-active") == "experiment" && $_SERVER['REQUEST_URI']==
"/xperiment/create")
+                $active = "active";
+            $navbar .= '<li class="' . $active . '"><a href="' . URL::to("/") .
'/experiment/create"><span class="glyphicon glyphicon-plus-sign"></span> Start
dREG</a></li>';
+        }
+
+        $active = "";
+        if(Session::has('loggedin') && (Session::has('authorized-user') || Session::has('admin')
+                || Session::has('admin-read-only'))){
+            if( Session::get("nav-active") == "experiment" && $_SERVER['REQUEST_URI']==
"/experiment/browse")
+                $active = "active";
+            $navbar .= '<li class="' . $active . '"><a href="' . URL::to("/") .
'/experiment/browse"><span class="glyphicon glyphicon-list"></span> Saved dREG
runs</a></li>';
+        }
+        // <<- dREG
+
         $active = "";
         if(Session::has('loggedin') && 
             (Session::has('authorized-user') || Session::has('admin') || Session::has('admin-read-only'))
&&

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/e1197002/app/routes.php
----------------------------------------------------------------------
diff --git a/app/routes.php b/app/routes.php
index b2e58cd..05bec1e 100755
--- a/app/routes.php
+++ b/app/routes.php
@@ -160,6 +160,131 @@ Route::get("files/browse", "FilemanagerController@browse");
 
 Route::get("files/get","FilemanagerController@get");
 
+// Added by dREG 
+Route::get("gbrowser", function(){
+
+    $experiment = ExperimentUtilities::get_experiment(Input::get('expId'));
+
+    if(0 === strpos($experiment->userConfigurationData->experimentDataDir, Config::get("pga_config.airavata")['experiment-data-absolute-path'])){
+        $expDataDir = str_replace(Config::get("pga_config.airavata")['experiment-data-absolute-path'],
"", $experiment->userConfigurationData->experimentDataDir);
+    }else{
+        $expDataDir = $experiment->userConfigurationData->experimentDataDir;
+    }
+
+    $folder_path = $expDataDir . 'ARCHIVE';
+    if(strpos($folder_path, "/")==0)
+        $folder_path = substr($folder_path, 1);
+
+    ob_start();
+    ExperimentUtilities::list_input_files($experiment->experimentInputs);
+    $html = ob_get_contents();
+    ob_end_clean();
+ 
+    $DOM = new DOMDocument;
+    $DOM->loadHTML( $html . "<H1>A</H1>");
+
+    $content = "[\n";
+    $items = $DOM->getElementsByTagName('a');
+    for ($i = 0; $i < $items->length; $i++)
+    {
+	  $fname = $items->item($i)->nodeValue ;
+          $fhref = $items->item($i)->getAttribute("href") ;
+          if(strpos($fhref, 'airavata-dp:')===false)
+          {
+          }
+          else
+          {
+               $id= substr($fhref, strpos($fhref, 'airavata-dp:') );
+          } 
+ 	
+          $dataProductModel = Airavata::getDataProduct(Session::get('authz-token'), $id);
+          $currentOutputPath = "";
+          foreach ($dataProductModel->replicaLocations as $rp) {
+              if($rp->replicaLocationCategory == Airavata\Model\Data\Replica\ReplicaLocationCategory::GATEWAY_DATA_STORE){
+                  $currentOutputPath = $rp->filePath;
+                  break;
+              }
+          }
+ 
+         $dataRoot = Config::get("pga_config.airavata")["experiment-data-absolute-path"];
+         $fpath = str_replace($dataRoot, "", parse_url($currentOutputPath, PHP_URL_PATH));
+         if(strpos($fpath, "/")==0)
+            $fpath = substr($fpath, 1);
+         
+         $content = $content . ' {
+         type:"bigwig",
+         url:"http://'. $_SERVER['HTTP_HOST'] .'/download?path='. $fpath . '",
+         name: "'. $fname.'",
+         fixedscale:{min:0,max:20},
+         colorpositive:"rgb(197,0,11)",
+         height:50,
+         mode: "show",
+         },'. "\n" ;
+    }
+
+    $content = $content . '{
+       type:"bedgraph",
+         url:"http://'. $_SERVER['HTTP_HOST'] .'/gbfile?path='. $folder_path . '/out.dREG.pred.gz",
+         name: "dREG informative pos.:",
+         mode: "show",
+         colorpositive:"#0000e5/#B30086",
+         backgroundcolor:"#ffffe5",
+         height:30,
+         fixedscale:{min:0, max:1},
+    },'. "\n";
+
+    $content = $content . '{
+       type:"bedgraph",
+         url:"http://'. $_SERVER['HTTP_HOST'] .'/gbfile?path='. $folder_path . '/out.dREG.peak.gz",
+         name: "dREG Peak Calling:",
+         mode: "show",
+         colorpositive:"#0000e5/#B30086",
+         backgroundcolor:"#ffffe5",
+         height:30,
+         fixedscale:{min:0, max:1},
+    },'. "\n";
+
+    $content = $content . '{
+       type:"bigwig",
+         url:"http://'. $_SERVER['HTTP_HOST'] .'/gbfile?path='. $folder_path . '/out.dREG.HD.imputedDnase.bw",
+         name: "imputed DNase-I signal:",
+         fixedscale:{min:0,max:20},
+         colorpositive:"rgb(197,0,11)",
+         height:50,
+         mode: "show",
+    },'. "\n";
+
+    $content = $content . '{
+       type:"bedgraph",
+         url:"http://'. $_SERVER['HTTP_HOST'] .'/gbfile?path='. $folder_path . '/out.dREG.HD.relaxed.bed",
+         name: "dREG.HD relaxed peaks:",
+         mode: "show",
+         colorpositive:"#0000e5/#B30086",
+         backgroundcolor:"#ffffe5",
+         height:30,
+         fixedscale:{min:0, max:1},
+    },'. "\n";
+
+    $content = $content . '{
+       type:"bedgraph",
+         url:"http://'. $_SERVER['HTTP_HOST'] .'/gbfile?path='. $folder_path . '/out.dREG.HD.stringent.bed",
+         name: "dREG.HD stringent peaks:",
+         mode: "show",
+         colorpositive:"#0000e5/#B30086",
+         backgroundcolor:"#ffffe5",
+         height:30,
+         fixedscale:{min:0, max:1},
+    },'. "\n";
+
+
+    $content = $content . ']';
+
+    return Response::make($content, 200)
+                  ->header('Content-Type', 'text/plain');
+});
+
+// dREG
+
 /*
  * Group Routes
  */

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/e1197002/app/views/account/dashboard.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/dashboard.blade.php b/app/views/account/dashboard.blade.php
index f23b40e..c67747b 100644
--- a/app/views/account/dashboard.blade.php
+++ b/app/views/account/dashboard.blade.php
@@ -245,19 +245,37 @@
 
                 <h3>See what's happening in your projects</h3>
 
-                <a href="{{URL::to('/')}}/project/browse">
-                    <div class="@if( Session::has('admin') || Session::has('admin-read-only'))
col-md-4 @else col-md-6 @endif well">
+                @if( Session::has('admin') || Session::has('admin-read-only'))
+                <a href="{{URL::to('/')}}/admin/dashboard/experiments">
+                    <div class="col-md-4  well">
                         <div class="col-md-12">
-                            <span class="glyphicon glyphicon-off console-icon"></span>
+                            <span class="glyphicon glyphicon-stats console-icon"></span>
                         </div>
                         <div class="col-md-12">
-                            <h4>Browse Projects</h4>
+                            <h4>Experiment Statistics</h4>
+                        </div>
+                    </div>
+                </a>
+{{-- Added by dREG --}}
+                @else
+                <a href="{{URL::to('/')}}/experiment/create">
+                    <div class="col-md-4  well">
+                        <div class="col-md-12">
+                            <span class="glyphicon glyphicon-plus-sign console-icon"></span>
+                        </div>
+                        <div class="col-md-12">
+                            <h4>Start dREG</h4>
                         </div>
                     </div>
                 </a>
+{{-- dREG --}}
+                @endif
 
                 <a href="{{URL::to('/')}}/experiment/browse">
+{{-- Added by dREG
                     <div class="@if( Session::has('admin') || Session::has('admin-read-only'))
col-md-4 @else col-md-6 @endif well">
+--}}
+                    <div class="col-md-4  well">
                         <div class="col-md-12">
                             <span class="glyphicon glyphicon-tasks console-icon"></span>
                         </div>
@@ -267,18 +285,19 @@
                     </div>
                 </a>
 
-                @if( Session::has('admin') || Session::has('admin-read-only'))
-                <a href="{{URL::to('/')}}/admin/dashboard/experiments">
+                <a href="{{URL::to('/')}}/project/browse">
+{{-- Added by dREG
+                    <div class="@if( Session::has('admin') || Session::has('admin-read-only'))
col-md-4 @else col-md-6 @endif well">
+--}}
                     <div class="col-md-4  well">
                         <div class="col-md-12">
-                            <span class="glyphicon glyphicon-stats console-icon"></span>
+                            <span class="glyphicon glyphicon-off console-icon"></span>
                         </div>
                         <div class="col-md-12">
-                            <h4>Experiment Statistics</h4>
+                            <h4>Browse Projects</h4>
                         </div>
                     </div>
                 </a>
-                @endif
             </div>
 
             @if( Session::has('admin') || Session::has('admin-read-only') )
@@ -496,4 +515,4 @@
         $("#viewCredentials").modal("show");
     });
 </script>
-@stop
\ No newline at end of file
+@stop

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/e1197002/app/views/experiment/create-complete.blade.php
----------------------------------------------------------------------
diff --git a/app/views/experiment/create-complete.blade.php b/app/views/experiment/create-complete.blade.php
index 7f085ca..3ad767a 100755
--- a/app/views/experiment/create-complete.blade.php
+++ b/app/views/experiment/create-complete.blade.php
@@ -7,8 +7,10 @@
 
 @section('content')
 <div class="col-md-offset-3 col-md-6">
-
+{{-- Commented by dREG
     <h1>Create a new experiment</h1>
+--}}
+    <h1>Create a new dREG experiment</h1>
 
     <form action="{{URL::to('/')}}/experiment/create" method="POST" role="form" enctype="multipart/form-data">
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/e1197002/app/views/experiment/create.blade.php
----------------------------------------------------------------------
diff --git a/app/views/experiment/create.blade.php b/app/views/experiment/create.blade.php
index 87225d4..0a1ce01 100755
--- a/app/views/experiment/create.blade.php
+++ b/app/views/experiment/create.blade.php
@@ -15,7 +15,10 @@
 
 <div class="col-md-offset-3 col-md-6">
 
+{{-- Added by dREG
     <h1>Create a new experiment</h1>
+--}}
+    <h1>Create a new dREG experiment</h1>
 
     <form action="{{URL::to('/')}}/experiment/create" method="POST" role="form" enctype="multipart/form-data">
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/e1197002/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 cb1a156..2144873 100644
--- a/app/views/partials/experiment-info.blade.php
+++ b/app/views/partials/experiment-info.blade.php
@@ -158,6 +158,7 @@
             <td><strong>Creation Time</strong></td>
             <td class="time" unix-time="{{ $expVal["experimentCreationTime"] }}"></td>
         </tr>
+{{-- Commented by dREG 
         <tr>
             <td><strong>Last Modified Time</strong></td>
             <td class="time" unix-time="{{ $expVal["experimentTimeOfStateChange"] }}"></td>
@@ -178,14 +179,52 @@
             <td><strong>Queue</strong></td>
             <td>{{ $experiment->userConfigurationData->computationalResourceScheduling->queueName
}}</td>
         </tr>
+--}}
         <tr>
             <td><strong>Inputs</strong></td>
             <td>{{ ExperimentUtilities::list_input_files($experiment->experimentInputs)
}}</td>
         </tr>
         <tr>
             <td><strong>Outputs</strong></td>
+{{-- Commented by dREG
             <td>{{ ExperimentUtilities::list_output_files($experiment->experimentOutputs,
$experiment->experimentStatus[0]->state, false) }}</td>
         </tr>
+--}}
+
+{{-- Added by dREG --}}
+            <td>
+            <?php
+                if(0 === strpos($experiment->userConfigurationData->experimentDataDir,
Config::get("pga_config.airavata")['experiment-data-absolute-path'])){
+                    $expDataDir = str_replace(Config::get("pga_config.airavata")['experiment-data-absolute-path'],
"", $experiment->userConfigurationData->experimentDataDir);
+                }else{
+                    $expDataDir = $experiment->userConfigurationData->experimentDataDir;
+                }
+            ?>
+
+<script type="text/javascript">
+function download(d) {
+        if (d == 'Download one result') return;
+        window.open('https://{{$_SERVER['HTTP_HOST']}}/download?path={{$expDataDir}}/ARCHIVE/'
+ d);
+}
+</script>
+ 
+<select name="download" onChange="download(this.value)">
+<option>Download one result</option>
+<option value="out.dREG.HD.stringent.bed">Stringent Bed regions</option>
+<option value="out.dREG.HD.relaxed.bed">Relaxed Bed regions</option> 
+<option value="out.dREG.HD.imputedDnase.bw">Imputed DNase-I</option>
+<option value="out.dREG.peak.gz">dREG regions</option>         
+<option value="out.dREG.pred.gz">dREG scores</option>  
+</select>
+&nbsp;&nbsp;&nbsp;&nbsp;
+
+<a href="/download?path={{$expDataDir}}/ARCHIVE/out.dREG.tar.gz" target="_blank"><span
class="glyphicon glyphicon-save"  style="width:20px"></span>Download All Results</a>
+&nbsp;&nbsp;&nbsp;&nbsp;
+
+<a href="http://epigenomegateway.wustl.edu/browser/?genome=hg19&datahub=https://{{$_SERVER['HTTP_HOST']}}/gbrowser?expId={{$_GET['expId']}}"
target="_blank"><span class="glyphicon glyphicon-new-window"  style="width:20px"></span>Genome
Browser</a>
+        </td>
+        </tr>
+{{-- dREG --}}
         <tr>
             <td><strong>Storage Directory</strong></td>
             <?php
@@ -229,11 +268,13 @@
 
     <form id="experiment-form" action="{{URL::to('/') }}/experiment/summary" method="post"
role="form">
 
+{{-- Commented by dREG 
         <div class="form-group">
         @if(Config::get('pga_config.airavata')["data-sharing-enabled"] && isset($updateSharingViaAjax))
             @include('partials/sharing-display-body', array("form" => !$updateSharingViaAjax))
         @endif
         </div>
+--}}
         <div class="btn-toolbar">
             <button name="launch"
                     type="submit"

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/e1197002/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
index 956e99d..479101c 100644
--- a/app/views/partials/experiment-inputs.blade.php
+++ b/app/views/partials/experiment-inputs.blade.php
@@ -21,11 +21,13 @@
     {{ ExperimentUtilities::create_application_select($expInputs['application'], false) }}
 </div>
 
+{{-- Commented by dREG
 @if (Config::get('pga_config.airavata')["data-sharing-enabled"])
 <div class="form-group">
     @include('partials/sharing-display-body', array("form" => $canEditSharing))
 </div>
 @endif
+--}}
 
 <div class="panel panel-default">
     <div class="panel-heading">Application configuration</div>
@@ -75,6 +77,7 @@
             <h4>Application deployed Computational resources are currently unavailable</h4>
             @endif
         </div>
+{{-- Commented by dREG 
         <div class="queue-block">
             <div class="loading-img text-center hide">
                 <img src="../assets/ajax-loader.gif"/>
@@ -89,6 +92,17 @@
                 @endif
             </div>
         </div>
+--}}
+
+{{-- set default value by dREG --}}
+<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>
 
@@ -126,6 +140,7 @@
         </div>
     </div>
 
+{{-- Commented by dREG
     @if( $expInputs["advancedOptions"])
     <h3>Advanced Options</h3>
 
@@ -137,4 +152,5 @@
         </div>
     </div>
     @endif
+--}}
 </div>


Mime
View raw message