def map_paired_end(credentials, instance_config, instance_name,<EOL>script_dir, index_dir, fastq_file_pair, output_dir,<EOL>num_threads=None, <EOL>max_intron_size=None, max_mate_dist=None,<EOL>splice_min_overhang=None,<EOL>out_mult_nmax=None, sort_bam=True, keep_unmapped=False,<EOL>seed_start_lmax=None,<EOL>mismatch_nmax=None, multimap_nmax=None,<EOL>self_destruct=True, compressed=True,<EOL>**kwargs):<EOL>
if isinstance(fastq_file_pair[<NUM_LIT:0>], (str, _oldstr)):<EOL><INDENT>fastq_file_pairs = [fastq_file_pair]<EOL><DEDENT>else:<EOL><INDENT>fastq_file_pairs = fastq_file_pair<EOL><DEDENT>if sort_bam:<EOL><INDENT>out_sam_type = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>out_sam_type = '<STR_LIT>'<EOL><DEDENT>template = _TEMPLATE_ENV.get_template(<EOL>os.path.join('<STR_LIT>'))<EOL>startup_script = template.render(<EOL>script_dir=script_dir,<EOL>index_dir=index_dir,<EOL>fastq_file_pairs=fastq_file_pairs,<EOL>output_dir=output_dir,<EOL>compressed=compressed,<EOL>num_threads=num_threads,<EOL>seed_start_lmax=seed_start_lmax,<EOL>self_destruct=self_destruct,<EOL>mismatch_nmax=mismatch_nmax,<EOL>multimap_nmax=multimap_nmax,<EOL>splice_min_overhang=splice_min_overhang,<EOL>out_mult_nmax=out_mult_nmax,<EOL>out_sam_type=out_sam_type,<EOL>max_intron_size=max_intron_size,<EOL>max_mate_dist=max_mate_dist,<EOL>keep_unmapped=keep_unmapped)<EOL>if len(startup_script) > <NUM_LIT>:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>op_name = instance_config.create_instance(<EOL>credentials, instance_name, startup_script=startup_script, **kwargs)<EOL>return op_name<EOL>
Maps single-end reads using STAR.

    Recommended machine type: "n1-highmem-8" (52 GB of RAM, 8 vCPUs)

    TODO: docstring