docs: def reporter(metadata, analysistype, reportpath):
          """
          Create the core genome report
          :param metadata: type LIST: List of metadata objects
          :param analysistype: type STR: Current analysis type
          :param reportpath: type STR: Absolute path to folder in which the reports are to be created
          :return:
          """
          header = 'Strain,ClosestRef,GenesPresent/Total,\n'
          data = str()
          for sample in metadata:
              try:
                  if sample[analysistype].blastresults != 'NA':
                      if sample.general.closestrefseqgenus == 'Listeria':
                          # Write the sample name, closest ref genome, and the # of genes found / total # of genes
                          closestref = list(sample[analysistype].blastresults.items())[0][0]
                          coregenes = list(sample[analysistype].blastresults.items())[0][1][0]
                          # Find the closest reference file
                          try:
                              ref = glob(os.path.join(sample[analysistype].targetpath, '{fasta}*'
                                                      .format(fasta=closestref)))[0]
                          except IndexError:
                              # Replace underscores with dashes to find files
                              closestref = closestref.replace('_', '-')
                              ref = glob(os.path.join(sample[analysistype].targetpath, '{fasta}*'
                                                      .format(fasta=closestref)))[0]
                          # Determine the number of core genes present in the closest reference file
                          totalcore = 0
                          for _ in SeqIO.parse(ref, 'fasta'):
                              totalcore += 1
                          # Add the data to the object
                          sample[analysistype].targetspresent = coregenes
                          sample[analysistype].totaltargets = totalcore
                          sample[analysistype].coreresults = '{cg}/{tc}'.format(cg=coregenes,
                                                                                tc=totalcore)
                          row = '{sn},{cr},{cg}/{tc}\n'.format(sn=sample.name,
                                                               cr=closestref,
                                                               cg=coregenes,
                                                               tc=totalcore)
                          # Open the report
                          with open(os.path.join(sample[analysistype].reportdir,
                                                 '{sn}_{at}.csv'.format(sn=sample.name,
                                                                        at=analysistype)), 'w') as report:
                              # Write the row to the report
                              report.write(header)
                              report.write(row)
                          data += row
                      else:
                          sample[analysistype].targetspresent = 'NA'
                          sample[analysistype].totaltargets = 'NA'
                          sample[analysistype].coreresults = 'NA'
              except KeyError:
                  sample[analysistype].targetspresent = 'NA'
                  sample[analysistype].totaltargets = 'NA'
                  sample[analysistype].coreresults = 'NA'
          with open(os.path.join(reportpath, 'coregenome.csv'), 'w') as report:
              # Write the data to the report
              report.write(header)
              report.write(data)