コード例 #1
0
def getAllSOPs():
    projectId = request.args.get('projectId')
    if (projectDAO.getProjectById(projectId)):
        sops = artefactDAO.getAllArtefacts(projectId)
        return jsonify(sops), status.HTTP_200_OK
    else:
        return 'Project with id does not exist.', status.HTTP_404_NOT_FOUND
コード例 #2
0
def getProjectById():
    id = request.args.get('id')
    project = projectDAO.getProjectById(id)
    if project:
        return jsonify(project), status.HTTP_200_OK
    else:
        return 'Project with id does not exist.', status.HTTP_404_NOT_FOUND
コード例 #3
0
def getSOPsByType():
    projectId = request.args.get('projectId')
    artefactClass = request.args.get('sopType')
    if (projectDAO.getProjectById(projectId)):
        sops = artefactDAO.getArtefactsByType(projectId, artefactClass)
        return jsonify(sops), status.HTTP_200_OK
    else:
        return 'Project with id does not exist.', status.HTTP_404_NOT_FOUND
コード例 #4
0
def getAllClinicalSamples():
    projectId = request.args.get('projectId')

    if (projectDAO.getProjectById(projectId)):
        samples = clinicalSampleDAO.getClinicalSamplesByProject(projectId)
        return jsonify(samples), status.HTTP_200_OK
    else:
        return 'Project with id does not exist.', status.HTTP_404_NOT_FOUND
コード例 #5
0
def getMaxCounter():
    projectId = request.args.get('projectId')

    if (projectDAO.getProjectById(projectId)):
        maxCounter = clinicalSampleDAO.getMaxCounter(projectId)
        return jsonify({"maxCounter": maxCounter}), status.HTTP_200_OK
    else:
        return 'Project with id does not exist.', status.HTTP_404_NOT_FOUND
コード例 #6
0
def getAllSpectralLibraries():
    projectId = request.args.get('projectId')

    if (projectDAO.getProjectById(projectId)):
        spec_libs = spectralLibraryDAO.getAllLibrariesForProject(projectId)
        for s in spec_libs:
            augmentedClinicalSamples = clinicalSampleDAO.augmentClinicalSampleNames(
                s['clinicalSamples'])
            augmentedMSRuns = MSRunDAO.augmentMSRunNames(s['msRunIds'])
            s['clinicalSamples'] = augmentedClinicalSamples
            s['msRunIds'] = augmentedMSRuns
        return jsonify(spec_libs), status.HTTP_200_OK
    else:
        return 'Project with id does not exist.', status.HTTP_404_NOT_FOUND
コード例 #7
0
def getMSRunsByProjectId():
    projectId = request.args.get('projectId')
    if (projectDAO.getProjectById(projectId)):
        msruns = MSRunDAO.getAllMSRunsByProjectId(projectId)
        for msrun in msruns:
            augmentedClinicalSamples = clinicalSampleDAO.augmentClinicalSampleNames(
                msrun['clinicalSamples'])
            msReadySampleName = msReadySamplesDAO.getMSReadySampleName(
                msrun['msReadySampleId'])
            msrun['clinicalSamples'] = augmentedClinicalSamples
            msrun['msReadySampleName'] = msReadySampleName
        return jsonify(msruns), status.HTTP_200_OK
    else:
        return 'Project with id does not exist.', status.HTTP_404_NOT_FOUND
コード例 #8
0
def getAllSwathAnalysis():
    projectId = request.args.get('projectId')

    if (projectDAO.getProjectById(projectId)):
        swath_analysis = swathAnalysisDAO.getSWATHByProject(projectId)
        for s in swath_analysis:
            augmentedClinicalSamples = clinicalSampleDAO.augmentClinicalSampleNames(
                s['clinicalSamples'])
            augmentedMSRuns = MSRunDAO.augmentMSRunNames(
                s['msRunIds'])
            s['clinicalSamples'] = augmentedClinicalSamples
            s['msRunIds'] = augmentedMSRuns
        return jsonify(swath_analysis), status.HTTP_200_OK
    else:
        return 'Project with id does not exist.', status.HTTP_404_NOT_FOUND
コード例 #9
0
def getMsReadySamplesByProject():
    projectId = request.args.get('projectId')

    if (projectDAO.getProjectById(projectId)):
        samples = msReadySamplesDAO.getMsReadySamplesByProject(projectId)
        for s in samples:
            augmentedClinicalSamples = clinicalSampleDAO.augmentClinicalSampleNames(
                s['clinicalSamples'])
            intermediateSampleName = intermediateSampleDAO.getIntermediateSampleName(
                s['intermediateSampleId'])
            s['clinicalSamples'] = augmentedClinicalSamples
            s['intermediateSampleName'] = intermediateSampleName
        return jsonify(samples), status.HTTP_200_OK
    else:
        return 'Project with id does not exist.', status.HTTP_404_NOT_FOUND
コード例 #10
0
def getIntermediateSamplesByProject():
    projectId = request.args.get('projectId')

    if (projectDAO.getProjectById(projectId)):
        samples = intermediateSampleDAO.getIntermediateSamplesByProject(
            projectId)
        for s in samples:
            augmentedClinicalSamples = clinicalSampleDAO.augmentClinicalSampleNames(
                s['clinicalSamples'])
            # if('parentSamples' in s):
            #     augmentedIntermediateSamples = intermediateSampleDAO.augmentIntermediateSampleNames(
            #         s['parentSamples'])
            #     s['parentSamples'] = augmentedIntermediateSamples
            s['clinicalSamples'] = augmentedClinicalSamples

        return jsonify(samples), status.HTTP_200_OK
    else:
        return 'Project with id does not exist.', status.HTTP_404_NOT_FOUND