Skip to content
This repository has been archived by the owner on Jul 29, 2020. It is now read-only.

Commit

Permalink
Merge 761ffa0 into 2e1d684
Browse files Browse the repository at this point in the history
  • Loading branch information
josenavas committed Apr 17, 2017
2 parents 2e1d684 + 761ffa0 commit ef17d30
Show file tree
Hide file tree
Showing 139 changed files with 19,223 additions and 97 deletions.
24 changes: 21 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,27 @@ before_install:
# Update conda itself
- conda update --yes conda
install:
- travis_retry conda create --yes -n qiita_env python=2.7 pip nose flake8 pyzmq
networkx pyparsing natsort mock future libgfortran 'pandas>=0.18' 'scipy>0.13.0'
'numpy>=1.7' 'h5py>=2.3.1'
- source activate qiita_env
- pip install sphinx sphinx-bootstrap-theme coveralls ipython[all]==2.4.1
- pip install https://github.com/biocore/qiita/archive/master.zip --process-dependency-links
- ipython profile create qiita-general --parallel
- export QIITA_SERVER_CERT=$HOME/miniconda3/envs/qiita_env/lib/python2.7/site-packages/qiita_core/support_files/server.crt
- export MOI_CONFIG_FP=$HOME/miniconda3/envs/qiita_env/lib/python2.7/site-packages/qiita_core/support_files/config_test.cfg
- qiita-env start_cluster qiita-general
- qiita-env make --no-load-ontologies
- source deactivate
- travis_retry conda create --yes -n labadmin python=2.7 pip
- source activate labadmin
- pip install -U pip
- pip install -U click natsort coverage coveralls
- travis_retry pip install -U .[test]
before_script:
- source activate qiita_env
- qiita pet webserver --no-build-docs start &
- source activate labadmin
# installing jira locally for testing
- wget https://marketplace.atlassian.com/download/plugins/atlassian-plugin-sdk-tgz
- tar zxvf atlassian-plugin-sdk-tgz
Expand All @@ -43,19 +58,22 @@ before_script:
# </dev/zero 2>&1 & --> https://goo.gl/n7BYnh
# this will install the latest version of JIRA but we could install other ones
# via --version 6.4.7
- atlas-run --product jira -DskipAllPrompts=true </dev/zero 2>&1 &
- atlas-run --product jira -DskipAllPrompts=true </dev/zero 2>&1 > /dev/null &
- sleep 560
script:
- git clone https://github.com/biocore/american-gut-web.git ~/build/biocore/american-gut-web
- source activate labadmin
- git clone -b plate-mapper-jose https://github.com/biocore/american-gut-web.git ~/build/biocore/american-gut-web
- cd /home/travis/build/biocore/american-gut-web
- export AG_CONFIG=`pwd`/ag_config.txt.example
- export PYTHONPATH=/home/travis/build/biocore/american-gut-web:$PYTHONPATH
- ./scripts/ag make test
- export PYTHONPATH=
- $PYTHONPATH
- cd $TRAVIS_BUILD_DIR
- cp $TRAVIS_BUILD_DIR/knimin/config.txt.example $TRAVIS_BUILD_DIR/knimin/config.txt
# We need to add the Qiita server cert path to the config file
- sed "s:SERVER_CERT =:SERVER_CERT = $QIITA_SERVER_CERT:g" $TRAVIS_BUILD_DIR/knimin/config.txt.example > $TRAVIS_BUILD_DIR/knimin/config.txt
- nosetests --verbose --with-doctest --with-coverage
- flake8 knimin setup.py scripts
- phantomjs knimin/tests/javascript/runner.js knimin/tests/javascript/index.html
after_success:
- coveralls
153 changes: 153 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
License
=======

labadmin makes usage of all of the following copyrighted packages; their licenses have been centralized in this document.

--------------------------------------------------------------------------------

