from typing import Optional
from pathlib import Path
import logging


def get_specific_ids(specific_ids_path: Optional[Path] = None):
    """
    If there is a specific_ids_path file, take the ids within and process them
    exclusively.
    :param specific_ids_path:  The path of a text file with id per line
    :return: List of read ids from the specific_ids_path file
    """
    if specific_ids_path is None or not specific_ids_path.exists():
        return
    with open(specific_ids_path) as filo:
        specific_ids = [l.strip() for l in filo.readlines()]
    logging.info(f"We found specific ids. They are: {specific_ids}")
    return specific_ids