def run_mutect(job, tumor_bam, normal_bam, univ_options, mutect_options, chrom):
    """
    This module will run mutect on the DNA bams

    ARGUMENTS
    1. tumor_bam: REFER ARGUMENTS of spawn_mutect()
    2. normal_bam: REFER ARGUMENTS of spawn_mutect()
    3. univ_options: REFER ARGUMENTS of spawn_mutect()
    4. mutect_options: REFER ARGUMENTS of spawn_mutect()
    5. chrom: String containing chromosome name with chr appended

    RETURN VALUES
    1. output_files: Dict of results of mutect for chromosome
            output_files
              |- 'mutect_CHROM.vcf': <JSid>
              +- 'mutect_CHROM.out': <JSid>

    This module corresponds to node 12 on the tree
    """
    job.fileStore.logToMaster('Running mutect on %s:%s' % (univ_options['patient'], chrom))
    work_dir = job.fileStore.getLocalTempDir()
    input_files = {
        'tumor.bam': tumor_bam['tumor_dna_fix_pg_sorted.bam'],
        'tumor.bam.bai': tumor_bam['tumor_dna_fix_pg_sorted.bam.bai'],
        'normal.bam': normal_bam['normal_dna_fix_pg_sorted.bam'],
        'normal.bam.bai': normal_bam['normal_dna_fix_pg_sorted.bam.bai'],
        'genome.fa': mutect_options['genome_fasta'],
        'genome.fa.fai': mutect_options['genome_fai'],
        'genome.dict': mutect_options['genome_dict'],
        'cosmic.vcf': mutect_options['cosmic_vcf'],
        'cosmic.vcf.idx': mutect_options['cosmic_idx'],
        'dbsnp.vcf': mutect_options['dbsnp_vcf'],
        'dbsnp.vcf.idx': mutect_options['dbsnp_idx']}
    input_files = get_files_from_filestore(job, input_files, work_dir,
                                           docker=True)
    mutout = ''.join([work_dir, '/mutect_', chrom, '.out'])
    mutvcf = ''.join([work_dir, '/mutect_', chrom, '.vcf'])
    parameters = ['-R', input_files['genome.fa'],
                  '--cosmic', input_files['cosmic.vcf'],
                  '--dbsnp', input_files['dbsnp.vcf'],
                  '--input_file:normal', input_files['normal.bam'],
                  '--input_file:tumor', input_files['tumor.bam'],
                  #'--tumor_lod', str(10),
                  #'--initial_tumor_lod', str(4.0),
                  '-L', chrom,
                  '--out', docker_path(mutout),
                  '--vcf', docker_path(mutvcf)
                 ]
    Xmx = mutect_options['java_Xmx'] if mutect_options['java_Xmx'] else univ_options['java_Xmx']
    docker_call(tool='mutect:1.1.7', tool_parameters=parameters, work_dir=work_dir,
                dockerhub=univ_options['dockerhub'], java_opts=Xmx)
    output_files = defaultdict()
    for mutect_file in [mutout, mutvcf]:
        output_files[os.path.basename(mutect_file)] = job.fileStore.writeGlobalFile(mutect_file)
    return output_files
def run_mutect ( job , tumor_bam , normal_bam , univ_options , mutect_options , chrom ) : job . fileStore . logToMaster ( 'Running mutect on %s:%s' % ( univ_options [ 'patient' ] , chrom ) ) work_dir = job . fileStore . getLocalTempDir ( ) input_files = { 'tumor.bam' : tumor_bam [ 'tumor_dna_fix_pg_sorted.bam' ] , 'tumor.bam.bai' : tumor_bam [ 'tumor_dna_fix_pg_sorted.bam.bai' ] , 'normal.bam' : normal_bam [ 'normal_dna_fix_pg_sorted.bam' ] , 'normal.bam.bai' : normal_bam [ 'normal_dna_fix_pg_sorted.bam.bai' ] , 'genome.fa' : mutect_options [ 'genome_fasta' ] , 'genome.fa.fai' : mutect_options [ 'genome_fai' ] , 'genome.dict' : mutect_options [ 'genome_dict' ] , 'cosmic.vcf' : mutect_options [ 'cosmic_vcf' ] , 'cosmic.vcf.idx' : mutect_options [ 'cosmic_idx' ] , 'dbsnp.vcf' : mutect_options [ 'dbsnp_vcf' ] , 'dbsnp.vcf.idx' : mutect_options [ 'dbsnp_idx' ] } input_files = get_files_from_filestore ( job , input_files , work_dir , docker = True ) mutout = '' . join ( [ work_dir , '/mutect_' , chrom , '.out' ] ) mutvcf = '' . join ( [ work_dir , '/mutect_' , chrom , '.vcf' ] ) parameters = [ '-R' , input_files [ 'genome.fa' ] , '--cosmic' , input_files [ 'cosmic.vcf' ] , '--dbsnp' , input_files [ 'dbsnp.vcf' ] , '--input_file:normal' , input_files [ 'normal.bam' ] , '--input_file:tumor' , input_files [ 'tumor.bam' ] , '-L' , chrom , '--out' , docker_path ( mutout ) , '--vcf' , docker_path ( mutvcf ) ] Xmx = mutect_options [ 'java_Xmx' ] if mutect_options [ 'java_Xmx' ] else univ_options [ 'java_Xmx' ] docker_call ( tool = 'mutect:1.1.7' , tool_parameters = parameters , work_dir = work_dir , dockerhub = univ_options [ 'dockerhub' ] , java_opts = Xmx ) output_files = defaultdict ( ) for mutect_file in [ mutout , mutvcf ] : output_files [ os . path . basename ( mutect_file ) ] = job . fileStore . writeGlobalFile ( mutect_file ) return output_files
This module will run mutect on the DNA bams

    ARGUMENTS
    1. tumor_bam: REFER ARGUMENTS of spawn_mutect()
    2. normal_bam: REFER ARGUMENTS of spawn_mutect()
    3. univ_options: REFER ARGUMENTS of spawn_mutect()
    4. mutect_options: REFER ARGUMENTS of spawn_mutect()
    5. chrom: String containing chromosome name with chr appended

    RETURN VALUES
    1. output_files: Dict of results of mutect for chromosome
            output_files
              |- 'mutect_CHROM.vcf': <JSid>
              +- 'mutect_CHROM.out': <JSid>

    This module corresponds to node 12 on the tree