def get_species_reaction_sets(reaction_sets, species):
    """Returns species-specific reaction sets.

    :param reaction_sets: ReactionSets object representing CoMetGeNe reaction
        sets obtained from CoMetGeNe trails
    :param species: query species (KEGG organism code)
    :return: list of species-specific CoMetGeNe reaction sets
    """
    species_reaction_sets = list()

    for reaction_set in reaction_sets.sets:
        if species in reaction_set.organisms:
            maximum_set = True
            for superset in reaction_set.supersets:
                if species in superset.organisms:
                    maximum_set = False
                    break
            if len(reaction_set.supersets) == 0 or maximum_set:
                species_reaction_sets.append(reaction_set)

    return species_reaction_sets