# Copyright 2020 Google LLC
#
# 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
#
#     https://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.
"""This script will generate data mcf from Protein Tissue Atlas
and two enum files: HumanTissueEnum.mcf, HumanCellTypeEnum.mcf
"""
import re
import pandas as pd

from absl import app
from absl import flags

FLAGS = flags.FLAGS

flags.DEFINE_string('database', 'normal_tissue.tsv',
                    'input tissue atlas file path.')

flags.DEFINE_string('gene_to_uniprot_list',
                    'gene_to_uniprot_list.txt',
                    'gene_to_uniprot_list file path.',
                    short_name='g')

flags.DEFINE_string('uniprot_to_dcid',
                    'uniprot_to_dcid.tsv',
                    'uniprot_to_dcid.tsv file path.',
                    short_name='u')

flags.DEFINE_string('data_mcf',
                    'ProteinAtlasData.mcf',
                    'The output data mcf file path.',
                    short_name='m')

flags.DEFINE_string('tissue_mcf', 'HumanTissueEnum.mcf',
                    'The output HumanTissueEnum.mcf file path.')

flags.DEFINE_string('cell_mcf', 'HumanCellTypeEnum.mcf',
                    'The output HumanCellTypeEnum.mcf file path.')
EXPRESSION_MAP = {
    'Not detected': 'ProteinExpressionNotDetected',