nodes: 0, module; 1, function_definition; 2, function_name:run_radia; 3, parameters; 4, block; 5, identifier:job; 6, identifier:rna_bam; 7, identifier:tumor_bam; 8, identifier:normal_bam; 9, identifier:univ_options; 10, identifier:radia_options; 11, expression_statement; 12, if_statement; 13, expression_statement; 14, comment:# Get a list of chromosomes to process; 15, if_statement; 16, expression_statement; 17, for_statement; 18, expression_statement; 19, return_statement; 20, comment:"""
      Spawn a RADIA job for each chromosome on the input bam trios.
  
      :param dict rna_bam: Dict of bam and bai for tumor DNA-Seq.  It can be one of two formats
             rna_bam:   # Just the genomic bam and bai
                  |- 'rna_genome_sorted.bam': fsID
                  +- 'rna_genome_sorted.bam.bai': fsID
             OR
             rna_bam:   # The output from run_star
                 |- 'rna_transcriptome.bam': fsID
                 |- 'rna_genome':     # Only this part will be used
                         |- 'rna_genome_sorted.bam': fsID
                         +- 'rna_genome_sorted.bam.bai': fsID
      :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
      :param dict normal_bam: Dict of bam and bai for normal DNA-Seq
      :param dict univ_options: Dict of universal options used by almost all tools
      :param dict radia_options: Options specific to RADIA
      :return: Dict of results from running RADIA on every chromosome
               perchrom_radia:
                   |- 'chr1': fsID
                   |- 'chr2' fsID
                   |
                   |-...
                   |
                   +- 'chrM': fsID
      :rtype: dict
      """; 21, comparison_operator:'rna_genome' in rna_bam.keys(); 22, block; 23, elif_clause; 24, else_clause; 25, assignment; 26, subscript; 27, block; 28, else_clause; 29, assignment; 30, identifier:chrom; 31, identifier:chromosomes; 32, block; 33, call; 34, identifier:perchrom_radia; 35, string; 36, call; 37, expression_statement; 38, comparison_operator:set(rna_bam.keys()) == {'rna_genome_sorted.bam', 'rna_genome_sorted.bam.bai'}; 39, block; 40, block; 41, identifier:bams; 42, dictionary; 43, identifier:radia_options; 44, string; 45, expression_statement; 46, block; 47, identifier:perchrom_radia; 48, call; 49, expression_statement; 50, expression_statement; 51, expression_statement; 52, attribute; 53, argument_list; 54, string_content:rna_genome; 55, attribute; 56, argument_list; 57, assignment; 58, call; 59, set; 60, pass_statement; 61, raise_statement; 62, pair; 63, pair; 64, pair; 65, pair; 66, pair; 67, pair; 68, string_content:chromosomes; 69, assignment; 70, expression_statement; 71, identifier:defaultdict; 72, argument_list; 73, assignment; 74, assignment; 75, assignment; 76, attribute; 77, identifier:logToMaster; 78, binary_operator:'Ran spawn_radia on %s successfully' % univ_options['patient']; 79, identifier:rna_bam; 80, identifier:keys; 81, identifier:rna_bam; 82, subscript; 83, identifier:set; 84, argument_list; 85, string; 86, string; 87, call; 88, string; 89, subscript; 90, string; 91, subscript; 92, string; 93, subscript; 94, string; 95, subscript; 96, string; 97, subscript; 98, string; 99, subscript; 100, identifier:chromosomes; 101, subscript; 102, assignment; 103, identifier:radia; 104, call; 105, identifier:filter_radia; 106, call; 107, subscript; 108, call; 109, identifier:job; 110, identifier:fileStore; 111, string; 112, subscript; 113, identifier:rna_bam; 114, string; 115, call; 116, string_content:rna_genome_sorted.bam; 117, string_content:rna_genome_sorted.bam.bai; 118, identifier:RuntimeError; 119, argument_list; 120, string_content:tumor_rna; 121, identifier:rna_bam; 122, string; 123, string_content:tumor_rnai; 124, identifier:rna_bam; 125, string; 126, string_content:tumor_dna; 127, identifier:tumor_bam; 128, string; 129, string_content:tumor_dnai; 130, identifier:tumor_bam; 131, string; 132, string_content:normal_dna; 133, identifier:normal_bam; 134, string; 135, string_content:normal_dnai; 136, identifier:normal_bam; 137, string; 138, identifier:radia_options; 139, string; 140, identifier:chromosomes; 141, call; 142, attribute; 143, argument_list; 144, attribute; 145, argument_list; 146, identifier:perchrom_radia; 147, identifier:chrom; 148, attribute; 149, argument_list; 150, string_content:Ran spawn_radia on %s successfully; 151, identifier:univ_options; 152, string; 153, string_content:rna_genome; 154, attribute; 155, argument_list; 156, string; 157, string_content:rna_genome_sorted.bam; 158, string_content:rna_genome_sorted.bam.bai; 159, string_content:tumor_dna_fix_pg_sorted.bam; 160, string_content:tumor_dna_fix_pg_sorted.bam.bai; 161, string_content:normal_dna_fix_pg_sorted.bam; 162, string_content:normal_dna_fix_pg_sorted.bam.bai; 163, string_content:chromosomes; 164, identifier:sample_chromosomes; 165, argument_list; 166, identifier:job; 167, identifier:addChildJobFn; 168, identifier:run_radia_perchrom; 169, identifier:bams; 170, identifier:univ_options; 171, identifier:radia_options; 172, identifier:chrom; 173, keyword_argument; 174, keyword_argument; 175, identifier:radia; 176, identifier:addChildJobFn; 177, identifier:run_filter_radia; 178, identifier:bams; 179, call; 180, identifier:univ_options; 181, identifier:radia_options; 182, identifier:chrom; 183, keyword_argument; 184, keyword_argument; 185, identifier:filter_radia; 186, identifier:rv; 187, string_content:patient; 188, identifier:rna_bam; 189, identifier:keys; 190, string_content:An improperly formatted dict was passed to rna_bam.; 191, identifier:job; 192, subscript; 193, identifier:memory; 194, string; 195, identifier:disk; 196, call; 197, attribute; 198, argument_list; 199, identifier:memory; 200, string; 201, identifier:disk; 202, call; 203, identifier:radia_options; 204, string; 205, string_content:6G; 206, identifier:PromisedRequirement; 207, argument_list; 208, identifier:radia; 209, identifier:rv; 210, string_content:6G; 211, identifier:PromisedRequirement; 212, argument_list; 213, string_content:genome_fai; 214, identifier:radia_disk; 215, subscript; 216, subscript; 217, subscript; 218, subscript; 219, identifier:radia_disk; 220, subscript; 221, subscript; 222, subscript; 223, subscript; 224, identifier:tumor_bam; 225, string; 226, identifier:normal_bam; 227, string; 228, identifier:rna_bam; 229, string; 230, identifier:radia_options; 231, string; 232, identifier:tumor_bam; 233, string; 234, identifier:normal_bam; 235, string; 236, identifier:rna_bam; 237, string; 238, identifier:radia_options; 239, string; 240, string_content:tumor_dna_fix_pg_sorted.bam; 241, string_content:normal_dna_fix_pg_sorted.bam; 242, string_content:rna_genome_sorted.bam; 243, string_content:genome_fasta; 244, string_content:tumor_dna_fix_pg_sorted.bam; 245, string_content:normal_dna_fix_pg_sorted.bam; 246, string_content:rna_genome_sorted.bam; 247, string_content:genome_fasta
code: def run_radia(job, rna_bam, tumor_bam, normal_bam, univ_options, radia_options):
      """
      Spawn a RADIA job for each chromosome on the input bam trios.
  
      :param dict rna_bam: Dict of bam and bai for tumor DNA-Seq.  It can be one of two formats
             rna_bam:   # Just the genomic bam and bai
                  |- 'rna_genome_sorted.bam': fsID
                  +- 'rna_genome_sorted.bam.bai': fsID
             OR
             rna_bam:   # The output from run_star
                 |- 'rna_transcriptome.bam': fsID
                 |- 'rna_genome':     # Only this part will be used
                         |- 'rna_genome_sorted.bam': fsID
                         +- 'rna_genome_sorted.bam.bai': fsID
      :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
      :param dict normal_bam: Dict of bam and bai for normal DNA-Seq
      :param dict univ_options: Dict of universal options used by almost all tools
      :param dict radia_options: Options specific to RADIA
      :return: Dict of results from running RADIA on every chromosome
               perchrom_radia:
                   |- 'chr1': fsID
                   |- 'chr2' fsID
                   |
                   |-...
                   |
                   +- 'chrM': fsID
      :rtype: dict
      """
      if 'rna_genome' in rna_bam.keys():
          rna_bam = rna_bam['rna_genome']
      elif set(rna_bam.keys()) == {'rna_genome_sorted.bam', 'rna_genome_sorted.bam.bai'}:
          pass
      else:
          raise RuntimeError('An improperly formatted dict was passed to rna_bam.')
          
      bams = {'tumor_rna': rna_bam['rna_genome_sorted.bam'],
              'tumor_rnai': rna_bam['rna_genome_sorted.bam.bai'],
              'tumor_dna': tumor_bam['tumor_dna_fix_pg_sorted.bam'],
              'tumor_dnai': tumor_bam['tumor_dna_fix_pg_sorted.bam.bai'],
              'normal_dna': normal_bam['normal_dna_fix_pg_sorted.bam'],
              'normal_dnai': normal_bam['normal_dna_fix_pg_sorted.bam.bai']}
      # Get a list of chromosomes to process
      if radia_options['chromosomes']:
          chromosomes = radia_options['chromosomes']
      else:
          chromosomes = sample_chromosomes(job, radia_options['genome_fai'])
      perchrom_radia = defaultdict()
      for chrom in chromosomes:
          radia = job.addChildJobFn(run_radia_perchrom, bams, univ_options, radia_options, chrom,
                                    memory='6G',
                                    disk=PromisedRequirement(
                                        radia_disk, tumor_bam['tumor_dna_fix_pg_sorted.bam'],
                                        normal_bam['normal_dna_fix_pg_sorted.bam'],
                                        rna_bam['rna_genome_sorted.bam'],
                                        radia_options['genome_fasta']))
          filter_radia = radia.addChildJobFn(run_filter_radia, bams, radia.rv(), univ_options,
                                             radia_options, chrom, memory='6G',
                                             disk=PromisedRequirement(
                                                 radia_disk, tumor_bam['tumor_dna_fix_pg_sorted.bam'],
                                                 normal_bam['normal_dna_fix_pg_sorted.bam'],
                                                 rna_bam['rna_genome_sorted.bam'],
                                                 radia_options['genome_fasta']))
          perchrom_radia[chrom] = filter_radia.rv()
      job.fileStore.logToMaster('Ran spawn_radia on %s successfully' % univ_options['patient'])
      return perchrom_radia