<commit_before>import numpy
import pandas
import itertools

rppa_file = 'data/TableS1-Split.xlsx'
expression_file = 'data/Expression_Filtered.csv'
mutation_file = 'data/WES_variants_filtered.csv'

cell_lines = ['C32', 'COLO858', 'K2', 'LOXIMVI', 'MMACSF', 'MZ7MEL',
              'RVH421', 'SKMEL28', 'WM115', 'WM1552C']

antibodies = {'pMEK(S217/221)': ['MAP2K1', 'MAP2K2'],
              'pERK(T202/Y204)': ['MAPK1', 'MAPK3'],
              'p-p90RSK(S380)': ['RPS6KA1'],
              'p-p90RSK(T573)': ['RPS6KA1'],
              'p-AKT(T308)': ['AKT1'],
              'p-AKT(S473)': ['AKT1', 'AKT2', 'AKT3'],
              'p-mTOR(S2448)': ['MTOR'],
              'p-p70S6K(T421/S424)': ['RPS6KB1'],
              'p-p70S6K(T389)': ['RPS6KB1'],
              'p-S6(S235/236)': ['RPS6'],
              'p-AMPK(T172)': ['PRKAA1'],
              'p-JNK(T183/Y185)': ['MAPK8', 'MAPK9', 'MAPK10'],
              'Total c-Jun': ['JUN'],
              'p-cJun(S63)': ['JUN'],
              'p-P38(T180/Y182)': ['MAPK14'],
              'p-HSP27(S82)': ['HSPB1'],
              'p-NFKB(S536)': ['RELA'],
              'Bim': ['BCL2L11'],
              'cPARP': ['PARP1'],
              'p-Histone H3(S10)': ['HIST1H3A', 'HIST1H3B', 'HIST1H3C',
                                    'HIST1H3D', 'HIST1H3E', 'HIST1H3F',
                                    'HIST1H3G', 'HIST1H3H', 'HIST1H3I',
                                    'HIST1H3J', 'HIST2H3A', 'HIST2H3C',
                                    'HIST2H3D', 'H3F3A', 'H3F3B'],
              'p27 Kip1': ['CDKN1B']}


def read_rppa_data(fname=rppa_file):
    """Return RPPA data as a dict median/std DataFrames."""
    data = {}
    for cell_line in cell_lines:
        print('Reading data for %s' % cell_line)
        data[cell_line] = {}
        # Read both the median and the std sheet for each cell line
        for data_type, postfix in (('median', ''), ('std', '-std')):
            # Handle unpredictable number of extra rows before the actual
            # header row.
            i = 0
            while True:
                df = pandas.read_excel(fname, sheetname=(cell_line + postfix),
                                       skiprows=i, header=0)
                if df.columns[0] == 'Drug':
                    break
                i += 1
            data[cell_line][data_type] = df
    return data

<commit_msg>Drug names and synonyms dict<commit_after>import numpy
import pandas
import itertools

rppa_file = 'data/TableS1-Split.xlsx'
expression_file = 'data/Expression_Filtered.csv'
mutation_file = 'data/WES_variants_filtered.csv'

cell_lines = ['C32', 'COLO858', 'K2', 'LOXIMVI', 'MMACSF', 'MZ7MEL',
              'RVH421', 'SKMEL28', 'WM115', 'WM1552C']

drug_dict = {'AZ628': ['AZ628', 'AZ_628', 'AZ-628', '878739-06-1'],
             'Selumetinib': ['Selumetinib', 'AZD6244', 'AZD 6244',
                             'ARRY-142886', '606143-52-6'],
             'SB590885': ['SB590885', 'SB-590885', 'J-501805', '405554-55-4'],
             'Vemurafenib': ['Vemurafenib', 'Zelboraf', 'PLX4032', 'PLX-4032',
                             'RG7204', 'RG-7204', 'R05185426', '918504-65-1',
                             '1029872-54-5'],
             'PLX4720': ['PLX4720', 'PLX 4720', 'PLX-4720', 'PLX_4720']}

antibody_HGNC_dict = {'pMEK(S217/221)': ['MAP2K1', 'MAP2K2'],
                      'pERK(T202/Y204)': ['MAPK1', 'MAPK3'],
                      'p-p90RSK(S380)': ['RPS6KA1'],
                      'p-p90RSK(T573)': ['RPS6KA1'],
                      'p-AKT(T308)': ['AKT1'],
                      'p-AKT(S473)': ['AKT1', 'AKT2', 'AKT3'],
                      'p-mTOR(S2448)': ['MTOR'],
                      'p-p70S6K(T421/S424)': ['RPS6KB1'],
                      'p-p70S6K(T389)': ['RPS6KB1'],
                      'p-S6(S235/236)': ['RPS6'],
                      'p-AMPK(T172)': ['PRKAA1'],
                      'p-JNK(T183/Y185)': ['MAPK8', 'MAPK9', 'MAPK10'],
                      'Total c-Jun': ['JUN'],
                      'p-cJun(S63)': ['JUN'],
                      'p-P38(T180/Y182)': ['MAPK14'],
                      'p-HSP27(S82)': ['HSPB1'],
                      'p-NFKB(S536)': ['RELA'],
                      'Bim': ['BCL2L11'],
                      'cPARP': ['PARP1'],
                      'p-Histone H3(S10)': ['HIST1H3A', 'HIST1H3B', 'HIST1H3C',
                                            'HIST1H3D', 'HIST1H3E', 'HIST1H3F',
                                            'HIST1H3G', 'HIST1H3H', 'HIST1H3I',
                                            'HIST1H3J', 'HIST2H3A', 'HIST2H3C',
                                            'HIST2H3D', 'H3F3A', 'H3F3B'],
                      'p27 Kip1': ['CDKN1B']}


def read_rppa_data(fname=rppa_file):
    """Return RPPA data as a dict median/std DataFrames."""
    data = {}
    for cell_line in cell_lines:
        print('Reading data for %s' % cell_line)
        data[cell_line] = {}
        # Read both the median and the std sheet for each cell line
        for data_type, postfix in (('median', ''), ('std', '-std')):
            # Handle unpredictable number of extra rows before the actual
            # header row.
            i = 0
            while True:
                df = pandas.read_excel(fname, sheetname=(cell_line + postfix),
                                       skiprows=i, header=0)
                if df.columns[0] == 'Drug':
                    break
                i += 1
            data[cell_line][data_type] = df
    return data


{'fraction_non_alphanumeric': 0.17399200871776244, 'fraction_numerical': 0.08790410461314929, 'mean_word_length': 1.5769770706598034, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6869729', 'n_tokens_mistral': 2307, 'n_tokens_neox': 1989, 'n_words': 358}