parameters: (feature, regions, chr_names)
return_statement: return region_2_chr_name
docstring: returns dictionary to translate chromosome name in list of features (genes or operons) to
      chromosome name in reference file.
docstring_summary: returns dictionary to translate chromosome name in list of features (genes or operons) to
      chromosome name in reference file.
docstring_tokens: returns dictionary to translate chromosome name in list of features ( genes or operons ) to chromosome name in reference file .
function: def chromosomes_names_dict(feature, regions, chr_names):
      """
      returns dictionary to translate chromosome name in list of features (genes or operons) to
      chromosome name in reference file.
      """
      region_2_chr_name = {}
  
      for region in regions:
          if region.seqname in chr_names:
              region_2_chr_name[region.seqname] = region.seqname
          else:
              region_2_chr_name[region.seqname] = None
  
      if len(chr_names) == 1 and len(region_2_chr_name) == 1 and region_2_chr_name[regions[0].seqname] is None:
          chr_name = chr_names.pop()
          logger.notice('Reference name in file with genomic features of type "%s" (%s) does not match the name in the reference file (%s). '
                        'QUAST will ignore this issue and count as if they match.' %
                        (feature, regions[0].seqname, chr_name),
                 indent='  ')
          for region in regions:
              region.seqname = chr_name
              region_2_chr_name[region.seqname] = chr_name
      elif all(chr_name is None for chr_name in region_2_chr_name.values()):
          logger.warning('Reference names in file with genomic features of type "%s" do not match any chromosome. Check your genomic feature file(s).' % (feature),
                  indent='  ')
      elif None in region_2_chr_name.values():
          logger.warning('Some of the reference names in file with genomic features of type "%s" does not match any chromosome. '
                         'Check your genomic feature file(s).' % (feature), indent='  ')
  
      return region_2_chr_name
function_tokens: def chromosomes_names_dict ( feature , regions , chr_names ) : region_2_chr_name = { } for region in regions : if region . seqname in chr_names : region_2_chr_name [ region . seqname ] = region . seqname else : region_2_chr_name [ region . seqname ] = None if len ( chr_names ) == 1 and len ( region_2_chr_name ) == 1 and region_2_chr_name [ regions [ 0 ] . seqname ] is None : chr_name = chr_names . pop ( ) logger . notice ( 'Reference name in file with genomic features of type "%s" (%s) does not match the name in the reference file (%s). ' 'QUAST will ignore this issue and count as if they match.' % ( feature , regions [ 0 ] . seqname , chr_name ) , indent = '  ' ) for region in regions : region . seqname = chr_name region_2_chr_name [ region . seqname ] = chr_name elif all ( chr_name is None for chr_name in region_2_chr_name . values ( ) ) : logger . warning ( 'Reference names in file with genomic features of type "%s" do not match any chromosome. Check your genomic feature file(s).' % ( feature ) , indent = '  ' ) elif None in region_2_chr_name . values ( ) : logger . warning ( 'Some of the reference names in file with genomic features of type "%s" does not match any chromosome. ' 'Check your genomic feature file(s).' % ( feature ) , indent = '  ' ) return region_2_chr_name