# 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/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 .features import make_ngram_dataset_from_args
from .reduced_alphabet import make_alphabet_transformer
from .static_data import DATA_DIR
# Copyright (c) 2014. Mount Sinai School of Medicine
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import print_function, division, absolute_import


def load_imm_list(reduced_alphabet=None):
    path = join(DATA_DIR, 'IMMA2_imm.txt')
    if reduced_alphabet:
        transformer = make_alphabet_transformer(reduced_alphabet)
    else:
        def transformer(x):
            return x

    with open(path) as f:
        imm = [transformer(line.strip()) for line in f]
    return imm

def load_non_list(reduced_alphabet=None):

# 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/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/imma2.py
from os.path import join
from .features import make_ngram_dataset_from_args
from .reduced_alphabet import make_alphabet_transformer
from .static_data import DATA_DIR

# Copyright (c) 2014. Mount Sinai School of Medicine
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import print_function, division, absolute_import


def load_imm_list(reduced_alphabet=None):
    path = join(DATA_DIR, 'IMMA2_imm.txt')
    if reduced_alphabet:
        transformer = make_alphabet_transformer(reduced_alphabet)
    else:
        def transformer(x):
            return x

    with open(path) as f:
        imm = [transformer(line.strip()) for line in f]
    return imm

def load_non_list(reduced_alphabet=None):

    path = join(DATA_DIR, 'IMMA2_non.txt')