def datasource(): """Use pepdata to fetch and search IEDB epitopes""" print request.vars db = request.vars.database epitope = request.vars.epitope from pepdata import iedb, hpv, imma2, hiv_frahm, tcga, tantigen if db == 'iedb': df = iedb.mhc.load_dataframe(mhc_class=2,human=False) df.columns = df.columns.get_level_values(1) df = df[df.columns[5:18]] #df = iedb.tcell.load_dataframe() #if epitope != '': # df = df[df['Description'].str.contains(epitope)] #print df elif db == 'hpv': df = hpv.load_mhc() #df = hpv.load_tcell() elif db == 'IMMA2': df, non = imma2.load_classes() elif db == 'hiv_frahm': df = hiv_frahm.load_dataframe() elif db == 'tcga': df = tcga.load_dataframe(cancer_type='paad') df = df[:50] elif db == 'tantigen': df = tantigen.load_mhc() #df = tantigen.load_tcell() if len(df) > 5000: df = df[:5000] print df return dict(results=df)
def test_same_size(): peptides = hiv_frahm.load_set() df = hiv_frahm.load_dataframe() assert len(peptides) == len(df)
def test_load_dataframe(): df = hiv_frahm.load_dataframe() assert df is not None assert len(df) > 0