def _transcript_weighted_conservation(subpath_data, gene2transcripts):
    """
    Return the transcript weighted conservation of a given subpath.
    """
    n_genes = len(gene2transcripts)
    transcript_fraction_sum = 0.0
    for gene in subpath_data.Genes:
        gene_transcripts = gene2transcripts[gene]
        subpath_transcripts = len(
            gene_transcripts.intersection(subpath_data.Transcripts))
        gene_transcripts = len(gene_transcripts)
        transcript_fraction_sum += (subpath_transcripts / gene_transcripts)
    return transcript_fraction_sum / n_genes