# Path: preimage/datasets/amino_acid_file.py
# class AminoAcidFile:
#     """Contain file name of amino acid property matrix from the literature.
# 
#     For more amino acid files see: http://graal.ift.ulaval.ca/bioinformatics/gs-kernel/.
# 
#     Attributes
#     ----------
#     blosum62_natural : string
#         file name of an amino acid matrix.
#     """
#     blosum62_natural = 'AA.blosum62.natural.dat'


import pickle
import gzip
import numpy
from os.path import dirname, join
from preimage.datasets.amino_acid_file import AminoAcidFile
        Training dataset.
    """
    return __load_peptide_dataset('camps.pickle')


def load_bpps_dataset():
    """Load the BPPs dataset consisting of 31 bradykinin-potentiating pentapeptides.

    Returns
    -------
    train_dataset: StandardDataset
        Training dataset.
    """
    return __load_peptide_dataset('bpps.pickle')


def __load_peptide_dataset(file_name):
    data = __load_pickle_file(file_name)
    X = numpy.array(data['X'], dtype=numpy.str)
    train_dataset = StandardDataset(X, data['y'])
    return train_dataset


def __load_pickle_file(file_name):
    module_path = dirname(__file__)
    data_file = open(join(module_path, file_name), 'rb')
    data = pickle.load(data_file)
    return data



# Path: preimage/datasets/amino_acid_file.py
# class AminoAcidFile:
#     """Contain file name of amino acid property matrix from the literature.
# 
#     For more amino acid files see: http://graal.ift.ulaval.ca/bioinformatics/gs-kernel/.
# 
#     Attributes
#     ----------
#     blosum62_natural : string
#         file name of an amino acid matrix.
#     """
#     blosum62_natural = 'AA.blosum62.natural.dat'


# Path: preimage/datasets/loader.py
import pickle
import gzip
import numpy
from os.path import dirname, join
from preimage.datasets.amino_acid_file import AminoAcidFile

        Training dataset.
    """
    return __load_peptide_dataset('camps.pickle')


def load_bpps_dataset():
    """Load the BPPs dataset consisting of 31 bradykinin-potentiating pentapeptides.

    Returns
    -------
    train_dataset: StandardDataset
        Training dataset.
    """
    return __load_peptide_dataset('bpps.pickle')


def __load_peptide_dataset(file_name):
    data = __load_pickle_file(file_name)
    X = numpy.array(data['X'], dtype=numpy.str)
    train_dataset = StandardDataset(X, data['y'])
    return train_dataset


def __load_pickle_file(file_name):
    module_path = dirname(__file__)
    data_file = open(join(module_path, file_name), 'rb')
    data = pickle.load(data_file)
    return data



def load_amino_acids_and_descriptors(file_name=AminoAcidFile.blosum62_natural):