code: def clean_gff(gff, cleaned, add_chr=False, chroms_to_ignore=None,
                featuretypes_to_ignore=None):
      
      logger.info("Cleaning GFF")
      chroms_to_ignore = chroms_to_ignore or []
      featuretypes_to_ignore = featuretypes_to_ignore or []
      with open(cleaned, 'w') as fout:
          for i in gffutils.iterators.DataIterator(gff):
              if add_chr:
                  i.chrom = "chr" + i.chrom
  
              if i.chrom in chroms_to_ignore:
                  continue
  
              if i.featuretype in featuretypes_to_ignore:
                  continue
              fout.write(str(i) + '\n')
      return cleaned
docs: Cleans a GFF file by removing features on unwanted chromosomes and of
      unwanted featuretypes.  Optionally adds "chr" to chrom names.