def data_frame_to_smiles_tuples(data_frame):
    """Extracts the smiles patterns of the components in each
    substance in a given data frame.

    Parameters
    ----------
    data_frame: pandas.DataFrame
        The data frame to extract the component smiles from.

    Returns
    -------
    list of tuple of str
        The smiles patterns of the measured substances.
    """
    max_n_components = int(data_frame[f"N Components"].max())

    all_smiles_tuples = []

    for n_components in range(1, max_n_components + 1):

        data_subset = data_frame[data_frame["N Components"] == n_components]

        all_smiles = [
            data_subset[f"Component {i + 1}"].tolist() for i in range(n_components)
        ]

        smiles_tuples = list(zip(*all_smiles))
        all_smiles_tuples.extend(tuple(sorted(x)) for x in smiles_tuples)

    all_smiles_tuples = list(set(all_smiles_tuples))

    return all_smiles_tuples