def profile_match(adapter, profiles, hard_threshold=0.95, soft_threshold=0.9):

    """
        given a dict of profiles, searches through all the samples in the DB
        for a match. If a matching sample is found an exception is raised,
        and the variants will not be loaded into the database.

        Args:
            adapter (MongoAdapter): Adapter to mongodb
            profiles (dict(str)): The profiles (given as strings) for each sample in vcf.
            hard_threshold(float): Rejects load if hamming distance above this is found
            soft_threshold(float): Stores similar samples if hamming distance above this is found

        Returns:
            matches(dict(list)): list of similar samples for each sample in vcf.
    """
    matches = {sample: [] for sample in profiles.keys()}
    for case in adapter.cases():

        for individual in case['individuals']:

            for sample in profiles.keys():

                if individual.get('profile'):

                    similarity = compare_profiles(
                        profiles[sample], individual['profile']
                    )

                    if similarity >= hard_threshold:

                        msg = (
                                f"individual {sample} has a {similarity} similarity "
                                f"with individual {individual['ind_id']} in case "
                                f"{case['case_id']}"
                        )
                        LOG.critical(msg)

                        #Raise some exception
                        raise ProfileError

                    if similarity >= soft_threshold:

                        match = f"{case['case_id']}.{individual['ind_id']}"
                        matches[sample].append(match)

    return matches
given a dict of profiles, searches through all the samples in the DB
        for a match. If a matching sample is found an exception is raised,
        and the variants will not be loaded into the database.

        Args:
            adapter (MongoAdapter): Adapter to mongodb
            profiles (dict(str)): The profiles (given as strings) for each sample in vcf.
            hard_threshold(float): Rejects load if hamming distance above this is found
            soft_threshold(float): Stores similar samples if hamming distance above this is found

        Returns:
            matches(dict(list)): list of similar samples for each sample in vcf.