code: def add_readgroups(job, bamfile, sample_type, univ_options, picard_options):
      
      work_dir = os.getcwd()
      input_files = {
          sample_type + '.bam': bamfile}
      get_files_from_filestore(job, input_files, work_dir, docker=True)
      parameters = ['AddOrReplaceReadGroups',
                    'CREATE_INDEX=false',
                    'I=/data/' + sample_type + '.bam',
                    'O=/data/' + sample_type + '_reheader.bam',
                    'SO=coordinate',
                    'ID=1',
                    ''.join(['LB=', univ_options['patient']]),
                    'PL=ILLUMINA',
                    'PU=12345',
                    ''.join(['SM=', sample_type.rstrip('_dna')])]
      docker_call(tool='picard', tool_parameters=parameters, work_dir=work_dir,
                  dockerhub=univ_options['dockerhub'], java_xmx=univ_options['java_Xmx'],
                  tool_version=picard_options['version'])
      output_file = job.fileStore.writeGlobalFile(
          '/'.join([work_dir, sample_type + '_reheader.bam']))
      # Delete the old bam file
      job.fileStore.deleteGlobalFile(bamfile)
      job.fileStore.logToMaster('Ran add_read_groups on %s:%s successfully'
                                % (univ_options['patient'], sample_type))
      return output_file
docs: Add read groups to the bam.
  
      :param dict bamfile: The input bam file
      :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 picard_options: Options specific to picard
      :return: fsID for the output bam
      :rtype: toil.fileStore.FileID