from typing import Callable
from typing import Tuple


def parse_line(line: str, distance_metric: Callable) -> Tuple[str, str, float]:
    """Parse a line of BLAST+6 output.

    Parameters
    ----------
    line : str
        A blast line in format `-outfmt "6 qacc sacc length qlen slen ident"`
    distance_metric : Callable
        A function that computes a distance metric from the info in `line`.

    Returns
    -------
    query_accession : str
        The query sequence accession.
    subject_accession : str
        The subject sequence accession.
    distance : float
        The distance between the sequences.
    """
    qacc, sacc, length, qlen, slen, ident = line.split()
    return qacc, sacc, distance_metric(int(ident), int(qlen), int(slen))