code: def sort_and_index_star(job, star_bams, univ_options, star_options):
      star_options['samtools']['n'] = star_options['n']
      sort = job.wrapJobFn(sort_bamfile, star_bams['rnaAligned.out.bam'], 'rna', univ_options,
                           samtools_options=star_options['samtools'],
                           disk=PromisedRequirement(sort_disk, star_bams['rnaAligned.out.bam']))
      index = job.wrapJobFn(index_bamfile, sort.rv(), 'rna', univ_options,
                            samtools_options=star_options['samtools'], sample_info='genome_sorted',
                            disk=PromisedRequirement(index_disk, sort.rv()))
      job.addChild(sort)
      sort.addChild(index)
      return {'rna_genome': index.rv(),
              'rna_transcriptome.bam': star_bams['rnaAligned.toTranscriptome.out.bam'],
              'rnaChimeric.out.junction': star_bams['rnaChimeric.out.junction']}