#### Chosen (v1.4.2)
- by Patrick Filler for [Harvest](http://getharvest.com)
- Copyright (c) 2011-2014 by Harvest

Available for use under the [MIT License](http://en.wikipedia.org/wiki/MIT_License)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

--------------------------------------------------------------------------------

### DataTables ([1.10.12](https://github.com/DataTables/DataTables/releases/tag/1.10.12)) is released under the MIT License

Copyright (c) 2008-2015 SpryMedia Limited
http://datatables.net

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

--------------------------------------------------------------------------------

### jQuery ([1.9.1](https://github.com/jquery/jquery/releases/tag/1.9.1)) is released under the MIT License

Copyright 2012 jQuery Foundation and other contributors
http://jquery.com/

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

--------------------------------------------------------------------------------

### QUnit [2.0.1](https://github.com/jquery/qunit/releases/tag/2.0.1)

Copyright jQuery Foundation and other contributors, https://jquery.org/

This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/jquery/qunit

The following license applies to all parts of this software except as
documented below:

====

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

====

All files located in the node_modules directory are externally maintained
libraries used by this software which have their own licenses; we
recommend you read them, as their terms may differ from the terms above.

--------------------------------------------------------------------------------

### Font Awesome [4.6.3](https://github.com/FortAwesome/Font-Awesome/releases/tag/v4.6.3)

- by Dave Gandy - [http://fontawesome.io](http://fontawesome.io)

Font License
Applies to all desktop and webfont files in the following directory: font-awesome/fonts/.
License: SIL OFL 1.1
URL: http://scripts.sil.org/OFL

====

Code License
Applies to all CSS and LESS files in the following directories: font-awesome/css/, font-awesome/less/, and font-awesome/scss/.
License: MIT License
URL: [http://opensource.org/licenses/mit-license.html](http://opensource.org/licenses/mit-license.html)

====

Documentation License
Applies to all Font Awesome project files that are not a part of the Font or Code licenses.
License: CC BY 3.0
URL: [http://creativecommons.org/licenses/by/3.0/](http://creativecommons.org/licenses/by/3.0/)

====

Brand Icons
All brand icons are trademarks of their respective owners.
The use of these trademarks does not indicate endorsement of the trademark holder by Font Awesome, nor vice versa.
Brand icons should only be used to represent the company or product to which they refer.
15 changes: 13 additions & 2 deletions knimin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
#!/usr/bin/env python
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The LabAdmin Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------------------------------------------

from knimin.lib.configuration import config
from knimin.lib.data_access import KniminAccess
from knimin.lib.ag_jira import create_jira_handler
from knimin.lib.qiita_client import QiitaClient

db = KniminAccess(config)
jira_handler = create_jira_handler(config)
qiita_client = QiitaClient(config.qiita_host, config.qiita_client_id,
config.qiita_client_secret,
server_cert=config.qiita_server_cert)

__all__ = ['db', 'jira_handler']
__all__ = ['db', 'jira_handler', 'qiita_client']
10 changes: 10 additions & 0 deletions knimin/config.txt.example
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,13 @@ HOST = http://127.0.0.1:2990/jira
USERNAME = admin
PASSWORD = admin
PASSKEY =

[qiita]
# SERVER_CERT is only needed if the Qiita server doesn't have a valid certificate
HOST = https://localhost:21174
CLIENT_ID = 19ndkO3oMKsoChjVVWluF7QkxHRfYhTKSFbAVt8IhK7gZgDaO4
CLIENT_SECRET = J7FfQ7CQdOxuKhQAf1eoGgBAE81Ns8Gu3EKaWFm3IO2JKhAmmCWZuabe0O5Mp28s1
SERVER_CERT =

[platemapper]
SAMPLE_SHEET_DIR = /tmp
3 changes: 0 additions & 3 deletions knimin/handlers/ag_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,8 @@ def post(self):
barcode_info[ag_barcode['barcode']]['ag_info'] = ag_barcode
lab_barcode_info = db.get_barcode_details(
ag_barcode['barcode'])
plate = db.get_plate_for_barcode(
ag_barcode['barcode'])
barcode_info[ag_barcode['barcode']]['barcode_info'] = \
lab_barcode_info
barcode_info[ag_barcode['barcode']]['plate'] = plate
kit['barcode_info'] = barcode_info
display_results.append(login_display)

Expand Down
47 changes: 47 additions & 0 deletions knimin/handlers/pm_condense.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The LabAdmin Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------------------------------------------

from tornado.web import authenticated

from knimin.handlers.base import BaseHandler
from knimin.handlers.access_decorators import set_access
from knimin import db


@set_access(['Admin'])
class PMCondensePlatesHandler(BaseHandler):
@authenticated
def get(self):
dna_plates = db.get_dna_plate_list()
for plate in dna_plates:
plate['date'] = plate['date'].isoformat()

self.render("pm_condense.html",
plates=dna_plates,
robots=db.get_property_options("processing_robot"))

@authenticated
def post(self):
plate1 = self.get_argument('plate-1')
plate2 = self.get_argument('plate-2')
plate3 = self.get_argument('plate-3')
plate4 = self.get_argument('plate-4')
name = self.get_argument('name')
robot = self.get_argument('robot')
volume = self.get_argument('volume')

dna_plates = [(plate1, 0), (plate2, 1), (plate3, 2), (plate4, 3)]
plates = [plate1, plate2, plate3, plate4]
pos = [0, 1, 2, 3]
dna_plates = [(p, idx) for p, idx in zip(plates, pos) if p]
# Magic number 2 -> The only supported plate type here is
# a 384-well plate
plate_id = db.condense_dna_plates(
dna_plates, name, self.get_current_user(), robot, 2, volume)

self.redirect("/pm_quantify/?plate=%s" % plate_id)
47 changes: 47 additions & 0 deletions knimin/handlers/pm_create_study.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The LabAdmin Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------------------------------------------

from tornado.web import authenticated
from tornado.escape import json_decode, json_encode

from knimin.handlers.base import BaseHandler
from knimin.handlers.access_decorators import set_access
from knimin.lib.qiita_jira_util import create_study
from knimin import qiita_client, db


@set_access(['Admin'])
class PMCreateStudyHandler(BaseHandler):
@authenticated
def get(self):
_, qiita_persons = qiita_client.get('/api/v1/person')
# We don't have an id for each person. "Create" one by jsonizing
# the information of each person
for q in qiita_persons:
q['json'] = json_encode(q)

self.render("pm_create_study.html", currentuser=self.current_user,
qiita_persons=qiita_persons)

@authenticated
def post(self):
qiita_user = self.get_argument('qiita-user')
jira_user = self.get_argument('jira-user')
title = self.get_argument('study-title')
alias = self.get_argument('study-alias')
description = self.get_argument('study-description')
abstract = self.get_argument('study-abstract')
qiita_pi = json_decode(self.get_argument('qiita-pi'))
qiita_lp = json_decode(self.get_argument('qiita-lp'))

study_id = create_study(title, abstract, description, alias,
qiita_user, qiita_pi, qiita_lp, jira_user)
study = db.read_study(study_id)

self.render("pm_study_created.html", current_user=self.current_user,
title=title, study_id=study_id, jira_key=study['jira_id'])
Loading

0 comments on commit ef17d30

Please sign in to comment.