def peakgene_overlaps(combos, same_genes, normalize=False):
    "Count the number of genes that overlap when examing the hg19 & hg38 \n    GISTIC runs' focal peaks."
    (venn_numbers, gsu, gsi) = ([], [], [])
    for (coh, ad) in combos:
        print(coh)
        fnames = [((('../hg19_gistic/' + coh) + ad) + 'genes.conf_99.txt'), ((('../hg38_gistic/' + coh) + ad) + 'genes.txt')]
        df38 = pd.read_table(fnames[0], index_col=0).drop(['q value', 'residual q value', 'wide peak boundaries'])
        df19 = pd.read_table(fnames[1], index_col=0).drop(['q value', 'residual q value', 'wide peak boundaries'])
        g_38 = (set([x for col in df38.columns for x in df38[col].dropna()]) & same_genes)
        g_19 = (set([x for col in df19.columns for x in df19[col].dropna()]) & same_genes)
        (intersect, union) = ((g_38 & g_19), (g_38 | g_19))
        gsu.append(union)
        gsi.append(intersect)
        if normalize:
            venn_numbers.append([(len((g_19 - intersect)) / len(union)), (len(intersect) / len(union)), (len((g_38 - intersect)) / len(union))])
        else:
            venn_numbers.append([len((g_19 - intersect)), len(intersect), len((g_38 - intersect))])
    index = [((x[0] + '_') + x[1][1:(- 1)]) for x in combos]
    return pd.DataFrame(venn_numbers, index=index, columns=['hg19 only', 'Intersection', 'hg38 only'])
Count the number of genes that overlap when examing the hg19 & hg38 
GISTIC runs' focal peaks.
def peakgene_overlaps(combos, same_genes, normalize=False):
    "Count the number of genes that overlap when examing the hg19 & hg38 \n    GISTIC runs' focal peaks."
    (venn_numbers, gsu, gsi) = ([], [], [])
    for (coh, ad) in combos:
        print(coh)
        fnames = [((('../hg19_gistic/' + coh) + ad) + 'genes.conf_99.txt'), ((('../hg38_gistic/' + coh) + ad) + 'genes.txt')]
        df38 = pd.read_table(fnames[0], index_col=0).drop(['q value', 'residual q value', 'wide peak boundaries'])
        df19 = pd.read_table(fnames[1], index_col=0).drop(['q value', 'residual q value', 'wide peak boundaries'])
        g_38 = (set([x for col in df38.columns for x in df38[col].dropna()]) & same_genes)
        g_19 = (set([x for col in df19.columns for x in df19[col].dropna()]) & same_genes)
        (intersect, union) = ((g_38 & g_19), (g_38 | g_19))
        gsu.append(union)
        gsi.append(intersect)
        if normalize:
            venn_numbers.append([(len((g_19 - intersect)) / len(union)), (len(intersect) / len(union)), (len((g_38 - intersect)) / len(union))])
        else:
            venn_numbers.append([len((g_19 - intersect)), len(intersect), len((g_38 - intersect))])
    index = [((x[0] + '_') + x[1][1:(- 1)]) for x in combos]
    return pd.DataFrame(venn_numbers, index=index, columns=['hg19 only', 'Intersection', 'hg38 only'])