Exemplo n.º 1
0
    def post(self):

        parser = RequestParsers.study_type_report_parser()
        studytype = None

        args = parser.parse_args(req=request)
        studytype = args['studytype']
        slim = args['slim']
        verbose = args['verbose']
        drive = args['drive']

        if studytype:
            studytype = studytype.strip()
        else:
            abort(400)

        # User authentication
        user_token = None
        if "user_token" in request.headers:
            user_token = request.headers["user_token"]
        else:
            abort(401)

        wsc = WsClient()

        is_curator, __, __, __, study_location, __, __, __ = wsc.get_permissions('MTBLS1', user_token)
        if is_curator is False:
            abort(413)

        reporting_path = app.config.get('MTBLS_FTP_ROOT') + app.config.get('REPORTING_PATH') + 'global/'

        msg = AnalyticalMethodBuilder(
            original_study_location=study_location,
            studytype=studytype,
            slim=slim,
            reporting_path=reporting_path,
            verbose=verbose,
            g_drive=drive
        ).build()

        logger.info(msg)
        return jsonify({'message': msg})
Exemplo n.º 2
0
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

from flask import request, abort
from flask_restful import Resource
from flask_restful_swagger import swagger
from app.ws.mtblsWSclient import WsClient
from app.ws.utils import *
from app.ws.isaApiClient import IsaApiClient

logger = logging.getLogger('wslog')
wsc = WsClient()
iac = IsaApiClient()


class Convert2ISAtab(Resource):
    @swagger.operation(
        summary="Convert mzML files into ISA-Tab",
        notes=
        '''</P><B>Be aware that any ISA-Tab files will be overwritten for this study</P>
        This process can run for a long while, please be patient</B>''',
        parameters=[{
            "name": "study_id",
            "description":
            "Existing Study Identifier for generating new ISA-Tab files",
            "required": True,
            "allowMultiple": False,
Exemplo n.º 3
0
    def __init__(self):
        self.inv_filename = "i_Investigation.txt"
        self.wsc = WsClient()  # MetaboLights (Java-Based) WebService client

        return