# Path: modules/pepdata/static_data.py
# DATA_DIR = join(PACKAGE_DIR, 'data')
# 
# 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_ngram_dataset_from_args(loader, *args, **kwargs):
#     """
#     Parameters
#     -----------
#     max_ngram : int
#         Degree of ngrams
# 
#     normalize_row : bool
#         Return frequencies (default) or counts
# 
#     subsample_bigger_class : bool
#         Default False
# 
#     return_transformer : bool
#         Default False
# 
#     reduced_alphabet : dictionary, optional
#         Remap amino acid characters into some alternative alphabet
# 
#     training_already_reduced : bool
#         Only apply reduced alphabet to testing set
#         (training data is already transformed)
# 
#     verbose : bool
#         Default True
# 
#     loader : fn
#         Takes all the remaining arguments and returns two sets
#         of positive and negative samples
#     """
#     loader_kwargs, kwargs = _split_ngram_kwargs(kwargs)
#     pos, neg = loader(*args, **loader_kwargs)
#     return make_ngram_dataset(pos, neg, **kwargs)


from os.path import join
from .static_data import DATA_DIR
from .common import bad_amino_acids
from .features import make_ngram_dataset_from_args
import pandas as pd
    return df[mask]

def load_s1_values(*args, **kwargs):
    group_by_allele = kwargs.pop('group_by_allele', False)
    df = load_s1(*args, **kwargs)
    pos = (df.Immunogenicity == 'immunogenic')
    if group_by_allele:
        groups = pos.groupby([df.Peptide, df.MHC])
    else:
        groups = pos.groupby(df.Peptide)
    return groups.mean()

def load_s1_classes(*args, **kwargs):
    values = load_s1_values(*args, **kwargs)
    imm_mask = values > 0
    non_mask = ~imm_mask
    imm = set(values.index[imm_mask])
    non = set(values.index[non_mask])
    return imm, non

def load_s1_ngrams(*args, **kwargs):
    return make_ngram_dataset_from_args(load_s1_classes, *args, **kwargs)

def load_s2(
        human=True,
        hla_type=None,
        exclude_hla_type=None):
    """
    Non-redundant murine and human Dengue epitopes and non-epitopes
    """

# Path: modules/pepdata/static_data.py
# DATA_DIR = join(PACKAGE_DIR, 'data')
# 
# 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_ngram_dataset_from_args(loader, *args, **kwargs):
#     """
#     Parameters
#     -----------
#     max_ngram : int
#         Degree of ngrams
# 
#     normalize_row : bool
#         Return frequencies (default) or counts
# 
#     subsample_bigger_class : bool
#         Default False
# 
#     return_transformer : bool
#         Default False
# 
#     reduced_alphabet : dictionary, optional
#         Remap amino acid characters into some alternative alphabet
# 
#     training_already_reduced : bool
#         Only apply reduced alphabet to testing set
#         (training data is already transformed)
# 
#     verbose : bool
#         Default True
# 
#     loader : fn
#         Takes all the remaining arguments and returns two sets
#         of positive and negative samples
#     """
#     loader_kwargs, kwargs = _split_ngram_kwargs(kwargs)
#     pos, neg = loader(*args, **loader_kwargs)
#     return make_ngram_dataset(pos, neg, **kwargs)


# Path: modules/pepdata/calis.py
from os.path import join
from .static_data import DATA_DIR
from .common import bad_amino_acids
from .features import make_ngram_dataset_from_args
import pandas as pd

    return df[mask]

def load_s1_values(*args, **kwargs):
    group_by_allele = kwargs.pop('group_by_allele', False)
    df = load_s1(*args, **kwargs)
    pos = (df.Immunogenicity == 'immunogenic')
    if group_by_allele:
        groups = pos.groupby([df.Peptide, df.MHC])
    else:
        groups = pos.groupby(df.Peptide)
    return groups.mean()

def load_s1_classes(*args, **kwargs):
    values = load_s1_values(*args, **kwargs)
    imm_mask = values > 0
    non_mask = ~imm_mask
    imm = set(values.index[imm_mask])
    non = set(values.index[non_mask])
    return imm, non

def load_s1_ngrams(*args, **kwargs):
    return make_ngram_dataset_from_args(load_s1_classes, *args, **kwargs)

def load_s2(
        human=True,
        hla_type=None,
        exclude_hla_type=None):
    """
    Non-redundant murine and human Dengue epitopes and non-epitopes
    """

    s2_path = join(DATA_DIR, 'calis_s2.csv')