예제 #1
0
def sample_loop(job,
                bucket_region,
                s3_bucket,
                uuid_list,
                bwa_inputs,
                adam_inputs,
                gatk_preprocess_inputs,
                gatk_adam_call_inputs,
                gatk_gatk_call_inputs,
                pipeline_to_run,
                skip_alignment,
                skip_preprocessing,
                autoscale_cluster):
  """
  Loops over the sample_ids (uuids) in the manifest, creating child jobs to process each
  """

  for uuid in uuid_list:

    uuid_bwa_inputs = copy.deepcopy(bwa_inputs)
    uuid_adam_inputs = copy.deepcopy(adam_inputs)
    uuid_gatk_preprocess_inputs = copy.deepcopy(gatk_preprocess_inputs)
    uuid_gatk_adam_call_inputs = copy.deepcopy(gatk_adam_call_inputs)
    uuid_gatk_gatk_call_inputs = copy.deepcopy(gatk_gatk_call_inputs)

    ## set uuid inputs
    uuid_bwa_inputs['lb'] = uuid
    uuid_bwa_inputs['uuid'] = uuid
    uuid_adam_inputs['outDir'] = 's3://{s3_bucket}/analysis/{uuid}'.format(**locals())
    uuid_adam_inputs['bamName'] = 's3://{s3_bucket}/alignment/{uuid}.bam'.format(**locals())
    uuid_gatk_preprocess_inputs['s3_dir'] = '{s3_bucket}/analysis/{uuid}'.format(**locals())
    uuid_gatk_adam_call_inputs['s3_dir'] = '{s3_bucket}/analysis/{uuid}'.format(**locals())
    uuid_gatk_gatk_call_inputs['s3_dir'] = '{s3_bucket}/analysis/{uuid}'.format(**locals())

    # are we autoscaling? if so, bump the cluster size by one now
    if autoscale_cluster:
        Samples.increase_nodes(uuid, 1)

    job.addChildJobFn(static_dag,
                      bucket_region,
                      s3_bucket,
                      uuid,
                      uuid_bwa_inputs,
                      uuid_adam_inputs,
                      uuid_gatk_preprocess_inputs,
                      uuid_gatk_adam_call_inputs,
                      uuid_gatk_gatk_call_inputs,
                      pipeline_to_run,
                      skip_alignment,
                      skip_preprocessing,
                      autoscale_cluster)
예제 #2
0
def sample_loop(job, uuid_list, inputs):
  """
  Loops over the sample_ids (uuids) in the manifest, creating child jobs to process each
  """

  for uuid_rg in uuid_list:

    uuid_items = uuid_rg.split(',')
    uuid = uuid_items[0]
    rg_line = None
    if len(uuid_items) > 1:
        rg_line = uuid_items[1]

    # are we autoscaling? if so, bump the cluster size by one now
    if inputs.autoscale_cluster:
        Samples.increase_nodes(uuid, 1)

    job.addChildJobFn(static_dag, uuid, rg_line, inputs)
예제 #3
0
def decrease_node_count(job, nodes_to_add, uuid):

    Samples.decrease_nodes(uuid, nodes_to_add)