# -*- coding: utf-8 -*-
#==============================================================================
# Copyright (C) 2017 Bryce L. Kille
# University of Illinois
# Department of Chemistry
#
# Copyright (C) 2017 Christopher J. Schwalen
# University of Illinois
# Department of Chemistry
#
# Copyright (C) 2017 Douglas A. Mitchell
# University of Illinois
# Department of Chemistry
#
# License: GNU Affero General Public License v3 or later
# Complete license availabel in the accompanying LICENSE.txt.
# or <http://www.gnu.org/licenses/>.
#
# This file is part of RODEO2.
#
# RODEO2 is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# RODEO2 is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
#==============================================================================
# Special thanks goes to AntiSmash team, whose antiSMASH-rodeo repository at
# https://bitbucket.org/mmedema/antismash-rodeo/ provided the backbone code for 
# a great deal of the heuristic calculations.
#==============================================================================


import csv
import os
import re
from Bio.SeqUtils.ProtParam import ProteinAnalysis
import numpy as np
from ripp_modules.VirtualRipp import VirtualRipp
import hmmer_utils
import pathlib
FILE_DIR = pathlib.Path(__file__).parent.absolute()

peptide_type = "lanthi3"
CUTOFF = 20
index = 0

def write_csv_headers(output_dir):
    dir_prefix = output_dir + '/{}/'.format(peptide_type)
    if not os.path.exists(dir_prefix):
        os.makedirs(dir_prefix)
    svm_headers = 'PK,Classification, 1/5_frac_c, 1/5_frac_s_t, 1/5_frac_s_t_c, 2/5_frac_c, 2/5_frac_s_t_c, 3/5_frac_c, 3/5_frac_s_t, 3/5_frac_s_t_c, 4/5_frac_c, 4/5_frac_s_t, 4/5_frac_s_t_c, 5/5_frac_c, 5/5_frac_s_t, 5/5_frac_s_t_c, S+T, S+T+C, aliphatic, aromatic, charged, core_A, core_AA, core_AC, core_AD, core_AE, core_AF, core_AG, core_AH, core_AI, core_AK, core_AL, core_AM, core_AP, core_AQ, core_AR, core_AS, core_AT, core_AV, core_AW, core_AY, core_AxA, core_AxC, core_AxD, core_AxE, core_AxF, core_AxG, core_AxH, core_AxK, core_AxL, core_AxM, core_AxN, core_AxP, core_AxQ, core_AxR, core_AxT, core_AxV, core_AxY, core_AxxA, core_AxxC, core_AxxD, core_AxxE, core_AxxG, core_AxxH, core_AxxK, core_AxxL, core_AxxM, core_AxxP, core_AxxQ, core_AxxR, core_AxxS, core_AxxT, core_AxxW, core_AxxxA, core_AxxxC, core_AxxxD, core_AxxxE, core_AxxxG, core_AxxxH, core_AxxxI, core_AxxxK, core_AxxxL, core_AxxxM, core_AxxxP, core_AxxxQ, core_AxxxR, core_AxxxS, core_AxxxT, core_AxxxV, core_AxxxW, core_AxxxY, core_AxxxxA, core_AxxxxC, core_AxxxxD, core_AxxxxE, core_AxxxxF, core_AxxxxG, core_AxxxxH, core_AxxxxI, core_AxxxxK, core_AxxxxL, core_AxxxxM, core_AxxxxN, core_AxxxxP, core_AxxxxQ, core_AxxxxR, core_AxxxxS, core_AxxxxT, core_AxxxxV, core_AxxxxW, core_AxxxxY, core_AxxxxxA, core_AxxxxxC, core_AxxxxxD, core_AxxxxxE, core_AxxxxxF, core_AxxxxxG, core_AxxxxxI, core_AxxxxxK, core_AxxxxxL, core_AxxxxxM, core_AxxxxxP, core_AxxxxxQ, core_AxxxxxR, core_AxxxxxS, core_AxxxxxT, core_AxxxxxV, core_AxxxxxW, core_AxxxxxY, core_C, core_CA, core_CC, core_CD, core_CE, core_CF, core_CG, core_CH, core_CK, core_CL, core_CM, core_CN, core_CP, core_CQ, core_CR, core_CS, core_CW, core_CxA, core_CxC, core_CxD, core_CxE, core_CxF, core_CxG, core_CxH, core_CxI, core_CxK, core_CxL, core_CxM, core_CxN, core_CxP, core_CxQ, core_CxR, core_CxS, core_CxT, core_CxV, core_CxW, core_CxY, core_CxxC, core_CxxD, core_CxxE, core_CxxF, core_CxxG, core_CxxL, core_CxxM, core_CxxP, core_CxxR, core_CxxS, core_CxxT, core_CxxV, core_CxxW, core_CxxxC, core_CxxxD, core_CxxxE, core_CxxxF, core_CxxxG, core_CxxxH, core_CxxxI, core_CxxxL, core_CxxxM, core_CxxxP, core_CxxxR, core_CxxxS, core_CxxxV, core_CxxxW, core_CxxxY, core_CxxxxA, core_CxxxxC, core_CxxxxD, core_CxxxxF, core_CxxxxG, core_CxxxxI, core_CxxxxK, core_CxxxxL, core_CxxxxM, core_CxxxxN, core_CxxxxP, core_CxxxxR, core_CxxxxS, core_CxxxxxA, core_CxxxxxC, core_CxxxxxD, core_CxxxxxF, core_CxxxxxG, core_CxxxxxI, core_CxxxxxK, core_CxxxxxL, core_CxxxxxM, core_CxxxxxP, core_CxxxxxR, core_CxxxxxS, core_CxxxxxT, core_CxxxxxV, core_CxxxxxW, core_CxxxxxY, core_D, core_DA, core_DD, core_DE, core_DF, core_DG, core_DH, core_DI, core_DL, core_DM, core_DP, core_DQ, core_DR, core_DS, core_DT, core_DV, core_DW, core_DY, core_DxA, core_DxC, core_DxD, core_DxE, core_DxF, core_DxG, core_DxK, core_DxL, core_DxP, core_DxR, core_DxS, core_DxT, core_DxV, core_DxW, core_DxY, core_DxxA, core_DxxC, core_DxxD, core_DxxE, core_DxxF, core_DxxG, core_DxxH, core_DxxI, core_DxxL, core_DxxP, core_DxxQ, core_DxxR, core_DxxT, core_DxxV, core_DxxxA, core_DxxxC, core_DxxxD, core_DxxxE, core_DxxxF, core_DxxxG, core_DxxxH, core_DxxxI, core_DxxxK, core_DxxxL, core_DxxxN, core_DxxxP, core_DxxxQ, core_DxxxR, core_DxxxS, core_DxxxV, core_DxxxW, core_DxxxY, core_DxxxxA, core_DxxxxC, core_DxxxxD, core_DxxxxE, core_DxxxxG, core_DxxxxI, core_DxxxxK, core_DxxxxP, core_DxxxxR, core_DxxxxS, core_DxxxxT, core_DxxxxV, core_DxxxxW, core_DxxxxxA, core_DxxxxxD, core_DxxxxxE, core_DxxxxxF, core_DxxxxxG, core_DxxxxxH, core_DxxxxxK, core_DxxxxxN, core_DxxxxxP, core_DxxxxxQ, core_DxxxxxR, core_DxxxxxT, core_DxxxxxV, core_DxxxxxY, core_E, core_EA, core_EC, core_EE, core_EG, core_EH, core_EI, core_EK, core_EL, core_EN, core_EP, core_EQ, core_ER, core_ES, core_EV, core_EW, core_EY, core_ExA, core_ExC, core_ExD, core_ExF, core_ExG, core_ExH, core_ExI, core_ExK, core_ExL, core_ExM, core_ExN, core_ExP, core_ExR, core_ExS, core_ExT, core_ExV, core_ExW, core_ExxA, core_ExxC, core_ExxD, core_ExxE, core_ExxF, core_ExxG, core_ExxH, core_ExxI, core_ExxL, core_ExxM, core_ExxP, core_ExxQ, core_ExxR, core_ExxS, core_ExxT, core_ExxV, core_ExxxA, core_ExxxC, core_ExxxD, core_ExxxE, core_ExxxF, core_ExxxG, core_ExxxH, core_ExxxI, core_ExxxK, core_ExxxL, core_ExxxM, core_ExxxN, core_ExxxP, core_ExxxQ, core_ExxxR, core_ExxxS, core_ExxxT, core_ExxxV, core_ExxxW, core_ExxxY, core_ExxxxA, core_ExxxxC, core_ExxxxD, core_ExxxxE, core_ExxxxF, core_ExxxxG, core_ExxxxH, core_ExxxxI, core_ExxxxK, core_ExxxxL, core_ExxxxM, core_ExxxxN, core_ExxxxP, core_ExxxxQ, core_ExxxxR, core_ExxxxS, core_ExxxxT, core_ExxxxV, core_ExxxxxA, core_ExxxxxC, core_ExxxxxD, core_ExxxxxE, core_ExxxxxF, core_ExxxxxG, core_ExxxxxH, core_ExxxxxI, core_ExxxxxK, core_ExxxxxP, core_ExxxxxQ, core_ExxxxxR, core_ExxxxxS, core_ExxxxxT, core_ExxxxxV, core_ExxxxxY, core_FA, core_FC, core_FD, core_FE, core_FF, core_FG, core_FH, core_FK, core_FL, core_FM, core_FP, core_FQ, core_FR, core_FS, core_FT, core_FV, core_FW, core_FY, core_FxA, core_FxC, core_FxD, core_FxF, core_FxG, core_FxH, core_FxI, core_FxK, core_FxN, core_FxP, core_FxQ, core_FxR, core_FxS, core_FxT, core_FxV, core_FxW, core_FxY, core_FxxA, core_FxxC, core_FxxD, core_FxxE, core_FxxF, core_FxxG, core_FxxI, core_FxxN, core_FxxP, core_FxxQ, core_FxxR, core_FxxS, core_FxxT, core_FxxV, core_FxxW, core_FxxxA, core_FxxxC, core_FxxxE, core_FxxxF, core_FxxxG, core_FxxxH, core_FxxxI, core_FxxxK, core_FxxxL, core_FxxxM, core_FxxxN, core_FxxxP, core_FxxxQ, core_FxxxR, core_FxxxS, core_FxxxT, core_FxxxV, core_FxxxY, core_FxxxxA, core_FxxxxC, core_FxxxxD, core_FxxxxE, core_FxxxxF, core_FxxxxG, core_FxxxxH, core_FxxxxI, core_FxxxxK, core_FxxxxL, core_FxxxxM, core_FxxxxN, core_FxxxxP, core_FxxxxQ, core_FxxxxR, core_FxxxxS, core_FxxxxT, core_FxxxxV, core_FxxxxxA, core_FxxxxxC, core_FxxxxxE, core_FxxxxxF, core_FxxxxxG, core_FxxxxxH, core_FxxxxxI, core_FxxxxxK, core_FxxxxxL, core_FxxxxxN, core_FxxxxxP, core_FxxxxxR, core_FxxxxxS, core_FxxxxxT, core_FxxxxxW, core_FxxxxxY, core_G, core_GA, core_GC, core_GD, core_GE, core_GF, core_GG, core_GH, core_GI, core_GK, core_GL, core_GM, core_GN, core_GP, core_GQ, core_GR, core_GS, core_GT, core_GV, core_GW, core_GY, core_GxA, core_GxC, core_GxD, core_GxE, core_GxF, core_GxI, core_GxK, core_GxL, core_GxM, core_GxN, core_GxP, core_GxQ, core_GxR, core_GxS, core_GxT, core_GxV, core_GxW, core_GxY, core_GxxA, core_GxxC, core_GxxD, core_GxxE, core_GxxF, core_GxxG, core_GxxH, core_GxxL, core_GxxM, core_GxxN, core_GxxP, core_GxxQ, core_GxxR, core_GxxS, core_GxxV, core_GxxW, core_GxxxA, core_GxxxC, core_GxxxD, core_GxxxE, core_GxxxF, core_GxxxG, core_GxxxH, core_GxxxI, core_GxxxK, core_GxxxL, core_GxxxM, core_GxxxN, core_GxxxP, core_GxxxQ, core_GxxxR, core_GxxxS, core_GxxxV, core_GxxxW, core_GxxxxA, core_GxxxxC, core_GxxxxD, core_GxxxxE, core_GxxxxF, core_GxxxxG, core_GxxxxH, core_GxxxxL, core_GxxxxM, core_GxxxxP, core_GxxxxQ, core_GxxxxR, core_GxxxxS, core_GxxxxV, core_GxxxxW, core_GxxxxY, core_GxxxxxA, core_GxxxxxC, core_GxxxxxD, core_GxxxxxE, core_GxxxxxF, core_GxxxxxG, core_GxxxxxH, core_GxxxxxK, core_GxxxxxL, core_GxxxxxM, core_GxxxxxN, core_GxxxxxP, core_GxxxxxQ, core_GxxxxxR, core_GxxxxxS, core_GxxxxxW, core_H, core_HA, core_HC, core_HD, core_HE, core_HF, core_HH, core_HI, core_HL, core_HM, core_HN, core_HP, core_HQ, core_HR, core_HS, core_HT, core_HV, core_HxA, core_HxC, core_HxD, core_HxE, core_HxF, core_HxH, core_HxL, core_HxP, core_HxQ, core_HxR, core_HxV, core_HxW, core_HxY, core_HxxA, core_HxxC, core_HxxD, core_HxxE, core_HxxI, core_HxxP, core_HxxQ, core_HxxR, core_HxxS, core_HxxT, core_HxxV, core_HxxxA, core_HxxxC, core_HxxxD, core_HxxxE, core_HxxxI, core_HxxxK, core_HxxxL, core_HxxxM, core_HxxxP, core_HxxxQ, core_HxxxR, core_HxxxT, core_HxxxV, core_HxxxxA, core_HxxxxD, core_HxxxxE, core_HxxxxG, core_HxxxxH, core_HxxxxK, core_HxxxxN, core_HxxxxP, core_HxxxxR, core_HxxxxT, core_HxxxxV, core_HxxxxW, core_HxxxxY, core_HxxxxxA, core_HxxxxxE, core_HxxxxxF, core_HxxxxxG, core_HxxxxxH, core_HxxxxxI, core_HxxxxxK, core_HxxxxxL, core_HxxxxxM, core_HxxxxxP, core_HxxxxxQ, core_HxxxxxR, core_HxxxxxS, core_HxxxxxV, core_HxxxxxY, core_I, core_IA, core_ID, core_IE, core_IF, core_IG, core_IH, core_II, core_IK, core_IL, core_IM, core_IP, core_IR, core_IS, core_IT, core_IY, core_IxD, core_IxF, core_IxG, core_IxH, core_IxI, core_IxK, core_IxL, core_IxP, core_IxQ, core_IxR, core_IxS, core_IxT, core_IxxC, core_IxxE, core_IxxM, core_IxxP, core_IxxQ, core_IxxR, core_IxxS, core_IxxT, core_IxxxA, core_IxxxC, core_IxxxD, core_IxxxE, core_IxxxF, core_IxxxG, core_IxxxI, core_IxxxK, core_IxxxM, core_IxxxN, core_IxxxP, core_IxxxQ, core_IxxxR, core_IxxxS, core_IxxxW, core_IxxxxA, core_IxxxxC, core_IxxxxE, core_IxxxxI, core_IxxxxK, core_IxxxxP, core_IxxxxQ, core_IxxxxR, core_IxxxxT, core_IxxxxW, core_IxxxxY, core_IxxxxxA, core_IxxxxxC, core_IxxxxxG, core_IxxxxxI, core_IxxxxxK, core_IxxxxxM, core_IxxxxxP, core_IxxxxxQ, core_IxxxxxR, core_IxxxxxT, core_IxxxxxV, core_IxxxxxW, core_K, core_KA, core_KC, core_KD, core_KE, core_KF, core_KK, core_KL, core_KM, core_KP, core_KQ, core_KR, core_KS, core_KT, core_KV, core_KxA, core_KxC, core_KxD, core_KxF, core_KxG, core_KxH, core_KxL, core_KxM, core_KxN, core_KxP, core_KxR, core_KxS, core_KxT, core_KxW, core_KxY, core_KxxA, core_KxxC, core_KxxD, core_KxxE, core_KxxF, core_KxxG, core_KxxI, core_KxxP, core_KxxR, core_KxxS, core_KxxW, core_KxxxA, core_KxxxF, core_KxxxG, core_KxxxH, core_KxxxK, core_KxxxM, core_KxxxP, core_KxxxQ, core_KxxxR, core_KxxxS, core_KxxxW, core_KxxxxC, core_KxxxxD, core_KxxxxE, core_KxxxxF, core_KxxxxG, core_KxxxxP, core_KxxxxR, core_KxxxxS, core_KxxxxT, core_KxxxxW, core_KxxxxxA, core_KxxxxxC, core_KxxxxxI, core_KxxxxxK, core_KxxxxxP, core_KxxxxxR, core_KxxxxxY, core_L, core_LA, core_LC, core_LD, core_LE, core_LF, core_LH, core_LK, core_LL, core_LM, core_LN, core_LP, core_LQ, core_LR, core_LS, core_LY, core_LxA, core_LxC, core_LxD, core_LxE, core_LxG, core_LxI, core_LxK, core_LxL, core_LxM, core_LxN, core_LxP, core_LxQ, core_LxR, core_LxT, core_LxV, core_LxW, core_LxY, core_LxxA, core_LxxC, core_LxxD, core_LxxE, core_LxxG, core_LxxK, core_LxxL, core_LxxM, core_LxxQ, core_LxxR, core_LxxT, core_LxxV, core_LxxY, core_LxxxA, core_LxxxD, core_LxxxE, core_LxxxF, core_LxxxG, core_LxxxH, core_LxxxL, core_LxxxM, core_LxxxN, core_LxxxP, core_LxxxR, core_LxxxS, core_LxxxT, core_LxxxY, core_LxxxxA, core_LxxxxC, core_LxxxxD, core_LxxxxE, core_LxxxxF, core_LxxxxG, core_LxxxxL, core_LxxxxM, core_LxxxxN, core_LxxxxP, core_LxxxxQ, core_LxxxxR, core_LxxxxS, core_LxxxxV, core_LxxxxW, core_LxxxxY, core_LxxxxxA, core_LxxxxxC, core_LxxxxxE, core_LxxxxxF, core_LxxxxxH, core_LxxxxxI, core_LxxxxxL, core_LxxxxxM, core_LxxxxxN, core_LxxxxxP, core_LxxxxxQ, core_LxxxxxR, core_LxxxxxS, core_LxxxxxT, core_LxxxxxW, core_LxxxxxY, core_M, core_MA, core_MC, core_MD, core_ME, core_MF, core_MG, core_MH, core_MI, core_MK, core_ML, core_MM, core_MN, core_MP, core_MR, core_MS, core_MT, core_MV, core_MW, core_MxA, core_MxC, core_MxE, core_MxG, core_MxI, core_MxK, core_MxL, core_MxP, core_MxQ, core_MxR, core_MxS, core_MxT, core_MxV, core_MxxA, core_MxxD, core_MxxE, core_MxxF, core_MxxG, core_MxxH, core_MxxK, core_MxxL, core_MxxM, core_MxxP, core_MxxR, core_MxxS, core_MxxT, core_MxxV, core_MxxW, core_MxxxA, core_MxxxE, core_MxxxF, core_MxxxG, core_MxxxI, core_MxxxK, core_MxxxL, core_MxxxM, core_MxxxP, core_MxxxQ, core_MxxxR, core_MxxxS, core_MxxxT, core_MxxxV, core_MxxxW, core_MxxxxA, core_MxxxxC, core_MxxxxE, core_MxxxxF, core_MxxxxG, core_MxxxxH, core_MxxxxI, core_MxxxxL, core_MxxxxP, core_MxxxxR, core_MxxxxS, core_MxxxxT, core_MxxxxV, core_MxxxxW, core_MxxxxxA, core_MxxxxxC, core_MxxxxxD, core_MxxxxxE, core_MxxxxxG, core_MxxxxxI, core_MxxxxxK, core_MxxxxxL, core_MxxxxxP, core_MxxxxxR, core_MxxxxxS, core_MxxxxxT, core_MxxxxxV, core_MxxxxxW, core_N, core_NC, core_NE, core_NF, core_NH, core_NK, core_NL, core_NN, core_NP, core_NR, core_NS, core_NW, core_NxA, core_NxC, core_NxE, core_NxG, core_NxH, core_NxI, core_NxL, core_NxM, core_NxP, core_NxR, core_NxS, core_NxT, core_NxV, core_NxxA, core_NxxD, core_NxxG, core_NxxL, core_NxxN, core_NxxP, core_NxxR, core_NxxS, core_NxxV, core_NxxW, core_NxxxC, core_NxxxD, core_NxxxF, core_NxxxG, core_NxxxH, core_NxxxK, core_NxxxL, core_NxxxN, core_NxxxP, core_NxxxR, core_NxxxS, core_NxxxY, core_NxxxxL, core_NxxxxP, core_NxxxxR, core_NxxxxS, core_NxxxxT, core_NxxxxW, core_NxxxxxA, core_NxxxxxC, core_NxxxxxD, core_NxxxxxG, core_NxxxxxK, core_NxxxxxL, core_NxxxxxR, core_NxxxxxS, core_NxxxxxV, core_NxxxxxW, core_NxxxxxY, core_P, core_PA, core_PC, core_PD, core_PE, core_PF, core_PG, core_PH, core_PI, core_PK, core_PL, core_PM, core_PN, core_PP, core_PQ, core_PR, core_PS, core_PT, core_PV, core_PW, core_PY, core_PxA, core_PxC, core_PxD, core_PxE, core_PxF, core_PxG, core_PxH, core_PxI, core_PxK, core_PxL, core_PxM, core_PxP, core_PxQ, core_PxR, core_PxS, core_PxT, core_PxV, core_PxW, core_PxY, core_PxxA, core_PxxC, core_PxxD, core_PxxE, core_PxxF, core_PxxG, core_PxxH, core_PxxI, core_PxxK, core_PxxL, core_PxxM, core_PxxP, core_PxxQ, core_PxxR, core_PxxS, core_PxxT, core_PxxV, core_PxxW, core_PxxY, core_PxxxA, core_PxxxC, core_PxxxD, core_PxxxE, core_PxxxF, core_PxxxG, core_PxxxH, core_PxxxI, core_PxxxK, core_PxxxL, core_PxxxM, core_PxxxN, core_PxxxP, core_PxxxQ, core_PxxxR, core_PxxxS, core_PxxxT, core_PxxxV, core_PxxxW, core_PxxxY, core_PxxxxA, core_PxxxxC, core_PxxxxD, core_PxxxxE, core_PxxxxF, core_PxxxxG, core_PxxxxH, core_PxxxxI, core_PxxxxK, core_PxxxxL, core_PxxxxM, core_PxxxxN, core_PxxxxP, core_PxxxxQ, core_PxxxxR, core_PxxxxS, core_PxxxxT, core_PxxxxV, core_PxxxxW, core_PxxxxxA, core_PxxxxxC, core_PxxxxxD, core_PxxxxxE, core_PxxxxxF, core_PxxxxxG, core_PxxxxxH, core_PxxxxxI, core_PxxxxxK, core_PxxxxxL, core_PxxxxxM, core_PxxxxxN, core_PxxxxxP, core_PxxxxxQ, core_PxxxxxR, core_PxxxxxS, core_PxxxxxT, core_PxxxxxV, core_PxxxxxW, core_PxxxxxY, core_Q, core_QD, core_QE, core_QF, core_QG, core_QK, core_QL, core_QP, core_QR, core_QT, core_QV, core_QW, core_QY, core_QxA, core_QxD, core_QxE, core_QxF, core_QxG, core_QxH, core_QxI, core_QxL, core_QxP, core_QxR, core_QxS, core_QxT, core_QxV, core_QxxA, core_QxxC, core_QxxD, core_QxxE, core_QxxF, core_QxxG, core_QxxI, core_QxxL, core_QxxP, core_QxxQ, core_QxxR, core_QxxT, core_QxxV, core_QxxW, core_QxxxA, core_QxxxE, core_QxxxF, core_QxxxG, core_QxxxH, core_QxxxK, core_QxxxL, core_QxxxP, core_QxxxQ, core_QxxxR, core_QxxxT, core_QxxxV, core_QxxxW, core_QxxxY, core_QxxxxA, core_QxxxxC, core_QxxxxD, core_QxxxxE, core_QxxxxF, core_QxxxxG, core_QxxxxH, core_QxxxxK, core_QxxxxM, core_QxxxxP, core_QxxxxQ, core_QxxxxR, core_QxxxxT, core_QxxxxV, core_QxxxxY, core_QxxxxxA, core_QxxxxxC, core_QxxxxxD, core_QxxxxxE, core_QxxxxxF, core_QxxxxxG, core_QxxxxxH, core_QxxxxxK, core_QxxxxxL, core_QxxxxxN, core_QxxxxxP, core_QxxxxxR, core_QxxxxxT, core_QxxxxxV, core_R, core_RA, core_RC, core_RD, core_RE, core_RF, core_RG, core_RH, core_RI, core_RK, core_RL, core_RM, core_RN, core_RP, core_RQ, core_RR, core_RS, core_RT, core_RV, core_RW, core_RY, core_RxA, core_RxC, core_RxD, core_RxE, core_RxF, core_RxG, core_RxH, core_RxI, core_RxK, core_RxL, core_RxM, core_RxN, core_RxP, core_RxQ, core_RxR, core_RxS, core_RxT, core_RxV, core_RxW, core_RxY, core_RxxA, core_RxxC, core_RxxD, core_RxxE, core_RxxF, core_RxxG, core_RxxH, core_RxxI, core_RxxK, core_RxxL, core_RxxM, core_RxxN, core_RxxP, core_RxxQ, core_RxxR, core_RxxS, core_RxxT, core_RxxV, core_RxxW, core_RxxY, core_RxxxA, core_RxxxC, core_RxxxD, core_RxxxE, core_RxxxF, core_RxxxG, core_RxxxH, core_RxxxI, core_RxxxK, core_RxxxL, core_RxxxM, core_RxxxN, core_RxxxP, core_RxxxQ, core_RxxxR, core_RxxxS, core_RxxxT, core_RxxxV, core_RxxxY, core_RxxxxA, core_RxxxxC, core_RxxxxD, core_RxxxxE, core_RxxxxF, core_RxxxxG, core_RxxxxH, core_RxxxxI, core_RxxxxK, core_RxxxxL, core_RxxxxM, core_RxxxxN, core_RxxxxP, core_RxxxxQ, core_RxxxxR, core_RxxxxS, core_RxxxxT, core_RxxxxV, core_RxxxxW, core_RxxxxY, core_RxxxxxA, core_RxxxxxC, core_RxxxxxD, core_RxxxxxE, core_RxxxxxF, core_RxxxxxG, core_RxxxxxH, core_RxxxxxI, core_RxxxxxK, core_RxxxxxL, core_RxxxxxM, core_RxxxxxN, core_RxxxxxP, core_RxxxxxQ, core_RxxxxxR, core_RxxxxxS, core_RxxxxxT, core_RxxxxxV, core_RxxxxxW, core_RxxxxxY, core_S, core_SD, core_SE, core_SG, core_SI, core_SL, core_SM, core_SN, core_SP, core_SQ, core_SR, core_SS, core_ST, core_SV, core_SW, core_SxA, core_SxC, core_SxD, core_SxE, core_SxF, core_SxG, core_SxH, core_SxI, core_SxL, core_SxM, core_SxN, core_SxP, core_SxR, core_SxS, core_SxT, core_SxV, core_SxxA, core_SxxC, core_SxxD, core_SxxE, core_SxxF, core_SxxG, core_SxxH, core_SxxI, core_SxxK, core_SxxL, core_SxxM, core_SxxN, core_SxxP, core_SxxQ, core_SxxR, core_SxxS, core_SxxT, core_SxxV, core_SxxW, core_SxxY, core_SxxxA, core_SxxxC, core_SxxxE, core_SxxxF, core_SxxxG, core_SxxxH, core_SxxxI, core_SxxxK, core_SxxxL, core_SxxxN, core_SxxxP, core_SxxxR, core_SxxxT, core_SxxxV, core_SxxxW, core_SxxxxA, core_SxxxxC, core_SxxxxE, core_SxxxxF, core_SxxxxG, core_SxxxxH, core_SxxxxL, core_SxxxxM, core_SxxxxN, core_SxxxxP, core_SxxxxR, core_SxxxxS, core_SxxxxT, core_SxxxxV, core_SxxxxxA, core_SxxxxxC, core_SxxxxxD, core_SxxxxxE, core_SxxxxxF, core_SxxxxxG, core_SxxxxxH, core_SxxxxxK, core_SxxxxxL, core_SxxxxxM, core_SxxxxxN, core_SxxxxxP, core_SxxxxxQ, core_SxxxxxR, core_SxxxxxS, core_SxxxxxT, core_SxxxxxW, core_SxxxxxY, core_T, core_TA, core_TC, core_TD, core_TE, core_TF, core_TG, core_TH, core_TI, core_TK, core_TL, core_TN, core_TP, core_TQ, core_TR, core_TT, core_TV, core_TW, core_TY, core_TxA, core_TxC, core_TxD, core_TxE, core_TxF, core_TxG, core_TxK, core_TxM, core_TxN, core_TxP, core_TxQ, core_TxR, core_TxS, core_TxT, core_TxV, core_TxW, core_TxY, core_TxxA, core_TxxC, core_TxxD, core_TxxE, core_TxxG, core_TxxH, core_TxxL, core_TxxN, core_TxxP, core_TxxR, core_TxxS, core_TxxT, core_TxxW, core_TxxY, core_TxxxA, core_TxxxC, core_TxxxD, core_TxxxE, core_TxxxG, core_TxxxH, core_TxxxI, core_TxxxK, core_TxxxL, core_TxxxM, core_TxxxN, core_TxxxP, core_TxxxQ, core_TxxxR, core_TxxxS, core_TxxxT, core_TxxxV, core_TxxxW, core_TxxxY, core_TxxxxA, core_TxxxxC, core_TxxxxD, core_TxxxxE, core_TxxxxG, core_TxxxxH, core_TxxxxI, core_TxxxxK, core_TxxxxM, core_TxxxxN, core_TxxxxP, core_TxxxxR, core_TxxxxS, core_TxxxxV, core_TxxxxW, core_TxxxxY, core_TxxxxxA, core_TxxxxxC, core_TxxxxxD, core_TxxxxxE, core_TxxxxxF, core_TxxxxxG, core_TxxxxxH, core_TxxxxxI, core_TxxxxxK, core_TxxxxxM, core_TxxxxxP, core_TxxxxxQ, core_TxxxxxR, core_TxxxxxS, core_TxxxxxT, core_TxxxxxV, core_TxxxxxW, core_TxxxxxY, core_V, core_VA, core_VD, core_VE, core_VG, core_VH, core_VI, core_VK, core_VL, core_VM, core_VP, core_VQ, core_VR, core_VS, core_VW, core_VY, core_VxA, core_VxC, core_VxD, core_VxE, core_VxF, core_VxG, core_VxH, core_VxK, core_VxL, core_VxM, core_VxN, core_VxP, core_VxQ, core_VxR, core_VxS, core_VxT, core_VxV, core_VxW, core_VxY, core_VxxA, core_VxxC, core_VxxD, core_VxxE, core_VxxF, core_VxxG, core_VxxI, core_VxxL, core_VxxM, core_VxxP, core_VxxQ, core_VxxR, core_VxxS, core_VxxT, core_VxxV, core_VxxW, core_VxxY, core_VxxxA, core_VxxxC, core_VxxxD, core_VxxxE, core_VxxxF, core_VxxxG, core_VxxxL, core_VxxxM, core_VxxxN, core_VxxxP, core_VxxxQ, core_VxxxR, core_VxxxS, core_VxxxT, core_VxxxW, core_VxxxY, core_VxxxxA, core_VxxxxC, core_VxxxxE, core_VxxxxF, core_VxxxxG, core_VxxxxH, core_VxxxxL, core_VxxxxM, core_VxxxxQ, core_VxxxxR, core_VxxxxT, core_VxxxxV, core_VxxxxW, core_VxxxxY, core_VxxxxxA, core_VxxxxxC, core_VxxxxxD, core_VxxxxxE, core_VxxxxxF, core_VxxxxxG, core_VxxxxxL, core_VxxxxxM, core_VxxxxxP, core_VxxxxxQ, core_VxxxxxR, core_VxxxxxV, core_VxxxxxW, core_W, core_WA, core_WC, core_WD, core_WE, core_WF, core_WG, core_WH, core_WI, core_WL, core_WM, core_WP, core_WQ, core_WR, core_WS, core_WT, core_WV, core_WW, core_WxA, core_WxE, core_WxF, core_WxG, core_WxH, core_WxK, core_WxL, core_WxN, core_WxP, core_WxQ, core_WxR, core_WxS, core_WxV, core_WxW, core_WxxC, core_WxxD, core_WxxE, core_WxxF, core_WxxG, core_WxxH, core_WxxL, core_WxxP, core_WxxQ, core_WxxR, core_WxxS, core_WxxT, core_WxxW, core_WxxY, core_WxxxA, core_WxxxC, core_WxxxE, core_WxxxG, core_WxxxH, core_WxxxK, core_WxxxL, core_WxxxM, core_WxxxN, core_WxxxP, core_WxxxQ, core_WxxxR, core_WxxxS, core_WxxxT, core_WxxxV, core_WxxxW, core_WxxxY, core_WxxxxA, core_WxxxxC, core_WxxxxD, core_WxxxxE, core_WxxxxG, core_WxxxxL, core_WxxxxN, core_WxxxxP, core_WxxxxQ, core_WxxxxR, core_WxxxxS, core_WxxxxT, core_WxxxxV, core_WxxxxW, core_WxxxxxA, core_WxxxxxC, core_WxxxxxE, core_WxxxxxG, core_WxxxxxI, core_WxxxxxP, core_WxxxxxQ, core_WxxxxxR, core_WxxxxxS, core_WxxxxxT, core_WxxxxxY, core_Y, core_YA, core_YF, core_YG, core_YI, core_YL, core_YN, core_YP, core_YQ, core_YR, core_YS, core_YV, core_YW, core_YxD, core_YxE, core_YxI, core_YxK, core_YxL, core_YxN, core_YxP, core_YxR, core_YxS, core_YxT, core_YxV, core_YxxA, core_YxxD, core_YxxK, core_YxxL, core_YxxP, core_YxxR, core_YxxV, core_YxxxA, core_YxxxE, core_YxxxG, core_YxxxH, core_YxxxI, core_YxxxN, core_YxxxP, core_YxxxQ, core_YxxxR, core_YxxxS, core_YxxxV, core_YxxxW, core_YxxxY, core_YxxxxA, core_YxxxxD, core_YxxxxF, core_YxxxxH, core_YxxxxK, core_YxxxxP, core_YxxxxQ, core_YxxxxR, core_YxxxxS, core_YxxxxV, core_YxxxxxA, core_YxxxxxG, core_YxxxxxI, core_YxxxxxN, core_YxxxxxP, core_YxxxxxR, core_YxxxxxV, core_length, core_pI, frac_aliphatic, frac_aromatic, frac_c, frac_charge, frac_neg, frac_polar, frac_pos, leader_length, neg, net_charge, peptide_length, polar, pos'

    svm_headers = svm_headers.split(',')
    features_headers = ["Accession_id", "Genus/Species/Code", "Leader", "Core", "Start", "End", "Total Score", "Valid Precursor" ] + svm_headers
    features_csv_file = open(dir_prefix + "temp_features.csv", 'w')
    svm_csv_file = open("{}/svm/fitting_set.csv".format(FILE_DIR), 'w')
    features_writer = csv.writer(features_csv_file)
    svm_writer = csv.writer(svm_csv_file)
    features_writer.writerow(features_headers)
    svm_writer.writerow(svm_headers)
    
        
class Ripp(VirtualRipp):
    def __init__(self, 
                 start, 
                 end, 
                 sequence,
                 upstream_sequence,
                 pfam_2_coords):
        super(Ripp, self).__init__(start, 
                                     end, 
                                     sequence,
                                     upstream_sequence,
                                     pfam_2_coords)
        self.peptide_type = peptide_type
        self.score = 0
        self.set_split()
#        self.set_monoisotopic_mass()
        self.csv_columns = [self.leader, self.core, self.start, self.end]
        self.CUTOFF = CUTOFF
    
    def get_fimo_score(self, fimo_file):
        fimo_output = self.run_fimo_simple(fimo_file)
        fimo_motifs = [int(line.partition("\t")[0]) for line in fimo_output.split("\n") if "\t" in line and line.partition("\t")[0].isdigit()]
        fimo_stops = []
        for line in fimo_output.split("\n"):
            line = line.split("\t")
            if len(line) > 3 and line[3].isdigit():
                fimo_stops.append(int(line[3]))
        fimo_scores = {int(line.split("\t")[0]): float(line.split("\t")[6]) for line in fimo_output.split("\n") if "\t" in line and line.partition("\t")[0].isdigit()}
        return fimo_motifs, fimo_scores, fimo_stops
    
    def set_split(self):
        """Try to identify cleavage site using regular expressions"""
        
        f_scores = self.get_fimo_score("{}/{}_leader_fimo.txt".format(FILE_DIR, peptide_type))  
        l_stop = sorted([0] + f_scores[2])[-1]
        if len(f_scores[0]) > 0:
            self.score += 10
        regex1 = re.search('(.[S|T].{2,7}C)', self.sequence[l_stop:])
        regex2 = re.search('(G[G|A|S])', self.sequence[l_stop:])
    
        if regex1 and regex2:
            if regex2.end() < regex1.start() and regex2.end()+l_stop > 10:
                self.split_index = regex2.end()+l_stop
            elif regex1.start() + l_stop > 10:
                self.split_index = regex1.start()+l_stop
            else:
                self.split_index =  (int)((len(self.sequence)-l_stop)/2)+l_stop
        elif regex1 and not regex2:
            if regex1.start() + l_stop > 10:
                self.split_index = regex1.start()+l_stop
            else:
                self.split_index = (int)((len(self.sequence)-l_stop)/2)+l_stop
        elif regex2 and not regex1:
            if regex2.end() + l_stop > 10:
                self.split_index = regex2.end()+l_stop
            else:
                self.split_index = (int)((len(self.sequence)-l_stop)/2)+l_stop
        else:
            self.split_index = (int)((len(self.sequence)-l_stop)/2)+l_stop
        self.leader = self.sequence[:self.split_index]
        self.core = self.sequence[self.split_index:]
        if len(self.core) < 10:
            self.split_index = len(self.sequence) // 2
            self.leader = self.sequence[:self.split_index]
            self.core = self.sequence[self.split_index:]
    
    def set_score(self, pfam_hmm, cust_hmm):
        scoring_csv_columns = []
        scoring_column_names = []
        c_count = self.core.count("C")
        s_count = self.core.count("S")
        t_count = self.core.count("T")
        fifth_size = len(self.sequence) // 5
        for i in [0, 1, 2, 3, 4]:
            scoring_csv_columns.append(self.sequence[i*fifth_size:(i+1)*fifth_size].count('C') / len(self.sequence))
            scoring_column_names.append("{}/5_frac_c".format(i+1))
                    
        for i in [0, 2, 3, 4]:
            count = 0
            for c in "ST":
                count += self.sequence[i*fifth_size:(i+1)*fifth_size].count(c)
            scoring_csv_columns.append(count / len(self.sequence))
            scoring_column_names.append("{}/5_frac_s_t".format(i+1))
            
        for i in [0, 1, 2, 3, 4]:
            count = 0
            for c in "STC":
                count += self.sequence[i*fifth_size:(i+1)*fifth_size].count(c)
            scoring_csv_columns.append(count / len(self.sequence))
            scoring_column_names.append("{}/5_frac_s_t_c".format(i+1))

           
        scoring_csv_columns.append((c_count) / len(self.sequence))
        scoring_column_names.append("frac_c")
        
        scoring_csv_columns.append((s_count + t_count))
        scoring_column_names.append("S+T")
        
        scoring_csv_columns.append((s_count + t_count + c_count))
        scoring_column_names.append("S+T+C")
        
        aliphatic_core_count = self.core.count("A") + self.core.count("I") + self.core.count("M") + self.core.count("L") + self.core.count("V")
        scoring_csv_columns.append(aliphatic_core_count)
        scoring_column_names.append("aliphatic")
        scoring_csv_columns.append(aliphatic_core_count / len(self.core))
        scoring_column_names.append("frac_aliphatic")
        
        aromatic_core_count = self.core.count("F") + self.core.count("W") + self.core.count("Y")
        scoring_csv_columns.append(aromatic_core_count)
        scoring_column_names.append("aromatic")
        scoring_csv_columns.append(aromatic_core_count / len(self.core))
        scoring_column_names.append("frac_aromatic")
        
        charged_count = self.core.count("D") + self.core.count("E") + self.core.count("K") + self.core.count("R")
        scoring_csv_columns.append(charged_count)
        scoring_column_names.append("charged")
        scoring_csv_columns.append(charged_count  / len(self.core))
        scoring_column_names.append("frac_charge")
        
        polar_count = c_count + s_count + t_count + self.core.count("H") + self.core.count("N") + self.core.count("Q")
        scoring_csv_columns.append(polar_count)
        scoring_column_names.append("polar")
        scoring_csv_columns.append(polar_count  / len(self.core))
        scoring_column_names.append("frac_polar")
        
        pos = self.core.count("R") + self.core.count("K")
        scoring_csv_columns.append(pos)
        scoring_column_names.append("pos")
        scoring_csv_columns.append(pos / len(self.core))
        scoring_column_names.append("frac_pos")
        
        
        neg = self.core.count("D") + self.core.count("E")
        scoring_csv_columns.append(neg)
        scoring_column_names.append("neg")
        scoring_csv_columns.append(neg / len(self.core))
        scoring_column_names.append("frac_neg")
        
        scoring_csv_columns.append(neg + pos)
        scoring_column_names.append("net_charge")
        
        scoring_csv_columns.append(len(self.leader))
        scoring_column_names.append("leader_length")
        
        scoring_csv_columns.append(len(self.sequence))
        scoring_column_names.append("peptide_length")
        
        scoring_csv_columns.append(len(self.core))
        scoring_column_names.append("core_length")
        
        core_seqs = ['core_EH', 'core_VxxW', 'core_IxxxxI', 'core_SxxY', 'core_YxD', 'core_PxxS', 'core_TA', 'core_HxxP', 'core_ExxA', 'core_MxR', 'core_HxxxK', 'core_HxxxQ', 'core_IE', 'core_LxA', 'core_TC', 'core_ExxxE', 'core_SxxxF', 'core_GxL', 'core_ExxQ', 'core_PxS', 'core_SxxD', 'core_RA', 'core_RxxxxV', 'core_DxxV', 'core_GxxxxL', 'core_MxxR', 'core_AxxxxR', 'core_WxxxxxY', 'core_AxxxxxD', 'core_ExxH', 'core_QxxxxxE', 'core_GH', 'core_QxxxxxK', 'core_TxxxV', 'core_RxxxxT', 'core_TxxxN', 'core_S', 'core_QxxxT', 'core_IxR', 'core_KxxxxR', 'core_IxxT', 'core_DH', 'core_GxxxxxH', 'core_IxxxR', 'core_NxxxxxS', 'core_ExxL', 'core_QxH', 'core_IP', 'core_MxxxxW', 'core_VxE', 'core_LY', 'core_WxN', 'core_RY', 'core_LxK', 'core_MI', 'core_DxxL', 'core_PxxxxxT', 'core_PxxxxxD', 'core_CF', 'core_AxxxxxC', 'core_FxV', 'core_TxxxxV', 'core_DxxxxxQ', 'core_KxP', 'core_CxxxxxF', 'core_MxxP', 'core_CxxxC', 'core_DxxxxxN', 'core_WxxxG', 'core_GxxxxH', 'core_RxxxxS', 'core_GxxxxQ', 'core_IL', 'core_AxxxW', 'core_DxL', 'core_HxxxV', 'core_HH', 'core_GxxxxD', 'core_VxY', 'core_LxxxxxR', 'core_PxxxxxL', 'core_PF', 'core_GT', 'core_LxxY', 'core_YV', 'core_KP', 'core_PxxE', 'core_FxQ', 'core_TxxxC', 'core_FxxxL', 'core_MxxD', 'core_DxW', 'core_SxxxxxH', 'core_GxxM', 'core_FxxT', 'core_SR', 'core_SxV', 'core_SL', 'core_KM', 'core_VxxxxE', 'core_RxxxxxY', 'core_CxxxxP', 'core_VxW', 'core_TxxxM', 'core_PxxxI', 'core_QxxxQ', 'core_DxxD', 'core_MxxxxxP', 'core_RxS', 'core_VxxT', 'core_KxY', 'core_SxxxE', 'core_QxD', 'core_TY', 'core_IA', 'core_NH', 'core_MxxxxxK', 'core_MxxxxR', 'core_LR', 'core_CxxxxxA', 'core_FxW', 'core_MxxxV', 'core_G', 'core_TxxW', 'core_DxY', 'core_YxxxQ', 'core_PxxG', 'core_FxxW', 'core_PxP', 'core_PN', 'core_WxxG', 'core_WF', 'core_V', 'core_AxxxxxR', 'core_SxxxN', 'core_YxT', 'core_LP', 'core_GxxxP', 'core_GxxD', 'core_GxxV', 'core_KxxxxxK', 'core_QW', 'core_IxT', 'core_GC', 'core_KxxxG', 'core_FY', 'core_MT', 'core_DxP', 'core_NxxxxxV', 'core_IxxxxT', 'core_CE', 'core_YxxxxR', 'core_DxxC', 'core_TxxxxxH', 'core_RT', 'core_IxxxxE', 'core_CxxxxR', 'core_ExxR', 'core_NxG', 'core_TxxxS', 'core_TxE', 'core_CxG', 'core_FxC', 'core_NxL', 'core_RG', 'core_VxxxF', 'core_WxxF', 'core_QxxxxxH', 'core_DT', 'core_GxxxxY', 'core_DxxxI', 'core_CxA', 'core_FxxxxxG', 'core_NxP', 'core_CxS', 'core_RxxV', 'core_KxF', 'core_AxY', 'core_DxxE', 'core_YxxxxF', 'core_AxxxxxE', 'core_WxxxxR', 'core_LxxM', 'core_AxxxxQ', 'core_DxxR', 'core_IxxxD', 'core_VxxxxW', 'core_MxxxK', 'core_CxxxxK', 'core_RxxxxG', 'core_WxxT', 'core_LxxxxE', 'core_TxxxxS', 'core_NxxxP', 'core_TxV', 'core_QxxC', 'core_MxxxxxT', 'core_SxxxxxK', 'core_SxS', 'core_QxxxxR', 'core_DxxxxK', 'core_RxxxxA', 'core_SxxM', 'core_KT', 'core_NW', 'core_ExxxxR', 'core_TxxxA', 'core_KxA', 'core_GG', 'core_SxxI', 'core_MK', 'core_SxxxxT', 'core_LxxxxxS', 'core_SxxP', 'core_IxxxC', 'core_MxxT', 'core_FL', 'core_RxxxI', 'core_KxxxW', 'core_NxxP', 'core_PxxH', 'core_GxD', 'core_AxxW', 'core_QxxxxxG', 'core_MxxxxxA', 'core_IR', 'core_FxxxxxT', 'core_KxxxxxY', 'core_RxG', 'core_MF', 'core_ExxxxxV', 'core_GxN', 'core_TxxxE', 'core_CxY', 'core_LxxxxxE', 'core_YxxxxxI', 'core_HE', 'core_KR', 'core_FM', 'core_DxxxxI', 'core_HxxE', 'core_IxxxxxK', 'core_EL', 'core_WxQ', 'core_GxW', 'core_MxxxE', 'core_DxxxxxG', 'core_TxxxxxK', 'core_QxxxxV', 'core_HxxxxxH', 'core_PxxxN', 'core_RxxxxxL', 'core_HxxxR', 'core_RxxxxI', 'core_ExxxxN', 'core_SxxxxxG', 'core_DxxQ', 'core_NxxA', 'core_FQ', 'core_CP', 'core_RxxxxxC', 'core_FxxxxK', 'core_LxxxY', 'core_WxxxxD', 'core_TxxxxxF', 'core_HxA', 'core_WxxR', 'core_PxxM', 'core_MR', 'core_LxxxE', 'core_RR', 'core_VxxxxR', 'core_AW', 'core_DE', 'core_FxxxxC', 'core_ExxxxA', 'core_SxxxI', 'core_SQ', 'core_FxxC', 'core_CxxW', 'core_AxxxxxF', 'core_GK', 'core_HxL', 'core_AxE', 'core_WxxxE', 'core_QxxxxA', 'core_K', 'core_TxxxQ', 'core_IxxxxQ', 'core_LxxxxxW', 'core_FxxA', 'core_YxxxxxG', 'core_PK', 'core_RxxxxL', 'core_SN', 'core_PxxC', 'core_RxxxxxD', 'core_GxxxC', 'core_SxxxxxM', 'core_FxY', 'core_RxV', 'core_YxxxI', 'core_YxE', 'core_KxxW', 'core_FxA', 'core_NxxxY', 'core_SxxxxxA', 'core_NxxxS', 'core_SxxxK', 'core_AxxxC', 'core_NS', 'core_VxxxxQ', 'core_NxxxxxG', 'core_PC', 'core_CxxS', 'core_PxxxxF', 'core_CxxxxxC', 'core_AxxxxxM', 'core_TxxxxxG', 'core_DxxxxT', 'core_YxxP', 'core_MxE', 'core_HxxxxxM', 'core_PxxL', 'core_CxT', 'core_FK', 'core_KxxxQ', 'core_IxxxP', 'core_ExF', 'core_AxH', 'core_PxxxxM', 'core_KV', 'core_MC', 'core_NxxxN', 'core_MW', 'core_AxxP', 'core_MxC', 'core_WxxxxxC', 'core_NL', 'core_AxxxH', 'core_PxxxxS', 'core_AxxxG', 'core_LxxD', 'core_FxxG', 'core_SxxS', 'core_GxxxxxS', 'core_HxxxC', 'core_GxxxK', 'core_HxxA', 'core_PxxQ', 'core_ExxxL', 'core_SxxxxxE', 'core_MxxxxE', 'core_CxxxW', 'core_TxxxxxW', 'core_CxE', 'core_GW', 'core_RxxxxxI', 'core_CxxxxD', 'core_AxxxY', 'core_KxW', 'core_VxxA', 'core_MxxxxS', 'core_MxQ', 'core_FxxP', 'core_FxxxF', 'core_PxD', 'core_GxY', 'core_YR', 'core_MxxxxxL', 'core_MN', 'core_FxxxxL', 'core_RxxxH', 'core_MxxL', 'core_ExV', 'core_IxP', 'core_AR', 'core_EP', 'core_TxxxxR', 'core_NP', 'core_AxxxxF', 'core_GxxxG', 'core_FxxxxE', 'core_RE', 'core_CxxxE', 'core_TxxE', 'core_MxP', 'core_FxxxA', 'core_LQ', 'core_YxxR', 'core_YxxxxxA', 'core_M', 'core_HS', 'core_PxxxxxH', 'core_MxT', 'core_LxI', 'core_DxC', 'core_WxxW', 'core_MxxxP', 'core_AxxxxxP', 'core_WG', 'core_LxxxxY', 'core_SV', 'core_YxxxxV', 'core_AxxC', 'core_WxxxxC', 'core_MxA', 'core_HA', 'core_IxxxxxP', 'core_QxxxxM', 'core_WS', 'core_WxxE', 'core_QxxW', 'core_CxxxxxM', 'core_PxxxxxF', 'core_DxxxxxT', 'core_LxE', 'core_MA', 'core_PxxxxD', 'core_SxA', 'core_AxxxxxT', 'core_QT', 'core_WxxxA', 'core_SM', 'core_MxxS', 'core_SxxxxA', 'core_WP', 'core_WxxD', 'core_WxxxH', 'core_FxxxxS', 'core_ExxxxT', 'core_SxxF', 'core_SxxxxS', 'core_DxxxQ', 'core_WxxxY', 'core_LE', 'core_SxxxR', 'core_DQ', 'core_ExxV', 'core_WxxS', 'core_YxN', 'core_YxxxG', 'core_SxxxA', 'core_VxxxxxV', 'core_AxxxxY', 'core_QxR', 'core_ExxxI', 'core_CxxxL', 'core_MxxA', 'core_ML', 'core_RxL', 'core_ExK', 'core_GxK', 'core_IS', 'core_CxxxxxT', 'core_YF', 'core_DxK', 'core_VxxR', 'core_PxxxxxG', 'core_AxxT', 'core_VR', 'core_DxxxS', 'core_ES', 'core_YW', 'core_ExxxW', 'core_ExN', 'core_QxS', 'core_KxxxxxP', 'core_NR', 'core_FxxE', 'core_ExxxH', 'core_DxD', 'core_DxxxxS', 'core_FxxN', 'core_VxxxxT', 'core_IxF', 'core_WxxxxA', 'core_KC', 'core_VxF', 'core_MxxxxA', 'core_AF', 'core_DxxxxR', 'core_LxxxL', 'core_FA', 'core_PxxxxxQ', 'core_QP', 'core_TxxxxK', 'core_TxxxY', 'core_GxxxV', 'core_RxxxxxE', 'core_ExxxxxS', 'core_ExxxA', 'core_VxxxxxF', 'core_YxK', 'core_PxF', 'core_IxxxxxG', 'core_LxxxxF', 'core_GxxxH', 'core_ExP', 'core_DD', 'core_VM', 'core_KxxxxG', 'core_CxxP', 'core_ExxF', 'core_FxxxS', 'core_NxI', 'core_ExxP', 'core_SxxL', 'core_CxxxxA', 'core_IF', 'core_LxxxS', 'core_HxD', 'core_ExM', 'core_D', 'core_VxxxG', 'core_YI', 'core_VxxxP', 'core_AxxS', 'core_SxD', 'core_ExxxxH', 'core_PxxxxxW', 'core_DxxxR', 'core_NxT', 'core_LL', 'core_PT', 'core_IxxxxxC', 'core_PxxW', 'core_LxD', 'core_VxP', 'core_LxxxxxN', 'core_AxxxQ', 'core_RxW', 'core_YxxxR', 'core_NxxxL', 'core_HxxxxxR', 'core_YxxxxxV', 'core_PxxK', 'core_VxT', 'core_SxxG', 'core_AT', 'core_MxxxxxG', 'core_YxL', 'core_TxxxxP', 'core_SI', 'core_GxxxE', 'core_KxxxxP', 'core_AP', 'core_HxxxT', 'core_TD', 'core_RxxD', 'core_PxY', 'core_FxxxV', 'core_QxI', 'core_TxxxxA', 'core_MxxxL', 'core_YxxxxxR', 'core_TE', 'core_QxxxxxA', 'core_DxxxxxV', 'core_LxxxxN', 'core_FxxxQ', 'core_ExL', 'core_QxxxE', 'core_AH', 'core_FxxR', 'core_RxxxP', 'core_SxxxxxR', 'core_LxxxM', 'core_AxxxxN', 'core_TxxxxxY', 'core_CxxC', 'core_IxxxxR', 'core_KxD', 'core_CxxxxN', 'core_PxG', 'core_TxxS', 'core_GxxxxxL', 'core_CxL', 'core_AxxxxxS', 'core_ExxxR', 'core_ExxxxD', 'core_TR', 'core_IxxS', 'core_TxxA', 'core_GxxxxR', 'core_FxxxR', 'core_SxT', 'core_LxxC', 'core_RxxH', 'core_WM', 'core_MxxM', 'core_PxxxQ', 'core_GxxxxxN', 'core_DxxxxP', 'core_ExxxS', 'core_DG', 'core_HxP', 'core_CxxxxxK', 'core_EK', 'core_WxxxS', 'core_ME', 'core_VxQ', 'core_VxxxE', 'core_VxxxxxW', 'core_RxxxxxV', 'core_SxxxxxY', 'core_SxxW', 'core_ExxxxxI', 'core_SxxxxC', 'core_VA', 'core_FxH', 'core_TxxxxE', 'core_MxxxxF', 'core_PG', 'core_KxxxxS', 'core_ST', 'core_ExxxG', 'core_LxxxxxA', 'core_KxxxxxR', 'core_YxxxW', 'core_PY', 'core_MxL', 'core_PxxT', 'core_TxP', 'core_FxxxxM', 'core_NxxxG', 'core_SxxxP', 'core_TxxxxN', 'core_GxxR', 'core_IxxxN', 'core_GxxxxW', 'core_GR', 'core_TxxC', 'core_LxxxxW', 'core_WxL', 'core_IxxxxxA', 'core_WW', 'core_PxE', 'core_SxxR', 'core_RI', 'core_AxD', 'core_NxS', 'core_PxxxM', 'core_HxxQ', 'core_SxxxxxT', 'core_HxxxxR', 'core_SxxxL', 'core_NxxxxxL', 'core_PxV', 'core_VxxxxxE', 'core_TxF', 'core_CxxG', 'core_FF', 'core_KxxR', 'core_DxxxxW', 'core_KxxxxxC', 'core_FT', 'core_DxxxxV', 'core_DxxxxxR', 'core_WxxxR', 'core_SxxV', 'core_YxxxxK', 'core_VxM', 'core_RxM', 'core_MxxxxxE', 'core_QxxxxT', 'core_NC', 'core_DM', 'core_DA', 'core_WC', 'core_DxA', 'core_PxxP', 'core_RxxxN', 'core_HxQ', 'core_GxxxxxG', 'core_QxT', 'core_YG', 'core_ExxE', 'core_FxxxxxE', 'core_AxxxI', 'core_NxxV', 'core_WxxxxxI', 'core_FxxxxxS', 'core_SxH', 'core_ExxxxxR', 'core_GxxxxF', 'core_TQ', 'core_VxxxxA', 'core_ExxxxxK', 'core_KxxxR', 'core_AxxxE', 'core_EW', 'core_NxxxxR', 'core_PxxxxxC', 'core_Y', 'core_GxxS', 'core_LxxxT', 'core_CxxV', 'core_SxxC', 'core_IxxC', 'core_DxxF', 'core_GxxxQ', 'core_SxE', 'core_YN', 'core_TxxxG', 'core_LxG', 'core_SxxxxxD', 'core_KxxS', 'core_GxxQ', 'core_GxxxI', 'core_RC', 'core_YxxxxQ', 'core_TxxxxG', 'core_PxxxxxA', 'core_T', 'core_VxxE', 'core_SxxxxG', 'core_TxxxxD', 'core_IxxxE', 'core_RxxxE', 'core_WxxxxW', 'core_MxxxR', 'core_TxxxxxD', 'core_CxI', 'core_QxxxxxD', 'core_AD', 'core_TG', 'core_RxxxxH', 'core_NxxxR', 'core_RxxxxD', 'core_FxxxxxP', 'core_PxC', 'core_GA', 'core_RxxxxxP', 'core_AxxD', 'core_CxxxS', 'core_AxxxxxI', 'core_WxxxxxA', 'core_PxxxY', 'core_FxxxY', 'core_ExxI', 'core_MH', 'core_AxxK', 'core_SxxK', 'core_HC', 'core_KxxxH', 'core_FxxD', 'core_AxxxS', 'core_LxxxxxY', 'core_ExxG', 'core_RxD', 'core_VxxxM', 'core_CxQ', 'core_WxxxxG', 'core_RL', 'core_WxS', 'core_ER', 'core_HxxxD', 'core_RxxxS', 'core_PxxxxH', 'core_FR', 'core_FxxxxD', 'core_CxH', 'core_ExxxxL', 'core_PH', 'core_SxxxT', 'core_CxxxR', 'core_AxxxxE', 'core_IxxxW', 'core_TxxxxxE', 'core_TxxN', 'core_LxN', 'core_KxxA', 'core_VS', 'core_C', 'core_FxxxC', 'core_RxxF', 'core_AK', 'core_AA', 'core_TxA', 'core_KxxxxE', 'core_FxxxxxY', 'core_SxxH', 'core_RxR', 'core_ExxxY', 'core_LM', 'core_RxxxxxG', 'core_PxT', 'core_WxxxxL', 'core_TxR', 'core_H', 'core_CA', 'core_AxK', 'core_EI', 'core_PxxxxV', 'core_HxxI', 'core_GxxxxxR', 'core_QxxxV', 'core_AxxH', 'core_RxxxxxN', 'core_GxxxxG', 'core_WxxP', 'core_GxxP', 'core_SxxxxxQ', 'core_SxxxxxN', 'core_MxxxxxR', 'core_IK', 'core_IY', 'core_LxxxA', 'core_LxxxxA', 'core_YxR', 'core_GY', 'core_NxxxxxD', 'core_KE', 'core_TV', 'core_DxxxH', 'core_RM', 'core_MxxxxV', 'core_YxxxxA', 'core_WxV', 'core_DxS', 'core_HD', 'core_GxxxxxE', 'core_AM', 'core_LxT', 'core_HxxxxxK', 'core_WQ', 'core_YQ', 'core_VxxxQ', 'core_YxxxxxP', 'core_RW', 'core_RxxE', 'core_VH', 'core_NxxR', 'core_IxxxxK', 'core_RxxL', 'core_RxxW', 'core_LxxxF', 'core_FxK', 'core_PxxY', 'core_ExxxxxT', 'core_KxxP', 'core_CQ', 'core_KD', 'core_IxxQ', 'core_CxF', 'core_AxxxxA', 'core_RxxxY', 'core_MxxxxT', 'core_QxxxxQ', 'core_HxxV', 'core_LxxxG', 'core_LxxE', 'core_TxxxR', 'core_DF', 'core_DxxxW', 'core_WxA', 'core_IxG', 'core_HxxxxD', 'core_AxxxxV', 'core_RH', 'core_W', 'core_RxxxxQ', 'core_VxxxxxR', 'core_VQ', 'core_FxxxxxL', 'core_QxxxA', 'core_QxxI', 'core_MxxxT', 'core_SxG', 'core_YA', 'core_IxxxQ', 'core_LxxxxxC', 'core_RxxxC', 'core_VxxxxH', 'core_IxxxxxW', 'core_MxK', 'core_SxxN', 'core_GxxxR', 'core_RxxxL', 'core_FV', 'core_GxQ', 'core_WxxxxT', 'core_RK', 'core_YxxxxS', 'core_KxxxF', 'core_CxxxxL', 'core_VxxxxxP', 'core_HM', 'core_ExxxD', 'core_YxI', 'core_PQ', 'core_DxE', 'core_ExH', 'core_RxxxxxS', 'core_ExxxT', 'core_AxT', 'core_GxI', 'core_LxxxxC', 'core_RD', 'core_IxxM', 'core_WL', 'core_PD', 'core_PL', 'core_LxM', 'core_RxxG', 'core_TxxY', 'core_QxE', 'core_ExxxxI', 'core_GxF', 'core_DxxxxxH', 'core_PxxI', 'core_CL', 'core_PxW', 'core_VxxG', 'core_LxxxxL', 'core_ExxxC', 'core_HxxxxxE', 'core_QxxxH', 'core_GxA', 'core_KxxI', 'core_RxxQ', 'core_FxF', 'core_GxxC', 'core_PxxxA', 'core_CxxxxG', 'core_VG', 'core_WxE', 'core_QxA', 'core_VxxxN', 'core_DxxxD', 'core_RxxxxxF', 'core_SxxA', 'core_FxxxxT', 'core_LxxxR', 'core_CxxE', 'core_EN', 'core_RxN', 'core_VxxxY', 'core_CxxF', 'core_AxxL', 'core_ExxxxxH', 'core_QxxxxD', 'core_QxxF', 'core_AxxxxP', 'core_CxxR', 'core_CN', 'core_HxxxxE', 'core_CxR', 'core_WxxxxV', 'core_PxM', 'core_CxxD', 'core_CxxT', 'core_VxR', 'core_ExxxxC', 'core_KxxG', 'core_VxC', 'core_ExS', 'core_YxxxV', 'core_LK', 'core_TxxH', 'core_KQ', 'core_SxxxxR', 'core_GxxxxP', 'core_NxxxxxW', 'core_HxxxxA', 'core_SxF', 'core_FxxxxxI', 'core_SxL', 'core_PxxxxxN', 'core_TxM', 'core_VxxxxM', 'core_AxxxxC', 'core_ExT', 'core_PR', 'core_PxI', 'core_CxxxxM', 'core_RxxxA', 'core_GxV', 'core_FxI', 'core_VxxxD', 'core_ExD', 'core_MxxxI', 'core_FxxxxH', 'core_FxN', 'core_GxxxxA', 'core_PW', 'core_WxxL', 'core_MG', 'core_NxxS', 'core_PxxxxxI', 'core_WxxxxS', 'core_NxH', 'core_DxxxxxK', 'core_WxxxP', 'core_WA', 'core_GxxxxV', 'core_TxG', 'core_RxxP', 'core_IxxxxxI', 'core_IxxxK', 'core_RxH', 'core_LxR', 'core_AxN', 'core_LxxxxV', 'core_GxP', 'core_CxK', 'core_RxP', 'core_KxxF', 'core_QxxxxF', 'core_WH', 'core_VxH', 'core_VxxxxxM', 'core_GxxxxxP', 'core_DxxxxxY', 'core_IG', 'core_FxxS', 'core_LxxxP', 'core_AxxxK', 'core_FS', 'core_RxY', 'core_NxxxH', 'core_QxxxxP', 'core_RxxxF', 'core_ExxT', 'core_RxxxT', 'core_TxxxxM', 'core_IxxxG', 'core_QxxxR', 'core_HxxxxxI', 'core_NE', 'core_TL', 'core_VxxF', 'core_MxxxW', 'core_HxxxxxY', 'core_SxxE', 'core_PS', 'core_LxxxxS', 'core_VxxxS', 'core_QxxxxxF', 'core_ExxxxxE', 'core_PxxxxC', 'core_TxxxxxI', 'core_FC', 'core_FxxxxA', 'core_AxxxA', 'core_WxxxQ', 'core_WxxxT', 'core_DxF', 'core_IH', 'core_TxxxxxP', 'core_YxS', 'core_DxxxxxF', 'core_IxxR', 'core_YS', 'core_IxxxxxT', 'core_AxxxxxY', 'core_RV', 'core_PxxV', 'core_CxW', 'core_PxR', 'core_FW', 'core_FxR', 'core_HxW', 'core_GxxxxxC', 'core_LxxxH', 'core_SxxxxP', 'core_HxR', 'core_VY', 'core_QxxL', 'core_AxxM', 'core_RxxR', 'core_ExxxxxQ', 'core_LxxA', 'core_ExxxxxD', 'core_AxxxM', 'core_WD', 'core_VxxxxxA', 'core_QE', 'core_NF', 'core_TxxxxY', 'core_R', 'core_CxxxxS', 'core_RxxxxxM', 'core_VxxxxL', 'core_WxG', 'core_RxxxxxT', 'core_ExA', 'core_AxxE', 'core_MxxxA', 'core_PxxxxxP', 'core_CH', 'core_YxxxS', 'core_NxxxxW', 'core_RxQ', 'core_QxxxxxV', 'core_EY', 'core_EQ', 'core_GxxF', 'core_PxxxT', 'core_IxxxxY', 'core_AxQ', 'core_PxxxxN', 'core_PxxxG', 'core_GxM', 'core_EC', 'core_DxxA', 'core_ExxxxV', 'core_TxxxH', 'core_FxxxxG', 'core_LxxV', 'core_TT', 'core_RxxxxN', 'core_HxxxxK', 'core_AxxxV', 'core_PxxxH', 'core_SxxxxN', 'core_QG', 'core_YxxxxD', 'core_HxxxxxV', 'core_QxxP', 'core_TxxG', 'core_VE', 'core_ExxxxF', 'core_GxxW', 'core_IxK', 'core_VxxM', 'core_L', 'core_RxxxQ', 'core_KxR', 'core_KxG', 'core_QxxxP', 'core_MxxG', 'core_DxxxxA', 'core_TW', 'core_TxW', 'core_VxxxxxL', 'core_NK', 'core_ExG', 'core_AxxxxL', 'core_HxxxxxQ', 'core_PxQ', 'core_MxxxxL', 'core_RxxxxxK', 'core_PxxxxxV', 'core_DxxxC', 'core_GxxxA', 'core_CxxxxI', 'core_TxxxD', 'core_LxxxxD', 'core_LxW', 'core_RxxxxC', 'core_ExxC', 'core_VxxY', 'core_LxxxxxI', 'core_LxxxD', 'core_PxxF', 'core_RxxC', 'core_IxL', 'core_NxxxK', 'core_WxxxxxE', 'core_ExxxxxY', 'core_MxxxS', 'core_NxxxxxY', 'core_PxxxxQ', 'core_DV', 'core_VxxV', 'core_IxxxxxQ', 'core_FxxxxxF', 'core_CxxxxxL', 'core_AxxxxG', 'core_HxxxI', 'core_ExR', 'core_KxS', 'core_QxL', 'core_LxxxxxP', 'core_CxxxxxR', 'core_DR', 'core_IxxP', 'core_MxS', 'core_RxxA', 'core_GP', 'core_NxxxD', 'core_CS', 'core_QxxxxxP', 'core_SxC', 'core_DxxP', 'core_VxxxxF', 'core_DxxxE', 'core_CW', 'core_VxA', 'core_GxxxxxK', 'core_RxxxxM', 'core_GxxxxxM', 'core_PxxA', 'core_KxC', 'core_ExxxF', 'core_NxxxxxA', 'core_ExxxxxF', 'core_VxD', 'core_NxxxxxR', 'core_WxxxxxR', 'core_HxxD', 'core_RxxK', 'core_DxxxG', 'core_TxxD', 'core_FxD', 'core_CxP', 'core_FxP', 'core_YxxxE', 'core_AQ', 'core_GxxxxxF', 'core_AxxxxD', 'core_QxxxxY', 'core_KxxxxD', 'core_YxxD', 'core_DS', 'core_KxxE', 'core_FxT', 'core_CxxxxxD', 'core_QxxxF', 'core_VxxxxxD', 'core_VxxL', 'core_NxxW', 'core_WxxxxxG', 'core_HxxxP', 'core_LxQ', 'core_IxxxxxV', 'core_FxxxxR', 'core_SxxxxxL', 'core_MxxxxxC', 'core_VxN', 'core_LxxK', 'core_LxxxxM', 'core_GxxxM', 'core_VxxxC', 'core_WxxQ', 'core_GN', 'core_RQ', 'core_DxxxxxD', 'core_IxxxS', 'core_QY', 'core_KxxxK', 'core_TK', 'core_HxH', 'core_TxxxK', 'core_AxxxR', 'core_AxA', 'core_CxxxxxS', 'core_RxE', 'core_AxP', 'core_WxxxxxT', 'core_NxxL', 'core_DxxxA', 'core_ExxM', 'core_FxxxxxA', 'core_GxxA', 'core_QxxA', 'core_LxxxxQ', 'core_PxxxxW', 'core_DxR', 'core_RP', 'core_YxxxxH', 'core_IxxxxP', 'core_TxD', 'core_VxV', 'core_RxxS', 'core_CxD', 'core_WxxxxxQ', 'core_AG', 'core_RxxN', 'core_PV', 'core_WxxC', 'core_AxxxxxA', 'core_KxT', 'core_ExxxxP', 'core_LN', 'core_GxxH', 'core_DxxxF', 'core_VK', 'core_SxxQ', 'core_TxxT', 'core_SxN', 'core_KA', 'core_QxxxxxT', 'core_WxxH', 'core_DI', 'core_AxxxL', 'core_IxxxA', 'core_HxxxxN', 'core_IxxxI', 'core_IxS', 'core_VL', 'core_MxxxxxS', 'core_AxxR', 'core_VW', 'core_MxxxxC', 'core_HxxxxH', 'core_VxxxxY', 'core_KxH', 'core_KxxxxxA', 'core_LxxxxxL', 'core_WxxxxxP', 'core_FxxxG', 'core_PxxxS', 'core_PxxD', 'core_CxxxM', 'core_DxG', 'core_ExxD', 'core_CxxxxxV', 'core_ExW', 'core_GE', 'core_QxxV', 'core_RxxxD', 'core_GxxL', 'core_NxxxxxC', 'core_N', 'core_CxxxxxY', 'core_ExxxxxC', 'core_IxxxxxM', 'core_TxxL', 'core_RxK', 'core_A', 'core_VxxxxC', 'core_HxE', 'core_DxxxxD', 'core_HxxxxT', 'core_SxI', 'core_PxxxxG', 'core_IxD', 'core_KxL', 'core_QxxxxE', 'core_GxxxL', 'core_FG', 'core_AxxxD', 'core_RxA', 'core_YP', 'core_WxxxN', 'core_YxxxN', 'core_WxK', 'core_AY', 'core_ExxxxS', 'core_RxT', 'core_FxxxxI', 'core_FD', 'core_WE', 'core_SxxxxxS', 'core_ExC', 'core_SE', 'core_SxxxxH', 'core_EV', 'core_PxxxL', 'core_LxxG', 'core_PxxxV', 'core_WxxxC', 'core_VxxxxxC', 'core_KS', 'core_LxxxxxH', 'core_WI', 'core_YxxxxxN', 'core_LS', 'core_E', 'core_TxxxxxM', 'core_CxxxxxW', 'core_FxxxxxW', 'core_DP', 'core_NxxxxxK', 'core_TxxR', 'core_GxxxxC', 'core_RS', 'core_LxxxxxF', 'core_GxxxxE', 'core_CxxM', 'core_VxL', 'core_YxxxxP', 'core_QxP', 'core_RxI', 'core_QxxxxxR', 'core_VxxP', 'core_RxxxxxQ', 'core_SxxxxxP', 'core_QxG', 'core_AxxxxW', 'core_HV', 'core_RxxM', 'core_CxN', 'core_DxxxK', 'core_DL', 'core_YxxK', 'core_PxxR', 'core_MP', 'core_LxxT', 'core_TxxxxxA', 'core_CxM', 'core_VxxxT', 'core_RxxxV', 'core_AxxxxxG', 'core_HxxS', 'core_LxxxxxQ', 'core_TxxxxW', 'core_CxxxI', 'core_MM', 'core_TxN', 'core_VxxxR', 'core_LxxxxxM', 'core_HN', 'core_CR', 'core_GxC', 'core_ExxxxE', 'core_SxxxxxC', 'core_GxxxS', 'core_DxxxxC', 'core_PxxxxI', 'core_LxY', 'core_TxxxxxC', 'core_QF', 'core_SxxxxL', 'core_AxxxxS', 'core_CxxxP', 'core_FxxxM', 'core_DY', 'core_DxV', 'core_NxxxxS', 'core_TxxxL', 'core_LxxL', 'core_HL', 'core_FxxxE', 'core_MxxxM', 'core_VxxQ', 'core_GxE', 'core_SxxxxE', 'core_ExxxQ', 'core_YxxV', 'core_VP', 'core_RxxxR', 'core_RxxxxxH', 'core_VxxxxG', 'core_GxxE', 'core_AxxA', 'core_CxxxH', 'core_DxxxV', 'core_RxxxxP', 'core_AxxxxH', 'core_AI', 'core_QxF', 'core_P', 'core_AxL', 'core_RxxxxxW', 'core_HxxxxxP', 'core_TxxxxxS', 'core_KxM', 'core_DxT', 'core_TxxxxxR', 'core_AC', 'core_TxC', 'core_GxxxxS', 'core_I', 'core_LD', 'core_HxxxxxF', 'core_FxxxH', 'core_CxxxxC', 'core_SD', 'core_AxC', 'core_MxxK', 'core_LxxQ', 'core_KxN', 'core_DxxxxxA', 'core_ExxxxK', 'core_LxxxN', 'core_CxxxV', 'core_SxxxxF', 'core_CM', 'core_GS', 'core_NxC', 'core_ExxS', 'core_WxF', 'core_GxxG', 'core_PI', 'core_RxxxxK', 'core_VxxC', 'core_SxxxV', 'core_TxxxxxT', 'core_CxxxF', 'core_TxK', 'core_LC', 'core_TF', 'core_SxxxxxW', 'core_LxP', 'core_SxxxxxF', 'core_CK', 'core_LF', 'core_VxxxxV', 'core_HxxxxxG', 'core_LxV', 'core_DxxxP', 'core_KxxxxW', 'core_VxxxxxG', 'core_QxxxxC', 'core_KxxxxC', 'core_GxR', 'core_HP', 'core_CxxxxxP', 'core_LxxxxP', 'core_AE', 'core_GxT', 'core_FxxxxxK', 'core_MxxxxG', 'core_HxxxxP', 'core_AxxxxxQ', 'core_HxF', 'core_HxxxxxL', 'core_MxxE', 'core_GxxxxxA', 'core_QK', 'core_WxxxW', 'core_FxxxxxN', 'core_SxM', 'core_HxxC', 'core_DxxG', 'core_IT', 'core_HxxxxxA', 'core_DxxxxxP', 'core_MxxxxP', 'core_EA', 'core_HxxxxxS', 'core_QxxxxH', 'core_WxW', 'core_GxxxD', 'core_QxxxxxN', 'core_WR', 'core_CxxxxxG', 'core_PxxxxE', 'core_PxxxxxS', 'core_TxxxxH', 'core_WT', 'core_GM', 'core_PxxxE', 'core_HxxxA', 'core_VxxxxxQ', 'core_QxxxY', 'core_FxxxxxR', 'core_RxxxxW', 'core_NxA', 'core_PxxxxxY', 'core_LA', 'core_TxQ', 'core_FxS', 'core_ExxxV', 'core_QxxxG', 'core_CD', 'core_QxxxxxL', 'core_HxxT', 'core_MxxxQ', 'core_RxxxxY', 'core_CC', 'core_QV', 'core_FxxxxP', 'core_FxxxxxH', 'core_HT', 'core_ExxxxxA', 'core_WxP', 'core_TxxxxI', 'core_TxxxW', 'core_AxxxxM', 'core_GxxxW', 'core_WxxxxQ', 'core_FxxxxQ', 'core_PxH', 'core_HxV', 'core_ExxxM', 'core_NxxxxP', 'core_HxxxxY', 'core_DxxH', 'core_AxxQ', 'core_KxxxxF', 'core_GF', 'core_YxP', 'core_FxxQ', 'core_HxxxxW', 'core_WxxY', 'core_LxxxxR', 'core_GV', 'core_AxxxxI', 'core_HxxxE', 'core_WxxxM', 'core_KxxxxT', 'core_TxxP', 'core_SxxxxV', 'core_RxxxG', 'core_MxxF', 'core_IxxxxA', 'core_ExxxP', 'core_GxxxN', 'core_MxxxxxI', 'core_VxS', 'core_VI', 'core_AxxxxK', 'core_CxxxD', 'core_RxxxxE', 'core_PxxxxxM', 'core_KxxxM', 'core_YxxxH', 'core_MxV', 'core_VxxI', 'core_WV', 'core_YxxL', 'core_KxxxP', 'core_ID', 'core_IxxE', 'core_PE', 'core_PxK', 'core_RxxxxxA', 'core_DxxxxG', 'core_CxxxG', 'core_PxxxxL', 'core_PxxxxK', 'core_SxxxW', 'core_GD', 'core_CxxL', 'core_SG', 'core_YxxA', 'core_SxxxC', 'core_AxR', 'core_WxxxV', 'core_CG', 'core_IxxxF', 'core_SxR', 'core_SS', 'core_QL', 'core_NxxxxL', 'core_RxxxxxR', 'core_IxH', 'core_FE', 'core_DW', 'core_DxxT', 'core_KL', 'core_YxV', 'core_QxxG', 'core_AL', 'core_QxxD', 'core_ExxxxQ', 'core_PxxxP', 'core_QxxxxxC', 'core_LxC', 'core_FxxxN', 'core_AxG', 'core_IxxxxW', 'core_HI', 'core_PxxxF', 'core_RxxxK', 'core_AS', 'core_WxxxxE', 'core_TxS', 'core_MxxxxH', 'core_SP', 'core_DxxxxE', 'core_DxxI', 'core_PP', 'core_RxC', 'core_IxxxxC', 'core_NN', 'core_WxxxxP', 'core_QxxxW', 'core_FxxI', 'core_KF', 'core_MxxxxxD', 'core_YL', 'core_RxxI', 'core_GI', 'core_FxxxP', 'core_RxF', 'core_VxxS', 'core_MV', 'core_NxxG', 'core_NxxxF', 'core_SW', 'core_AV', 'core_PxxxxP', 'core_MxxxF', 'core_QxxQ', 'core_KxxD', 'core_FxG', 'core_MxxxxxW', 'core_CxxxxxI', 'core_DxxxL', 'core_IxI', 'core_RxxT', 'core_VxxxW', 'core_IM', 'core_QxV', 'core_HxxxxV', 'core_FxxxxN', 'core_RxxxM', 'core_PxxxxxR', 'core_ExxxxxP', 'core_SxP', 'core_AxxG', 'core_GQ', 'core_FxxxT', 'core_FxxxxV', 'core_LxxR', 'core_PM', 'core_NxxD', 'core_YxxxP', 'core_DxxxY', 'core_HxY', 'core_LxL', 'core_HxxR', 'core_TxxxxxV', 'core_ExxxxxG', 'core_DxxxN', 'core_AxxxxT', 'core_SxxxxM', 'core_HxxxM', 'core_TxxxT', 'core_HF', 'core_WxxxK', 'core_QxxT', 'core_ExxxxG', 'core_PxxxD', 'core_NxR', 'core_FxxxK', 'core_PxxxW', 'core_AxxxxxL', 'core_YxxxY', 'core_TP', 'core_TN', 'core_PxA', 'core_TxY', 'core_VD', 'core_AxV', 'core_PxxxK', 'core_PxL', 'core_PA', 'core_ExI', 'core_CxxxY', 'core_WxH', 'core_GxS', 'core_GxxxxxQ', 'core_HxC', 'core_IxQ', 'core_KxxxA', 'core_RxxxxR', 'core_FxxxxF', 'core_AxxxP', 'core_TI', 'core_NxV', 'core_HxxxL', 'core_RN', 'core_PxxxxxK', 'core_YxxxA', 'core_GxxxxM', 'core_CxxxxF', 'core_AxxxxxK', 'core_GxxN', 'core_MxxV', 'core_HxxxxG', 'core_TxT', 'core_FxxF', 'core_GxxxF', 'core_MxxxxI', 'core_KxxC', 'core_RxxxxF', 'core_MxG', 'core_MD', 'core_NxE', 'core_RF', 'core_FxxxxxC', 'core_NxM', 'core_PxxxxA', 'core_PxxxC', 'core_VxxxL', 'core_MxxxG', 'core_VxxD', 'core_AxF', 'core_AxM', 'core_EG', 'core_AxxxT', 'core_IxxxxxR', 'core_RxxY', 'core_TxxxxxQ', 'core_MxxH', 'core_NxxN', 'core_PxxxR', 'core_QxxxK', 'core_SxxxH', 'core_WxxxxxS', 'core_IxxxM', 'core_EE', 'core_CxC', 'core_HR', 'core_VxxxA', 'core_QD', 'core_MS', 'core_PxxxxxE', 'core_AxxxxxV', 'core_DxxxxxE', 'core_WxxxxN', 'core_HQ', 'core_KK', 'core_TxxxI', 'core_PxxxxT', 'core_KxxxS', 'core_QxxE', 'core_NxxxC', 'core_TH', 'core_ExxxxM', 'core_QxxxxK', 'core_ExxxK', 'core_PxxxxR', 'core_SxxxG', 'core_LxxxxG', 'core_MxxxxxV', 'core_CxV', 'core_GxxxxxD', 'core_MxxW', 'core_QxxxxG', 'core_AxxxxxW', 'core_Q', 'core_WxxxL', 'core_LH', 'core_FxxV', 'core_QR', 'core_GL', 'core_TxxxxC', 'core_FP', 'core_SxxT', 'core_KxxxxxI', 'core_LxxxxxT', 'core_MxI', 'core_VxG', 'core_GxxxxxW', 'core_QxxxL', 'core_TxxxP', 'core_II', 'core_FH', 'core_WxR', 'core_ExxxN', 'core_FxxxI', 'core_NxxxxT', 'core_QxxR', 'core_VxK']
#        
#        
        for seq in core_seqs:
            regex = re.compile(seq[5:].replace("x", "."))
            scoring_csv_columns.append(len(regex.findall(self.core)))
            scoring_column_names.append(seq)
        core_pi = ProteinAnalysis(self.core).isoelectric_point()
        scoring_csv_columns.append(core_pi)
        scoring_column_names.append("core_pI")
        if 3 <= core_pi <= 9:
            self.score += 2
        
        if c_count >= 2:
            self.score += 4
            
        if self.leader[-2:] == "KRC":
            self.score += 2
        
        regex = re.compile("S..S...C")
        if len(regex.findall(self.leader)) > 0:
            self.score += 2
        regex = re.compile("S..S.{3,4}C")
        if len(regex.findall(self.leader)) > 0:
            self.score += 2
        
        scoring_csv_columns = [x for _, x in sorted(zip(scoring_column_names, scoring_csv_columns))]
        self.csv_columns += [self.score] + scoring_csv_columns
        
                
  
