def get_feature_fraction(line, feature_accessions):
    """Calculate the fraction of terms from the intersection of over-represented term (10th column in gProfiler output)
    are also in the set of accessions that represent proteins containing a certain feature (e.g. IDR, signal peptide)

    Parameters
    line (str):     Line from a gProfiler output file (tab separated and without quotation marks, see top of file)
    feature_accessions (set):
                    Set containing accessions that possess the feature of interest

    Returns
    fraction (int):
                    Fraction of accessions in the overrepresented term that contain the feature
    """

    term_accessions = line.split("\t")[9]
    term_accessions = {accession for accession in term_accessions.split(",")}

    with_feature = len(term_accessions.intersection(feature_accessions))
    return with_feature / len(term_accessions)