code: def file_contigs(ref_file, config=None):
      
      ContigInfo = collections.namedtuple("ContigInfo", "name size")
      with open(fasta_idx(ref_file, config)) as in_handle:
          for line in (l for l in in_handle if l.strip()):
              name, size = line.split()[:2]
              yield ContigInfo(name, int(size))
docs: Iterator of reference contigs and lengths from a reference file.