Commit 02f0b249 authored by Joel Thiessen's avatar Joel Thiessen

directories and root package

parent 40912504
include README.rst
......@@ -20,8 +20,7 @@ To invoke the import tool from within Galaxy, currently the HTML stub uploader m
#### Initial Installation:
Place the repository's contents into `$GALAXY_ROOT/tools/irida_import` The directory `irida_import` must be made.
Place the repository's `irida_import` folder into `$GALAXY_ROOT/tools/`
Add an entry for irida_import.xml to `$GALAXY_ROOT/config/tool_conf.xml` to the "Get Data" section:
```
......@@ -47,9 +46,9 @@ allow_library_path_paste = True
Note: It is not neccessary to do any of the steps in this subsection in order to run the tests.
To use the tool from within Galaxy, right now, by default, the tool looks for a HTML page at `http://localhost:81`
Set up a webserver serving a copy of the HTML page, `irida_import/extras/apache/index.html`. Example config files for Apache2 are included alongside the HTML page.
Set up a webserver serving a copy of the HTML page, `irida_import/extras/apache2/index.html`. Example config files for Apache2 are included alongside the HTML page.
Cross Origin Resource Sharing (CORS) should be set up, because it likely be required. Galaxy's stripped down paste implementation does not implement CORS, or (to my knowlege) retain an easy way to add it but CORS can be added to a nginx reverse-proxy for Galaxy. A sample configuration file is included: `irida_import/extras/nginx/nginx.conf`
Cross Origin Resource Sharing (CORS) should be set up, because it will likely be required. Galaxy's stripped down paste implementation does not implement CORS, or (to my knowlege) retain an easy way to add it but CORS can be added to a nginx reverse-proxy for Galaxy. A sample configuration file is included: `irida_import/extras/nginx/nginx.conf`
The file assumes that Galaxy can be found on `localhost:8888` Change the occurence of this phrase in the configuration file if your Galaxy instance is located elsewhere.
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.js"></script>
</head>
<body>
<div ng-app="irida_stub" ng-controller="galaxyController">
Galaxy Search: {{searchAll}}
<br><br>
Redirects: {{redirect}}
</div>
<script>
angular.module('irida_stub', [], function($locationProvider) {
$locationProvider.html5Mode(true);
})
.controller('galaxyController', ['$scope', '$http', '$window', '$location', galaxyController]);
function galaxyController($scope, $http, $window, $location) {
var galaxyCallbackURL = $location.search().appCallbackUrl;
$scope.searchAll = $location.search();
$scope.redirect = galaxyCallbackURL;
var submitForm = document.createElement('form');
submitForm.setAttribute('method','post');
submitForm.setAttribute('action',galaxyCallbackURL);
var lib_name = document.createElement('input');
lib_name.setAttribute('type','hidden');
lib_name.setAttribute('name','library_name');
lib_name.setAttribute('value','boblib');
submitForm.appendChild(lib_name);
var sample1_name = document.createElement('input');
sample1_name.setAttribute('type','hidden');
sample1_name.setAttribute('name','sample1_name');
sample1_name.setAttribute('value','randomNameForSample1');
submitForm.appendChild(sample1_name);
var sample1_path = document.createElement('input');
sample1_path.setAttribute('type','hidden');
sample1_path.setAttribute('name','sample1_path');
sample1_path.setAttribute('value','http://localhost/some_IRIDA_API_path/Projects/1/Samples/1');
submitForm.appendChild(sample1_path);
var sample1_file1_path = document.createElement('input');
sample1_file1_path.setAttribute('type','hidden');
sample1_file1_path.setAttribute('name','sample1_file1_path');
sample1_file1_path.setAttribute('value','http://www.dgfdg.com/sample1file1');
submitForm.appendChild(sample1_file1_path);
var sample1_file2_path = document.createElement('input');
sample1_file2_path.setAttribute('type','hidden');
sample1_file2_path.setAttribute('name','sample1_file2_path');
sample1_file2_path.setAttribute('value','file://localhost/home/jthiessen/lib_imp_dir/test/test.fastq');
submitForm.appendChild(sample1_file2_path);
document.body.appendChild(submitForm);
submitForm.submit();
/*
// post(galaxyCallbackURL);
//this function was shamelessly lifted from http://stackoverflow.com/questions/133925/javascript-post-request-like-a-form-submit
function post(path, params, method) {
method = method || "post"; // Set method to post by default if not specified.
// The rest of this code assumes you are not using a library.
// It can be made less wordy if you use one.
var form = document.createElement("form");
form.setAttribute("method", method);
form.setAttribute("action", path);
for(var key in params) {
if(params.hasOwnProperty(key)) {
varte hiddenField = document.createElement("input");
hiddenField.setAttribute("type", "hidden");
hiddenField.setAttribute("name", key);
hiddenField.setAttribute("value", params[key]);
form.appendChild(hiddenField);
}
}
document.body.appendChild(form);
form.submit();
}
/*
$http.post(galaxyCallbackURL,{msg:'grr'}).
success(function(data,status,headers,config) {
// $window.location.href ="http://localhost:81/response.html"; //galaxyCallbackURL;
}).
error(function(data, status, headers, config) {
});
top.Galaxy.currHistoryPanel.refreshContents();
*/
}
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<base href="/">
<meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.13/angular.js"></script>
</head>
<body>
<div ng-app="irida_stub" ng-controller="galaxyController">
Parameters passed from Galaxy: {{searchAll}}
<br><br>
Parameter chosen to redirect to: {{redirect}}
</div>
<script>
angular.module('irida_stub', [], function($locationProvider) {
$locationProvider.html5Mode({
enabled : true
});
})
.controller('galaxyController', ['$scope', '$http', '$window', '$location', galaxyController]);
function galaxyController($scope, $http, $window, $location) {
var galaxyCallbackURL = $location.search().appCallbackUrl;
$scope.searchAll = $location.search();
$scope.redirect = galaxyCallbackURL;
var submitForm = document.createElement('form');
submitForm.setAttribute('method','post');
submitForm.setAttribute('action',galaxyCallbackURL);
var lib_name = document.createElement('input');
lib_name.setAttribute('type','hidden');
lib_name.setAttribute('name','library_name');
lib_name.setAttribute('value','boblib');
submitForm.appendChild(lib_name);
var sample1_name = document.createElement('input');
sample1_name.setAttribute('type','hidden');
sample1_name.setAttribute('name','sample1_name');
sample1_name.setAttribute('value','randomNameForSample1');
submitForm.appendChild(sample1_name);
var sample1_path = document.createElement('input');
sample1_path.setAttribute('type','hidden');
sample1_path.setAttribute('name','sample1_path');
sample1_path.setAttribute('value','http://localhost/some_IRIDA_API_path/Projects/1/Samples/1');
submitForm.appendChild(sample1_path);
var sample1_file1_path = document.createElement('input');
sample1_file1_path.setAttribute('type','hidden');
sample1_file1_path.setAttribute('name','sample1_file1_path');
sample1_file1_path.setAttribute('value','http://www.dgfdg.com/sample1file1');
submitForm.appendChild(sample1_file1_path);
var sample1_file2_path = document.createElement('input');
sample1_file2_path.setAttribute('type','hidden');
sample1_file2_path.setAttribute('name','sample1_file2_path');
sample1_file2_path.setAttribute('value','file://localhost/home/jthiessen/lib_imp_dir/test/test.fastq');
submitForm.appendChild(sample1_file2_path);
document.body.appendChild(submitForm);
submitForm.submit();
}
</script>
</body>
</html>
import pytest
import json
import logging
import irida_import
from sample import Sample
from bioblend.galaxy.objects import GalaxyInstance
from bioblend.galaxy.objects import Library
......@@ -9,7 +10,6 @@ from bioblend.galaxy.objects import client
from bioblend import galaxy
from mock import Mock
import mock
import irida_import
class TestIridaImport:
......
[pytest]
norecursedirs=skip
norecursedirs=irida_import/skip
from setuptools import setup
def readme():
"""Returns the readme file"""
with open('README.md') as f:
return f.read()
setup(name='irida_import',
version='0.1',
description='Import files from IRIDA into Galaxy',
url='https://irida.corefacility.ca/gitlab/jthiessen/ \
import-tool-for-galaxy/tree/angular-json-passthrough',
author='Joel Thiessen',
author_email='jthiessen@phac-aspc.gc.ca',
license='Not known yet',
packages=['irida_import'],
install_requires=[
'bioblend',
'pytest',
],
zip_safe=False)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment