def make_classyfire_graphml(graphML, final):
    """Create a network file with chemical classes mapped

    :param graphml: GNPS network file
    :type graphml: networkx.classes.graph.Graph
    :param final: A dataframe containing most predominant chemical classes per node at each level of the ClassyFire chemical ontology
    :type final: pandas.core.frame.DataFrame
    :return: A network file with most predominant chemical classes per node mapped at each level of the ClassyFire chemical ontology
    :rtype: networkx.classes.graph.Graph

    """
    for v in graphML.nodes():
        graphML.node[v]['CF_componentindex'] = str(final[final[
            'cluster index'] == int(v)]['CF_componentindex'].iloc[-1])
        graphML.node[v]['CF_NrNodes'] = float(final[final['cluster index'] ==
            int(v)]['CF_NrNodes'].iloc[-1])
        graphML.node[v]['CF_kingdom'] = str(final[final['cluster index'] ==
            int(v)]['CF_kingdom'].iloc[-1])
        try:
            graphML.node[v]['CF_kingdom_score'] = float(final[final[
                'cluster index'] == int(v)]['CF_kingdom_score'].iloc[-1])
        except:
            graphML.node[v]['CF_kingdom_score'] = object()
        graphML.node[v]['CF_superclass'] = str(final[final['cluster index'] ==
            int(v)]['CF_superclass'].iloc[-1])
        try:
            graphML.node[v]['CF_superclass_score'] = float(final[final[
                'cluster index'] == int(v)]['CF_superclass_score'].iloc[-1])
        except:
            graphML.node[v]['CF_superclass_score'] = object()
        graphML.node[v]['CF_class'] = str(final[final['cluster index'] ==
            int(v)]['CF_class'].iloc[-1])
        try:
            graphML.node[v]['CF_class_score'] = float(final[final[
                'cluster index'] == int(v)]['CF_class_score'].iloc[-1])
        except:
            graphML.node[v]['CF_class_score'] = object()
        graphML.node[v]['CF_subclass'] = str(final[final['cluster index'] ==
            int(v)]['CF_subclass'].iloc[-1])
        try:
            graphML.node[v]['CF_subclass_score'] = float(final[final[
                'cluster index'] == int(v)]['CF_subclass_score'].iloc[-1])
        except:
            graphML.node[v]['CF_subclass_score'] = object()
        graphML.node[v]['CF_Dparent'] = str(final[final['cluster index'] ==
            int(v)]['CF_Dparent'].iloc[-1])
        try:
            graphML.node[v]['CF_Dparent_score'] = float(final[final[
                'cluster index'] == int(v)]['CF_Dparent_score'].iloc[-1])
        except:
            graphML.node[v]['CF_Dparent_score'] = object()
        graphML.node[v]['CF_MFramework'] = str(final[final['cluster index'] ==
            int(v)]['CF_MFramework'].iloc[-1])
        try:
            graphML.node[v]['CF_MFramework_score'] = float(final[final[
                'cluster index'] == int(v)]['CF_MFramework_score'].iloc[-1])
        except ValueError:
            graphML.node[v]['CF_MFramework_score'] = object()
    return graphML
