"""
known_header_transformations = {

    #rsid
    'rs': 'rsid',
    'rsid': 'rsid',
    'rs_number': 'rsid',
    'rs_numbers': 'rsid',
    'snp_rsid': 'rsid',
    'rsID': 'rsid',
    'RSID': 'rsid',

    #variant_id
    'snp': 'variant_id',
    '#SNP': 'variant_id',
    'markername': 'variant_id',
    'marker': 'variant_id',
    'assay_name': 'variant_id',
    'id': 'variant_id',
    'id_dbsnp49': 'variant_id',
    'MARKER': 'variant_id',
    'snpid':'variant_id',
    'oldid':'variant_id',
    'phase1_1kg_id':'variant_id',
    'SNP': 'variant_id',
    'íd': 'variant_id',
    'MarkerName': 'variant_id',
    'MARKERNAME': 'variant_id',    
    #p_value
    'p': 'p_value',
    'pvalue': 'p_value',
    'p_value':  'p_value',
    'pval': 'p_value',
    'p_val': 'p_value',
    'gc_pvalue': 'p_value',
    'gwas_p': 'p_value',
    'frequentist_add_pvalue': 'p_value',
    'scan_p': 'p_value',
    'scanp': 'p_value',
    'p_wald': 'p_value', 
    'european_ancestry_pval_fix': 'p_value',
    'bcac_onco_icogs_gwas_p1df': 'p_value',
    'bcac_icogs1_risk_P1df': 'p_value',
    'mainp': 'p_value',
    'pv-clinical_c_k57': 'p_value',
    'frequentist_add_wald_pvalue_1': 'p_value',
    'P':'p_value',
    'P.value': 'p_value',
    'ALL.RANDOM.PVAL': 'p_value',
    'P_BOLT_LMM': 'p_value',
    'P_fathers_age_death': 'p_value',
    'P_parents_age_death': 'p_value',
    'P_top_1_percent': 'p_value',
    'P-value' : 'p_value',
    'P-val': 'p_value',
    #chromosome
    'chr': 'chromosome',
    'chromosome': 'chromosome',
    'chrom': 'chromosome',
    'scaffold': 'chromosome',
    'chr_build36': 'chromosome',
    '#chrom': 'chromosome',
    'CHR': 'chromosome',
    'Chromosome': 'chromosome',
    #base_pair_location
    'bp': 'base_pair_location',
    'pos': 'base_pair_location',
    'position': 'base_pair_location',
    'phys_pos': 'base_pair_location',
    'base_pair': 'base_pair_location',
    'basepair': 'base_pair_location',
    'base_pair_location': 'base_pair_location',
    'pos_build36': 'base_pair_location',  
    'position_b37': 'base_pair_location',
    'bp_hg19': 'base_pair_location',
    'BP': 'base_pair_location',
    'pos(b37)': 'base_pair_location',
    'POS_b37': 'base_pair_location',
    'POS' : 'base_pair_location',
    'Position': 'base_pair_location',
    'position_build36': 'base_pair_location', 
    'Position_b37': 'base_pair_location',
    'Position_hg19': 'base_pair_location',
    # chromosome combined with base pair location
    'chr_pos' : 'chr_bp',
    'chrpos' : 'chr_bp',
    'chrpos_b37' : 'chr_bp',
    'chr_pos_b37' : 'chr_bp',
    'chrpos_b36' : 'chr_bp',
    'chr_pos_b36' : 'chr_bp',
    'chrpos_b38' : 'chr_bp',
    'chr_pos_b38' : 'chr_bp',
    'chr_pos_(b36)' : 'chr_bp',
    'chr_pos_(b37)' : 'chr_bp',
    'chr_pos_(b38)' : 'chr_bp',
    'Chr': 'chr',
    #odds_ratio
    'or': 'odds_ratio',
    'odds_ratio': 'odds_ratio',
    'oddsratio': 'odds_ratio',
    'bcac_icogs1_or': 'odds_ratio',
    'OR': 'odds_ratio',
    # or range
    'L95': 'ci_upper',
    'U95': 'ci_lower',
    'orlower': 'ci_lower',
    'orupper': 'ci_upper',
    'l95': 'ci_lower',
    'u95': 'ci_upper',
    # beta
    'b': 'beta',
    'beta': 'beta',
    'effects': 'beta',
    'effect': 'beta',
    'gwas_beta': 'beta',
    'european_ancestry_beta_fix': 'beta',
    'stdbeta': 'beta',
    'bcac_onco_icogs_gwas_beta':'beta',  
    'bcac_icogs1_risk_beta': 'beta',
    'log_odds': 'beta',
    'maineffects': 'beta',
    'nbeta-clinical_c_k57': 'beta',
    'Effect': 'beta',
    'frequentist_add_beta_1:add/sle=1': 'beta',
    'ALL.RANDOM.BETA': 'beta',
    'BETA':'beta',
    'BETA_fathers_age_death': 'beta',
    'BETA_parents_age_death': 'beta',
    'BETA_top_1_percent': 'beta',
    'Beta': 'beta',
    'EFFECT': 'beta',
    'EFFECT_A1': 'beta',
    #standard_error
    'se': 'standard_error',
    'standard_error': 'standard_error',
    'stderr': 'standard_error',
    'european_ancestry_se_fix': 'standard_error',
    'bcac_onco_icogs_gwas_se': 'standard_error',
    'bcac_icogs1_risk_se': 'standard_error',
    'log_odds_se': 'standard_error',
    'mainse': 'standard_error',
    'standarderror': 'standard_error',
    'nse-clinical_c_k57': 'standard_error',
    'frequentist_add_se_1': 'standard_error',
    'StdErr': 'standard_error',
    'SE': 'standard_error',
    'SE_fathers_age_death': 'standard_error',
    'SE_parents_age_death': 'standard_error',
    'SE_top_1_percent': 'standard_error',
    'StdErr': 'standard_error',    
    'SEBETA': 'standard_error',
    'STDERR': 'standard_error',
    'se_error': 'standard_error',    
    #effect_allele
    'a1': 'effect_allele',
    'allele1': 'effect_allele',
    'allele_1': 'effect_allele',
    'effect_allele': 'effect_allele',
    'alt' : 'effect_allele',
    'inc_allele': 'effect_allele',
    'ea': 'effect_allele',
    'alleleb': 'effect_allele',
    'allele_b': 'effect_allele',
    'effectallele': 'effect_allele',
    'a1': 'effect_allele',
    'alleleB': 'effect_allele',
    'A1': 'effect_allele',
    'Allele1':'effect_allele',
    'alleleB': 'effect_allele',
    'ALLELE1': 'effect_allele',
    'EFF_ALLELE': 'effect_allele',
    'EffectAllele': 'effect_allele',
    'coded_allele': 'effect_allele',
    'Coded': 'effect_allele',
    'Effect-allele': 'effect_allele',
    #other_allele
    'a2': 'other_allele',
    'Allele2': 'other_allele',
    'allele_2': 'other_allele',
    'other_allele': 'other_allele',
    'ref': 'other_allele',
    'non_effect_allele': 'other_allele',
    'dec_allele': 'other_allele',
    'nea': 'other_allele',
    'allelea': 'other_allele',
    'allele_a': 'other_allele',
    'reference_allele': 'other_allele',
    'allele0': 'other_allele',
    'referenceallele': 'other_allele',
    'a0': 'other_allele',
    'noneffect_allele': 'other_allele',
    'alleleB': 'other_allele',
    'A2': 'other_allele',
    'alleleA': 'other_allele',
    'ALLELE0': 'other_allele',  
    'allele2': 'other_allele',
    'NONEFF_ALLELE': 'other_allele',
    'OtherAllele': 'other_allele',
    'non_coded_allele': 'other_allele',    
    'Non_coded': 'other_allele',
    'Other-allele': 'other_allele',
    #effect_allele_frequency
    'maf': 'effect_allele_frequency',
    'eafcontrols': 'effect_allele_frequency',
    'frq': 'effect_allele_frequency',
    'ref_allele_frequency': 'effect_allele_frequency',
    'frq_u': 'effect_allele_frequency',
    'f_u': 'effect_allele_frequency',
    'effect_allele_freq': 'effect_allele_frequency',
    'effect_allele_frequency': 'effect_allele_frequency',
    'freq1': 'effect_allele_frequency',
    'alt_freq': 'effect_allele_frequency',
    'a1_af': 'effect_allele_frequency',
    'bcac_onco_icogs_gwas_eaf_controls': 'effect_allele_frequency',
    'bcac_icogs1_european_controls_eaf': 'effect_allele_frequency',
    'eaf_ukb': 'effect_allele_frequency',
    'allelefreq': 'effect_allele_frequency', 
    'controls_maf': 'effect_allele_frequency',
    'effectAlleleFreq': 'effect_allele_frequency',
    'ALL.FREQ.VAR': 'effect_allele_frequency',
    'A1FREQ': 'effect_allele_frequency',   
    'freqA1': 'effect_allele_frequency',
    'EAF_UKB': 'effect_allele_frequency',
    'EAF' : 'effect_allele_frequency',
    'EFF_ALLELE_FREQ': 'effect_allele_frequency',
    'Freq': 'effect_allele_frequency',
    'FREQ_A1': 'effect_allele_frequency',
    'Coded_freq': 'effect_allele_frequency',
    'Effect-allele-frequency': 'effect_allele_frequency',
    'Freq1': 'effect_allele_frequency',
    # number of studies
    'nstudy': 'nstudy',
    'n_study': 'nstudy',
    'nstudies': 'nstudy',
    'n_studies': 'nstudy',
    # n
    'n': 'n',
    'ncase': 'n_cas',
    'cases_n': 'n_cas',
    'n_cases': 'n_cas',
    'n_controls': 'n_con',
    'n_cas': 'n_cas',
    'n_con': 'n_con',
    'n_case': 'n_cas',
    'cases_total': 'n_cas',
    'ncontrol': 'n_con',
    'controls_n': 'n_con',
    'n_control': 'n_con',
    'weight': 'n',
    'ncompletesamples': 'n',
    'controls_total': 'n_con',
    'N' : 'n',
    'N-analyzed': 'n',
    'TotalN': 'n',
    'Sample-size': 'n',
    'Sample-size-cases': 'n_cas',
    # signed statistics
    'zscore': 'z',
    'z-score': 'z',
    'gc_zscore': 'z',
    'z': 'z',
    'log_odds': 'log_odds',
    'signed_sumstat': 'signed_sumstat',
    # info
    'info': 'info',   
}
"""

header_mapper = {

    #RSID
    # ==========
    'rsid': [
        'rs',
        'rsid',
        'rs_number',
        'rs_numbers',
        'id',
        'id_dbsnp49',
        'snp_rsid',
        'rsID',
        'RSID',
        'rs_id'
        ],

    # Variant ID
    # ==========
    'variant_id': [
        'snp',
        '#SNP',
        'markername',
        'marker',
        'assay_name',
        'MARKER',
        'snpid',
        'oldid',
        'phase1_1kg_id',
        'SNP',
        'íd',
        'MarkerName',
        'MARKERNAME',
        ],

    # P-value
    # =======
    'p_value': [
        'p',
        'pvalue',
        'p_value',
        'pval',
        'p_val',
        'gc_pvalue',
        'gwas_p',
        'frequentist_add_pvalue',
        'scan_p',
        'scanp',
        'p_wald', 
        'european_ancestry_pval_fix',
        'bcac_onco_icogs_gwas_p1df',
        'bcac_icogs1_risk_P1df',
        'mainp',
        'pv-clinical_c_k57',
        'frequentist_add_wald_pvalue_1',
        'P',
        'P.value',
        'ALL.RANDOM.PVAL',
        'P_BOLT_LMM',
        'P_fathers_age_death',
        'P_parents_age_death',
        'P_top_1_percent',
        'P-value',
        'P-val'
        ],

    # Chromosome
    # ==========
    'chromosome': [
        'chr',
        'chromosome',
        'chrom',
        'scaffold',
        'chr_build36',
        '#chrom',
        'CHR',
        'Chromosome'
        ],

    # Base pair location
    # ==================
    'base_pair_location': [
        'bp',
        'pos',
        'position',
        'phys_pos',
        'base_pair',
        'basepair',
        'base_pair_location',
        'pos_build36',  
        'position_b37',
        'bp_hg19',
        'BP',
        'pos(b37)',
        'POS_b37',
        'POS' ,
        'Position',
        'position_build36', 
        'Position_b37',
        'Position_hg19',
        'Pos_GRCh37',
        'GENPOS'
        ],
    # Chromosome and base pair location
    # ================================
    'chromosome_bp': [
    'chr_bp',
    'chr_pos',
    'chrpos',
    'chrpos_b37',
    'chr_pos_b37',
    'chrpos_b36',
    'chr_pos_b36',
    'chrpos_b38',
    'chr_pos_b38',
    'chr_pos_(b36)',
    'chr_pos_(b37)',
    'chr_pos_(b38)',
    ],

    # Odds ratio
    # ==========
    'odds_ratio': [
        'or',
        'odds_ratio',
        'oddsratio',
        'bcac_icogs1_or',
        'OR'
        ],

    # Upper confidence interval
    # =========================
    'ci_upper': [
        'U95',
        'orupper',
        'u95'
        ],

    # Lower confidence interval
    # =========================
    'ci_lower': [
        'L95',
        'orlower',
        'l95'
        ],

    # Beta
    # ====
    'beta': [
        'b',
        'beta',
        'effects',
        'effect',
        'gwas_beta',
        'european_ancestry_beta_fix',
        'stdbeta',
        'bcac_onco_icogs_gwas_beta',  
        'bcac_icogs1_risk_beta',
        'log_odds',
        'maineffects',
        'nbeta-clinical_c_k57',
        'Effect',
        'frequentist_add_beta_1:add/sle=1',
        'ALL.RANDOM.BETA',
        'BETA',
        'BETA_fathers_age_death',
        'BETA_parents_age_death',
        'BETA_top_1_percent',
        'Beta',
        'EFFECT',
        'EFFECT_A1'
        ],

    # Standard error
    # ==============
    'standard_error': [
        'se',
        'standard_error',
        'stderr',
        'european_ancestry_se_fix',
        'bcac_onco_icogs_gwas_se',
        'bcac_icogs1_risk_se',
        'log_odds_se',
        'mainse',
        'standarderror',
        'nse-clinical_c_k57',
        'frequentist_add_se_1',
        'StdErr',
        'SE',
        'SE_fathers_age_death',
        'SE_parents_age_death',
        'SE_top_1_percent',
        'StdErr',    
        'SEBETA',
        'STDERR',
        'se_error'
        ],

    # Effect allele
    # =============
    'effect_allele': [
        'a1',
        'allele1',
        'allele_1',
        'effect_allele',
        'alt' ,
        'inc_allele',
        'ea',
        'alleleb',
        'allele_b',
        'effectallele',
        'a1',
        'alleleB',
        'A1',
        'Allele1',
        'alleleB',
        'ALLELE1',
        'EFF_ALLELE',
        'EffectAllele',
        'coded_allele',
        'Coded',
        'Effect-allele'
        ],
    
    # Other allele
    # ============
    'other_allele': [
        'a2',
        'Allele2',
        'allele_2',
        'other_allele',
        'ref',
        'non_effect_allele',
        'dec_allele',
        'nea',
        'allelea',
        'allele_a',
        'reference_allele',
        'allele0',
        'referenceallele',
        'a0',
        'noneffect_allele',
        'alleleB',
        'A2',
        'alleleA',
        'ALLELE0',  
        'allele2',
        'NONEFF_ALLELE',
        'OtherAllele',
        'non_coded_allele',    
        'Non_coded',
        'Other-allele'
        ],

    # Effect allele frequency
    # =======================
    'effect_allele_frequency': [
        'maf',
        'eafcontrols',
        'frq',
        'ref_allele_frequency',
        'frq_u',
        'f_u',
        'effect_allele_freq',
        'effect_allele_frequency',
        'freq1',
        'freq',
        'alt_freq',
        'a1_af',
        'bcac_onco_icogs_gwas_eaf_controls',
        'bcac_icogs1_european_controls_eaf',
        'eaf_ukb',
        'allelefreq', 
        'controls_maf',
        'effectAlleleFreq',
        'ALL.FREQ.VAR',
        'A1FREQ',   
        'freqA1',
        'EAF_UKB',
        'EAF' ,
        'EFF_ALLELE_FREQ',
        'Freq',
        'FREQ_A1',
        'Coded_freq',
        'Effect-allele-frequency',
        'Freq1',
        'A1FREQ'
        ],
    
    # Number of studies
    # =================
    'nstudy': [
        'nstudy',
        'n_study',
        'nstudies',
        'n_studies'
        ],

    # n
    # =
    'n': [
        'n',
        'N' ,
        'N-analyzed',
        'TotalN',
        'Sample-size',
        'weight',
        'ncompletesamples'
        ],

    # n cases
    # =======
    'n_cas': [
        'ncase',
        'cases_n',
        'n_cases',
        'n_cas',
        'n_case',
        'cases_total',
        'Sample-size-cases'
        ],

    # n cases
    # =======
    'n_con': [
        'ncontrol',
        'controls_n',
        'n_control',
        'n_con',
        'n_controls',
        'controls_total'
        ],

    # signed statistics
    # =================
    'z': [
        'zscore',
        'z-score',
        'gc_zscore',
        'z'
        ],
    }
