nodes: 0, module; 1, function_definition; 2, function_name:align_dna; 3, parameters; 4, block; 5, identifier:job; 6, identifier:fastqs; 7, identifier:sample_type; 8, identifier:univ_options; 9, identifier:bwa_options; 10, expression_statement; 11, comment:# The mkdup and regroup steps use picard that allots heap space using the Xmx key in the; 12, comment:# univ_options dictionary. This should reflect in the job allotment. Since We want all these; 13, comment:# jobs to occur on the same node, we ened to give them all the same memory requirements.; 14, expression_statement; 15, expression_statement; 16, comment:# reheader takes the same disk as sam2bam so we can serialize this on the same worker.; 17, expression_statement; 18, expression_statement; 19, expression_statement; 20, expression_statement; 21, expression_statement; 22, expression_statement; 23, expression_statement; 24, expression_statement; 25, expression_statement; 26, expression_statement; 27, return_statement; 28, comment:"""
      A wrapper for the entire dna alignment subgraph.
  
      :param list fastqs: The input fastqs for alignment
      :param str sample_type: Description of the sample to inject into the filename
      :param dict univ_options: Dict of universal options used by almost all tools
      :param dict bwa_options: Options specific to bwa
      :return: Dict containing output bam and bai
               output_files:
                   |- '<sample_type>_fix_pg_sorted.bam': fsID
                   +- '<sample_type>_fix_pg_sorted.bam.bai': fsID
      :rtype: dict
      """; 29, assignment; 30, assignment; 31, assignment; 32, assignment; 33, assignment; 34, assignment; 35, call; 36, call; 37, call; 38, call; 39, call; 40, call; 41, call; 42, identifier:bwa; 43, call; 44, identifier:sam2bam; 45, call; 46, identifier:reheader; 47, call; 48, identifier:regroup; 49, call; 50, identifier:mkdup; 51, call; 52, identifier:index; 53, call; 54, attribute; 55, argument_list; 56, attribute; 57, argument_list; 58, attribute; 59, argument_list; 60, attribute; 61, argument_list; 62, attribute; 63, argument_list; 64, attribute; 65, argument_list; 66, attribute; 67, argument_list; 68, attribute; 69, argument_list; 70, attribute; 71, argument_list; 72, attribute; 73, argument_list; 74, attribute; 75, argument_list; 76, attribute; 77, argument_list; 78, attribute; 79, argument_list; 80, identifier:job; 81, identifier:addChild; 82, identifier:bwa; 83, identifier:bwa; 84, identifier:addChild; 85, identifier:sam2bam; 86, identifier:sam2bam; 87, identifier:addChild; 88, identifier:reheader; 89, identifier:reheader; 90, identifier:addChild; 91, identifier:regroup; 92, identifier:regroup; 93, identifier:addChild; 94, identifier:mkdup; 95, identifier:mkdup; 96, identifier:addChild; 97, identifier:index; 98, identifier:index; 99, identifier:rv; 100, identifier:job; 101, identifier:wrapJobFn; 102, identifier:run_bwa; 103, identifier:fastqs; 104, identifier:sample_type; 105, identifier:univ_options; 106, identifier:bwa_options; 107, keyword_argument; 108, keyword_argument; 109, keyword_argument; 110, identifier:job; 111, identifier:wrapJobFn; 112, identifier:bam_conversion; 113, call; 114, identifier:sample_type; 115, identifier:univ_options; 116, subscript; 117, keyword_argument; 118, keyword_argument; 119, identifier:job; 120, identifier:wrapJobFn; 121, identifier:fix_bam_header; 122, call; 123, identifier:sample_type; 124, identifier:univ_options; 125, subscript; 126, keyword_argument; 127, keyword_argument; 128, identifier:job; 129, identifier:wrapJobFn; 130, identifier:add_readgroups; 131, call; 132, identifier:sample_type; 133, identifier:univ_options; 134, subscript; 135, keyword_argument; 136, keyword_argument; 137, identifier:job; 138, identifier:wrapJobFn; 139, identifier:mark_duplicates; 140, call; 141, identifier:sample_type; 142, identifier:univ_options; 143, subscript; 144, keyword_argument; 145, keyword_argument; 146, identifier:job; 147, identifier:wrapJobFn; 148, identifier:index_bamfile; 149, call; 150, identifier:sample_type; 151, identifier:univ_options; 152, subscript; 153, keyword_argument; 154, keyword_argument; 155, keyword_argument; 156, identifier:disk; 157, call; 158, identifier:memory; 159, subscript; 160, identifier:cores; 161, subscript; 162, attribute; 163, argument_list; 164, identifier:bwa_options; 165, string; 166, identifier:disk; 167, call; 168, identifier:memory; 169, subscript; 170, attribute; 171, argument_list; 172, identifier:bwa_options; 173, string; 174, identifier:disk; 175, call; 176, identifier:memory; 177, subscript; 178, attribute; 179, argument_list; 180, identifier:bwa_options; 181, string; 182, identifier:disk; 183, call; 184, identifier:memory; 185, subscript; 186, attribute; 187, argument_list; 188, identifier:bwa_options; 189, string; 190, identifier:disk; 191, call; 192, identifier:memory; 193, subscript; 194, attribute; 195, argument_list; 196, identifier:bwa_options; 197, string; 198, identifier:sample_info; 199, string; 200, identifier:disk; 201, call; 202, identifier:memory; 203, subscript; 204, identifier:PromisedRequirement; 205, argument_list; 206, identifier:univ_options; 207, string; 208, identifier:bwa_options; 209, string; 210, identifier:bwa; 211, identifier:rv; 212, string_content:samtools; 213, identifier:PromisedRequirement; 214, argument_list; 215, identifier:univ_options; 216, string; 217, identifier:sam2bam; 218, identifier:rv; 219, string_content:samtools; 220, identifier:PromisedRequirement; 221, argument_list; 222, identifier:univ_options; 223, string; 224, identifier:reheader; 225, identifier:rv; 226, string_content:picard; 227, identifier:PromisedRequirement; 228, argument_list; 229, identifier:univ_options; 230, string; 231, identifier:regroup; 232, identifier:rv; 233, string_content:picard; 234, identifier:PromisedRequirement; 235, argument_list; 236, identifier:univ_options; 237, string; 238, identifier:mkdup; 239, identifier:rv; 240, string_content:samtools; 241, string_content:fix_pg_sorted; 242, identifier:PromisedRequirement; 243, argument_list; 244, identifier:univ_options; 245, string; 246, identifier:bwa_disk; 247, identifier:fastqs; 248, subscript; 249, string_content:java_Xmx; 250, string_content:n; 251, identifier:sam2bam_disk; 252, call; 253, string_content:java_Xmx; 254, identifier:sam2bam_disk; 255, call; 256, string_content:java_Xmx; 257, identifier:regroup_disk; 258, call; 259, string_content:java_Xmx; 260, identifier:mkdup_disk; 261, call; 262, string_content:java_Xmx; 263, identifier:index_disk; 264, call; 265, string_content:java_Xmx; 266, identifier:bwa_options; 267, string; 268, attribute; 269, argument_list; 270, attribute; 271, argument_list; 272, attribute; 273, argument_list; 274, attribute; 275, argument_list; 276, attribute; 277, argument_list; 278, string_content:index; 279, identifier:bwa; 280, identifier:rv; 281, identifier:bwa; 282, identifier:rv; 283, identifier:reheader; 284, identifier:rv; 285, identifier:regroup; 286, identifier:rv; 287, identifier:mkdup; 288, identifier:rv
code: def align_dna(job, fastqs, sample_type, univ_options, bwa_options):
      """
      A wrapper for the entire dna alignment subgraph.
  
      :param list fastqs: The input fastqs for alignment
      :param str sample_type: Description of the sample to inject into the filename
      :param dict univ_options: Dict of universal options used by almost all tools
      :param dict bwa_options: Options specific to bwa
      :return: Dict containing output bam and bai
               output_files:
                   |- '<sample_type>_fix_pg_sorted.bam': fsID
                   +- '<sample_type>_fix_pg_sorted.bam.bai': fsID
      :rtype: dict
      """
      # The mkdup and regroup steps use picard that allots heap space using the Xmx key in the
      # univ_options dictionary. This should reflect in the job allotment. Since We want all these
      # jobs to occur on the same node, we ened to give them all the same memory requirements.
  
      bwa = job.wrapJobFn(run_bwa, fastqs, sample_type, univ_options, bwa_options,
                          disk=PromisedRequirement(bwa_disk, fastqs, bwa_options['index']),
                          memory=univ_options['java_Xmx'],
                          cores=bwa_options['n'])
      sam2bam = job.wrapJobFn(bam_conversion, bwa.rv(), sample_type, univ_options,
                              bwa_options['samtools'],
                              disk=PromisedRequirement(sam2bam_disk, bwa.rv()),
                              memory=univ_options['java_Xmx'])
      # reheader takes the same disk as sam2bam so we can serialize this on the same worker.
      reheader = job.wrapJobFn(fix_bam_header, sam2bam.rv(), sample_type, univ_options,
                               bwa_options['samtools'],
                               disk=PromisedRequirement(sam2bam_disk, bwa.rv()),
                               memory=univ_options['java_Xmx'])
      regroup = job.wrapJobFn(add_readgroups, reheader.rv(), sample_type, univ_options,
                              bwa_options['picard'],
                              disk=PromisedRequirement(regroup_disk, reheader.rv()),
                              memory=univ_options['java_Xmx'])
      mkdup = job.wrapJobFn(mark_duplicates, regroup.rv(), sample_type, univ_options,
                            bwa_options['picard'],
                            disk=PromisedRequirement(mkdup_disk, regroup.rv()),
                            memory=univ_options['java_Xmx'])
      index = job.wrapJobFn(index_bamfile, mkdup.rv(), sample_type, univ_options,
                            bwa_options['samtools'], sample_info='fix_pg_sorted',
                            disk=PromisedRequirement(index_disk, mkdup.rv()),
                            memory=univ_options['java_Xmx'])
      job.addChild(bwa)
      bwa.addChild(sam2bam)
      sam2bam.addChild(reheader)
      reheader.addChild(regroup)
      regroup.addChild(mkdup)
      mkdup.addChild(index)
      return index.rv()