code: def align_dna(job, fastqs, sample_type, univ_options, bwa_options):
      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 = 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()