def galaxy_isa_upload_datalib_task(self, pks, param_pk, galaxy_pass, user_id):
    """

    """
    tt = TrackTasks(taskid=self.request.id,
                    state='RUNNING',
                    name='Uploading ISA projects to Galaxy',
                    user_id=user_id)
    tt.save()

    self.update_state(state='RUNNING',
                      meta={
                          'current': 0.1,
                          'total': 100,
                          'status': 'Uploading ISA projects to Galaxy'
                      })
    galaxy_isa_upload_param = FilesToGalaxyDataLibraryParam.objects.get(
        pk=param_pk)

    result_out = galaxy_isa_uplofad_datalib(pks, galaxy_isa_upload_param,
                                            galaxy_pass, user_id, self)

    if result_out:
        self.update_state(state='SUCCESS',
                          meta={
                              'current': 100,
                              'total': 100,
                              'status': 'completed'
                          })

    # save successful result
    tt.result = reverse('galaxy_summary')
    tt.state = 'SUCCESS'
    tt.save()
def search_nm_task(self, sp, userid):
    # track tasks in db
    tt = TrackTasks(taskid=self.request.id,
                    state='RUNNING',
                    name='Search nm values',
                    user_id=userid)
    tt.save()

    search_nm(sp, self)

    # save successful result
    tt.result = reverse('search_nm_result')
    tt.state = 'SUCCESS'
    tt.save()
def download_cannotations_task(self, pk, userid):
    # track tasks in db
    tt = TrackTasks(taskid=self.request.id,
                    state='RUNNING',
                    name='Downloading LC-MSMS annotations',
                    user_id=userid)
    tt.save()

    # perform function
    dam = DownloadAnnotations()
    dam.download_cannotations(pk, self)

    # save successful result
    tt.result = reverse('canns_download_result')
    tt.state = 'SUCCESS'
    tt.save()
def save_lcms_data_task(self, pk, userid):
    # track tasks in db
    tt = TrackTasks(taskid=self.request.id,
                    state='RUNNING',
                    name='LC-MSMS data upload',
                    user_id=userid)
    tt.save()

    # run function
    print('SAVE LCMS DATA')
    lcms_data_transfer = LcmsDataTransfer(pk, None)
    lcms_data_transfer.transfer(celery_obj=self)

    # save successful result
    tt.result = reverse('cpeakgroupmeta_summary')
    tt.state = 'SUCCESS'
    tt.save()
Beispiel #5
0
def upload_assay_data_files_dir_task(self, filelist, username, mapping_l,
                                     assayid, save_as_link,
                                     create_assay_details):
    """
    """

    tt = TrackTasks(taskid=self.request.id,
                    state='RUNNING',
                    name='Upload assay data file',
                    user=User.objects.filter(username=username)[0])
    tt.save()

    upload_assay_data_files_dir(filelist, username, mapping_l, assayid,
                                create_assay_details, save_as_link, self)

    tt.result = reverse('assayfile_summary', kwargs={'assayid': assayid})
    tt.state = 'SUCCESS'
    tt.save()
def upload_assay_data_files_dir_task(self, filelist, user_id, mapping_l,
                                     assayid, save_as_link,
                                     create_assay_details):
    """
    """
    users = get_user_model()
    tt = TrackTasks(taskid=self.request.id,
                    state='RUNNING',
                    name='Upload assay data file',
                    user=users.objects.get(pk=user_id))
    tt.save()

    upload_assay_data_files_dir(filelist, user_id, mapping_l, assayid,
                                create_assay_details, save_as_link, self)

    tt.result = reverse('assayfile_summary', kwargs={'assayid': assayid})
    tt.state = 'SUCCESS'
    tt.save()
def upload_metab_results_task(self, pk, userid):
    # track tasks in db
    tt = TrackTasks(taskid=self.request.id,
                    state='RUNNING',
                    name='Data upload',
                    user_id=userid)
    tt.save()

    # upload file
    results = UploadResults(pk, None)

    # run function
    results.upload(celery_obj=self)

    # save successful result
    tt.result = reverse('metabinputdata_summary')
    tt.state = 'SUCCESS'
    tt.save()
def upload_metab_results_galaxy_task(self, userid, galaxy_name, galaxy_data_id,
                                     galaxy_history_id, investigation_name):
    tt = TrackTasks(taskid=self.request.id,
                    state='RUNNING',
                    name='Data upload',
                    user_id=userid)
    tt.save()

    md = setup_results_file_from_galaxy(userid, galaxy_name, galaxy_data_id,
                                        galaxy_history_id, investigation_name,
                                        self)
    print('MD {}'.format(md))

    if not md:
        tt.result = reverse('metabinputdata_summary')
        tt.state = 'FAILURE'
        tt.save()
        return 0

    results = UploadResults(md.id, None)
    results.upload(celery_obj=self)

    # save successful result
    tt.result = reverse('metabinputdata_summary')
    tt.state = 'SUCCESS'
    tt.save()