code: def setup_jobs(outpath, options, input_files):
      ''' This function sets up the jobs by creating the necessary input files as expected.
            - outpath is where the output is to be stored.
            - options is the optparse options object.
            - input_files is a list of paths to input files.
      '''
      job_inputs = None
      reverse_mapping = None
      fasta_file_contents = {}
      for input_file in input_files:
          assert(not(fasta_file_contents.get(input_file)))
          if any(fnmatch(input_file, x) for x in pdb_file_wildcards):
              pdb = PDB.from_filepath(input_file, strict=True)
              pdb.pdb_id = os.path.basename(input_file).split('.')[0]            
              if pdb.pdb_id.startswith('pdb') and len(pdb.pdb_id) >= 7:
                  pdb.pdb_id = pdb.pdb_id.replace('pdb', '')    
              fasta_file_contents[input_file] = (pdb.create_fasta(prefer_seqres_order = False), 'PDB')
          else:
              fasta_file_contents[input_file] = (read_file(input_file), 'FASTA')
      found_sequences, reverse_mapping, errors = get_sequences(options, fasta_file_contents)
      if found_sequences:
          reformat(found_sequences)
      if errors:
          return None, False, errors
      desired_sequences = {}
      for key, sequence in found_sequences.iteritems():
          pdb_id, chain, file_name = key
          if options.chain is None or chain == options.chain:
              desired_sequences[key] = sequence
      job_inputs, errors = create_inputs(options, outpath, desired_sequences)
      if reverse_mapping:
          segment_mapping_file = os.path.join(outpath, "segment_map.json")
          colorprinter.message("Creating a reverse mapping file %s." % segment_mapping_file)
          write_file(segment_mapping_file, json.dumps(reverse_mapping))
      post_processing_script = read_file(os.path.join(os.path.split(os.path.realpath(__file__))[0], 'post_processing.py'))
      write_file(os.path.join(outpath, 'post_processing.py'), post_processing_script, 'w')
      if options.secondary_structure_file:
          write_file(os.path.join(outpath, 'ss_filter.json'), json.dumps({'secondary_structure_filter' : SecondaryStructureDefinition.from_filepath(options.secondary_structure_file).data}), 'w')
      return job_inputs, reverse_mapping != None, errors