Skip to contents

This function performs a fuzzy merge of unique compositions based on sorted strains and percentages. It compares the percentages within a given tolerance to decide whether they should be considered the same. This function performs a full join without filtering, the user should filter afterwards if they want an 'inner join' behavior.

Usage

fuzzy_merge_unique_compositions(user_data, db_data, tolerance = 0.01)

Arguments

user_data

Data frame containing sorted_strains_key and sorted_percentages columns, typically the output from get_unique_compositions_from_user_data.

db_data

Data frame containing sorted_strains_key and sorted_percentages columns, typically the output from get_unique_compositions_from_database.

tolerance

Numeric tolerance within which two percentages are considered similar. Default is 0.01.

Value

A data frame with a logical column 'match' indicating whether the compositions from user_data and db_data match within the given tolerance.