def list_species(db, species=[]):
    """Print name of species in "genes" collection to logger
    Can be useful to get exact strings for "species" arguments in other database
    operations.

    Args:
      db: Pointer to MongoDB
      species: optional list of species, restricts output to species in list (Default value = [])

    Returns:
      Nothing
    """

    species_list = db["genes"].distinct("species")
    if species:
        species_list = set(species).intersection(set(species_list))
        print("The \"{}\" database contains:".format(db.name))
        print("\n".join(sorted(species_list)))
        print("but not:")
        print("\n".join(sorted(set(species).difference(set(species_list)))))
    else:
        print("The \"{}\" database contains:".format(db.name))
        print("\n".join(sorted(species_list)))

    return(sorted(species_list))