INNER CODE UNIT · Python

filter_entries

kblin/ncbi-genome-download · ncbi_genome_download/core.py:327

def filter_entries(entries, config):
    """Narrrow down which entries to download."""
    logger = logging.getLogger("ncbi-genome-download")

    def in_genus_list(species, genus_list):
        for genus in genus_list:
            if config.fuzzy_genus:
                if species.lower().find(genus.lower()) > -1:
                    return True
            elif species.startswith(genus):
                return True
            # Be nice and also find capitalised species names if the user didn't
            elif species.startswith(genus.capitalize()):
                return True
        return False

    new_entries = []
    for entry in entries:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…