Exemplo n.º 1
0
def main():
    global options, args

    # Read essay state json
    essay = Essay()
    essay.read_essay(options.essay_path)

    print 'Launching prepare4genesys jobs for essay', essay.get_name()

    # Create GeneSys compatible file
    annotation = FileData(name=essay.get_name() + '_annotation.vcf', data_type='analysis', modifier='-i ',
                          add_args='annotation', path=essay.get_path())
    genesys_psv = FileData(name=essay.get_name() + '_GeneSys.psv', data_type='trash', modifier='-o ',
                           add_args='prepare4genesys', path=essay.get_path())
    hold_jobs = essay.submit_from_essay(job_name='genesys', command='vcf2GeneSys.py', input_data=annotation,
                                        output_data=genesys_psv, module=module)

    # Export result files via jenkins task (cURL) (only if not exome)
    if essay.get_target_name() is not None and not (
            essay.get_target_name().startswith('exome') or essay.get_target_name().startswith('exoma')):
        if 'gluster2' in essay.get_path():
            param = '\'http://*****:*****@10.0.0.82:8080/view/Bioinfo/job/Pipeta_Baming_G2/buildWithParameters?token=SOCELTOKENG2&path=' + essay.get_path() + '&project=' + essay.get_project_name() + '&analysis=' + essay.get_name() + '\''
        else:
            param = '\'http://*****:*****@10.0.0.82:8080/view/Bioinfo/job/Pipeta_Baming_G1/buildWithParameters?token=SOCELTOKENG1&path=' + essay.get_path() + '&project=' + essay.get_project_name() + '&analysis=' + essay.get_name() + '\''
        hold_jobs = essay.submit_from_essay(job_name='curl2UGM', command='curl', add_args=param, module=module,
                                            hold_jobs=hold_jobs)

        # Call the vcf2DBNLVar script
        #hold_jobs.append(
        #    essay.submit_from_essay(job_name='vcf2DBNLVar', command='vcf2DBNLVar', input_data=annotation,
        #                            module=module))
    return hold_jobs
Exemplo n.º 2
0
def sample_stats_json_reader(essay_path):
    #Create essay object
    essay = Essay()

    #Read essay
    essay.read_essay(essay_path)

    #Get sample list
    essay_sample_id_list = sorted(essay.get_samples())

    #Create empty sample_structure
    mapping_stats_sample_list = []

    for sample in essay_sample_id_list:
        mapping_performance_file = essay.get_arg(info_type='tree',
                                                 folder_type='analysis',
                                                 keys=[
                                                     'stats',
                                                     '{0}'.format(sample),
                                                     'replicate1',
                                                     'mapping_performance.txt'
                                                 ])

        seq_platform = essay.get_arg(
            info_type='samples',
            folder_type='{0}'.format(sample),
            keys=['replicates', 'replicate1', 'seq_platform'])

        sequencer = essay.get_arg(
            info_type='samples',
            folder_type='{0}'.format(sample),
            keys=['replicates', 'replicate1', 'sequencer'])

        size = essay.get_arg(info_type='samples',
                             folder_type='{0}'.format(sample),
                             keys=['replicates', 'replicate1', 'size'])

        mapping_stats_sample_list.append({
            sample: {
                'mapping_performance': mapping_performance_file,
                'mapping_stats': []
            }
        })

    for sample_item in mapping_stats_sample_list:
        for sample_id in sample_item.keys():
            mapping_performance_file = sample_item.get(sample_id).get(
                'mapping_performance')

            mapping_stats = sample_item.get(sample_id).get('mapping_stats')
            mapping_stats.extend(get_mapping_stats(mapping_performance_file))

    return essay_sample_id_list, mapping_stats_sample_list, seq_platform, sequencer, size
Exemplo n.º 3
0
def main():
    global options, args

    # Read essay state json
    essay = Essay()
    essay.read_essay(options.essay_path)

    print 'Launching prepare4genesys jobs for essay', essay.get_name()

    # Create GeneSys compatible file
    annotation = FileData(name=essay.get_name() + '_annotation.vcf',
                          data_type='analysis',
                          modifier='-i ',
                          add_args='annotation',
                          path=essay.get_path())
    genesys_psv = FileData(name=essay.get_name() + '_GeneSys.psv',
                           data_type='trash',
                           modifier='-o ',
                           add_args='prepare4genesys',
                           path=essay.get_path())
    hold_jobs = essay.submit_from_essay(job_name='genesys',
                                        command='vcf2GeneSys.py',
                                        input_data=annotation,
                                        output_data=genesys_psv,
                                        module=module)

    # Export result files via jenkins task (cURL) (only if not exome)
    if essay.get_target_name() is not None and not (
            essay.get_target_name().startswith('exome')
            or essay.get_target_name().startswith('exoma')):
        if 'gluster2' in essay.get_path():
            param = '\'http://*****:*****@10.0.0.82:8080/view/Bioinfo/job/Pipeta_Baming_G2/buildWithParameters?token=SOCELTOKENG2&path=' + essay.get_path(
            ) + '&project=' + essay.get_project_name(
            ) + '&analysis=' + essay.get_name() + '\''
        else:
            param = '\'http://*****:*****@10.0.0.82:8080/view/Bioinfo/job/Pipeta_Baming_G1/buildWithParameters?token=SOCELTOKENG1&path=' + essay.get_path(
            ) + '&project=' + essay.get_project_name(
            ) + '&analysis=' + essay.get_name() + '\''
        hold_jobs = essay.submit_from_essay(job_name='curl2UGM',
                                            command='curl',
                                            add_args=param,
                                            module=module,
                                            hold_jobs=hold_jobs)

        # Call the vcf2DBNLVar script
        #hold_jobs.append(
        #    essay.submit_from_essay(job_name='vcf2DBNLVar', command='vcf2DBNLVar', input_data=annotation,
        #                            module=module))
    return hold_jobs
Exemplo n.º 4
0
def sample_stats_json_reader(essay_path):
    # Create essay object
    essay = Essay()

    # Read essay
    essay.read_essay(essay_path)

    # Get sample list
    essay_sample_id_list = sorted(essay.get_samples())

    # Create empty sample_structure
    mapping_stats_sample_list = []

    for sample in essay_sample_id_list:
        mapping_performance_file = essay.get_arg(
            info_type="tree",
            folder_type="analysis",
            keys=["stats", "{0}".format(sample), "replicate1", "mapping_performance.txt"],
        )

        seq_platform = essay.get_arg(
            info_type="samples", folder_type="{0}".format(sample), keys=["replicates", "replicate1", "seq_platform"]
        )

        sequencer = essay.get_arg(
            info_type="samples", folder_type="{0}".format(sample), keys=["replicates", "replicate1", "sequencer"]
        )

        size = essay.get_arg(
            info_type="samples", folder_type="{0}".format(sample), keys=["replicates", "replicate1", "size"]
        )

        mapping_stats_sample_list.append(
            {sample: {"mapping_performance": mapping_performance_file, "mapping_stats": []}}
        )

    for sample_item in mapping_stats_sample_list:
        for sample_id in sample_item.keys():
            mapping_performance_file = sample_item.get(sample_id).get("mapping_performance")

            mapping_stats = sample_item.get(sample_id).get("mapping_stats")
            mapping_stats.extend(get_mapping_stats(mapping_performance_file))

    return essay_sample_id_list, mapping_stats_sample_list, seq_platform, sequencer, size