# Path: modules/pepdata/common.py
# def _prepare_memoization_key(args, kwargs):
# def memoize(fn):
#     def wrapped_fn(*args, **kwargs):
# def int_or_seq(x):
# def dataframe_from_counts(counts):
# 
# Path: modules/pepdata/features.py
# def make_unlabeled_ngram_dataset_from_args(loader, *args, **kwargs):
#     loader_kwargs, kwargs = _split_ngram_kwargs(kwargs)
#     strings = loader(*args, **loader_kwargs)
#     return make_unlabeled_ngram_dataset(strings, **kwargs)
# 
# Path: modules/pepdata/reduced_alphabet.py
# def make_alphabet_transformer(reduced_alphabet):
#     if isinstance(reduced_alphabet, (str, unicode)):
#         reduced_alphabet = globals()[reduced_alphabet]
#     return AlphabetTransformer(reduced_alphabet)
# 
# Path: modules/pepdata/static_data.py
# DATA_DIR = join(PACKAGE_DIR, 'data')


from os.path import join
from .common import bad_amino_acids
from .features import make_unlabeled_ngram_dataset_from_args
from .reduced_alphabet import make_alphabet_transformer
from .static_data import DATA_DIR
import pandas as pd
        c = hla.str.startswith('C')
        mask &= (a | b | c)
    elif mhc_class == 2:
        mask &= hla.str.startswith('D')
    if hla_type:
        mask &= hla.str.contains(hla_type, na=False).astype('bool')
    if exclude_hla_type:
        mask &= ~(hla.str.contains(exclude_hla_type, na=True).astype('bool'))
    if peptide_length:
        mask &= epitopes.str.len() == peptide_length
    df = df[mask]
    if reduced_alphabet:
        epitopes = df[epitope_column_name]
        df[epitope_column_name] = \
            epitopes.map(make_alphabet_transformer(reduced_alphabet))
    return df

def load_tcell(*args, **kwargs):
    tcell_path = join(DATA_DIR, 'cvc_hpv_tcell.csv')
    return _load_dataframe(tcell_path, 'Epitope sequence', *args, **kwargs)

def load_tcell_set(*args, **kwargs):
    df = load_tcell(*args, **kwargs)
    return set(df['Epitope sequence'])

def load_tcell_ngrams(*args, **kwargs):
    return make_unlabeled_ngram_dataset_from_args(
        load_tcell_set, *args, **kwargs)

def load_mhc(*args, **kwargs):

# Path: modules/pepdata/common.py
# def _prepare_memoization_key(args, kwargs):
# def memoize(fn):
#     def wrapped_fn(*args, **kwargs):
# def int_or_seq(x):
# def dataframe_from_counts(counts):
# 
# Path: modules/pepdata/features.py
# def make_unlabeled_ngram_dataset_from_args(loader, *args, **kwargs):
#     loader_kwargs, kwargs = _split_ngram_kwargs(kwargs)
#     strings = loader(*args, **loader_kwargs)
#     return make_unlabeled_ngram_dataset(strings, **kwargs)
# 
# Path: modules/pepdata/reduced_alphabet.py
# def make_alphabet_transformer(reduced_alphabet):
#     if isinstance(reduced_alphabet, (str, unicode)):
#         reduced_alphabet = globals()[reduced_alphabet]
#     return AlphabetTransformer(reduced_alphabet)
# 
# Path: modules/pepdata/static_data.py
# DATA_DIR = join(PACKAGE_DIR, 'data')


# Path: modules/pepdata/hpv.py
from os.path import join
from .common import bad_amino_acids
from .features import make_unlabeled_ngram_dataset_from_args
from .reduced_alphabet import make_alphabet_transformer
from .static_data import DATA_DIR
import pandas as pd

        c = hla.str.startswith('C')
        mask &= (a | b | c)
    elif mhc_class == 2:
        mask &= hla.str.startswith('D')
    if hla_type:
        mask &= hla.str.contains(hla_type, na=False).astype('bool')
    if exclude_hla_type:
        mask &= ~(hla.str.contains(exclude_hla_type, na=True).astype('bool'))
    if peptide_length:
        mask &= epitopes.str.len() == peptide_length
    df = df[mask]
    if reduced_alphabet:
        epitopes = df[epitope_column_name]
        df[epitope_column_name] = \
            epitopes.map(make_alphabet_transformer(reduced_alphabet))
    return df

def load_tcell(*args, **kwargs):
    tcell_path = join(DATA_DIR, 'cvc_hpv_tcell.csv')
    return _load_dataframe(tcell_path, 'Epitope sequence', *args, **kwargs)

def load_tcell_set(*args, **kwargs):
    df = load_tcell(*args, **kwargs)
    return set(df['Epitope sequence'])

def load_tcell_ngrams(*args, **kwargs):
    return make_unlabeled_ngram_dataset_from_args(
        load_tcell_set, *args, **kwargs)

def load_mhc(*args, **kwargs):

    mhc_path = join(DATA_DIR, 'cvc_hpv_ligand.csv')