# Contains rules for well defined clusters, containing all expected functional parts

# Cutoffs and neighbourhoods are given in kilobases

RULE hydroxybenzoate2phenol
    COMMENT HadBCD operon, hydroxybenzoate to phenol
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS Flavoprotein and Phea_decarb and not ubi_syn

RULE pdu
    COMMENT propanediol degradation pathway
    CUTOFF 20
    NEIGHBOURHOOD 10
    CONDITIONS minimum(2, [BMC, PduV-EutP, PTAC, Aldedh, PDU_like, EutN_CcmL, Cob_adeno_trans, Fe-ADH, Fe-ADH_2]) and  Dehydratase_MU and Dehydratase_SU and Dehydratase_LU

RULE EUT_pathway
    COMMENT ethanolamine degradation pathway
    CUTOFF 20
    NEIGHBOURHOOD 10
    CONDITIONS minimum(3, [EutK_C, BMC, EutA, EutH, Fe-ADH, Fe-ADH_2, MreB_Mbl, Aldedh, EutN_CcmL, Cob_adeno_trans, EutQ, PduV-EutP, PTA_PTB, malic, Malic_M]) and EutB and EutC

RULE TMA
    COMMENT trimethylamine synthesis
    CUTOFF 20
    NEIGHBOURHOOD 10
    CONDITIONS minimum(2, [PduV-EutP, Radical_SAM, BMC, Aldedh])
               and PFL_9_tma and Gly_8-9_TMA and not NRDD #specific hmms have been built: Radical SAM, Glycine radical and Aldehyde dehydrogenase

RULE p-cresol
    COMMENT p-cresol synthesis or HpdBCA operon
    CUTOFF 2
    NEIGHBOURHOOD 10
    CONDITIONS  PFL_6_pcresol and (Gly_430_pcre or Gly_radical) and hpdC and Radical_SAM and not NRDD #Gly_430_pcre is a pHMM specifically built to cature glycine radical involved in this pathway

RULE Arginine2_Hcarbonate
    COMMENT Arginine to hydrogene carbonate pathway
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS Amidinotransf and OTCace and OTCace_N and AA_kinase ##Arginine to hydrogene carbonate pathway

RULE Arginine2putrescine
    COMMENT putative arginine degradation pathway arginine to putrescine
    SUPERIORS Arginine2_Hcarbonate
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS (minimum(3, [Arginase, Amidinotransf, OKR_DC_1_7_arginine, OKR_DC_1, OTCace, AdoMet_dc])) or ((OKR_DC_1_5_ornithine or OKR_DC_1 or Orn_Arg_deC_N) and minimum(1, [PAD_porph, OTCace, OTCace_N, Arginase]))

RULE Putrescine2spermidine
    COMMENT putrescine to spermidine subpathways
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS minimum(2, [Spermine_synth, Spermine_synt_N, AdoMet_dc]) or (Orn_DAP_Arg_deC  and Sacchrp_dh_C)

RULE proline2aminovalerate
    COMMENT proline to aminovalerate pathway
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS Proline_reductase and (Pro_racemase or GRDB) and not ACP_syn_III_C ##ACP_syn_III_C belongs to the gly reductase pathway
    
RULE Leucine_reduction
    COMMENT Leucine reductive branch
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS minimum(3, [Lactoyl-CoA1, Lactoyl-CoA2, Hacid_dh_C, HCDH, Acyl-CoA_dh_1, Acyl-CoA_dh_2, AdoHcyase_NAD, AlaDh_PNT_C, BcrAD_BadFG, CoA_transf_3, ETF, ETF_alpha, FGGY_C, MreB_Mbl, NAD_binding_2, Peptidase_M22, UDPG_MGDP_dh_N])
               and  minimum(1, [HleuD1, HleuD2, HleuS1, HleuS2]) # 2 specific pHMMS that define 2-hydroxyglutaryl-CoA dehydratase are required (from C. sporogenes or difficile)

RULE gallic_acid_met
    COMMENT Gallic acid metabolism
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS minimum(1, [Flavoprotein, Semialdhyde_dh]) and gallic_acid #specific UbiD protein domain involved in gallic acid metabolism is required (sometimes is not clustered)

RULE bai_operon
    COMMENT From primary to secondary bile acids  via bai operon
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS (minimum(2, [AMP-binding, adh_short, adh_short_C2, KR, CoA_transf_3, Pyr_redox, NAD_binding_8, FAD_oxidored, FAD_binding_2]) and baiH and baiCD) or (minimum(3, [Dala_Dala_lig_C, Dala_Dala_lig_N, CPSase_L_D2, ATP-grasp_4, ATP-grasp_3, GARS_A, Acyltransferase, AMP-binding, adh_short, adh_short_C2, KR, CoA_transf_3, Pyr_redox, NAD_binding_8, FAD_oxidored, FAD_binding_2, LysM, GHMP_kinases_C, GHMP_kinases_N]) and baiH and baiCD)

RULE acetate2butyrate
    COMMENT Acetate to butyrate pathway
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS not (POR or POR_N or PFOR_II) and minimum(4, [HCDH_N, ECH_2, Thiolase_N, ketoacyl-synt, Acyl-CoA_dh_1, Acyl-CoA_dh_2, ETF, ETF_alpha]) and HCDH and minimum(1, [Thiolase_C, EC1_2-faecali, ECH1_Enoyl_CoA_DH1, ECH1_Enoyl_CoA_DH2, ECH1_Enoyl_CoA_DH3, ECH1_Enoyl_CoA_DH4])

RULE AAA_reductive_branch
    COMMENT Aromatic amino acid reductive branch
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS minimum(4, [BcrAD_BadFG, HCDH, ACP_syn_III, ACP_syn_III_C, Acyl-CoA_dh_1, Acyl-CoA_dh_2, HCDH_N, Hacid_dh_C, Hacid_dh, AlaDh_PNT_C, IlvN, ECH_1, ECH_2, ETF, ETF_alpha, NAD_Gly3P_dh_N, Thiolase_C, Thiolase_N, ketoacyl-synt]) and HAAA1 and not HleuS1

RULE porA
    COMMENT porA metabolism: Val,Ile,Leu,Tyr, Phe to phenylacetate 
    CUTOFF 5
    NEIGHBOURHOOD 10
    CONDITIONS Fer4_7 and TPP_enzyme_C and POR and POR_N and PFOR_II and not (EKR or Fer4_16)

RULE PFOR_II_pathway
    COMMENT pyruvate to acetate 
    SUPERIORS porA
    CUTOFF 5
    NEIGHBOURHOOD 10
    CONDITIONS cds(POR and POR_N and PFOR_II and EKR and Fer4_16 and TPP_enzyme_C)

RULE Lysine_degradation
    COMMENT Lysine degradation pathway (to butyrate)
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS minimum(1, [HBT, AcetylCoA_hydro, Lys-AminoMut_A, CoA_trans]) and BKACE and LAM_C and Radical_SAM and B12-binding and OAM_dimer

RULE glutamate2butyric
    COMMENT glutamate to butyric acid pathway
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS minimum(3, [OAD_gamma, Biotin_lipoyl, Peptidase_M23, OAD_beta, CoA_trans, CoA_trans_6_Glutaconate, AcetylCoA_hydro, Carboxyl_trans]) and BcrAD_BadFG and HG2B1 and HG2B2

RULE caffeate_respiration
    COMMENT caffeate respiration
    SUPERIORS acetate2butyrate
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS minimum(1, [Acyl-CoA_dh_2, Acyl-CoA_dh_M, HpaB_N, HpaB]) and CoA_trans_2_CAF and Acyl-CoA_dh_1 #specific CoA_transferase for caffeate respiration is required

RULE carnitine_degradaion_caiTABCDE
    COMMENT carnitine degradation via caiTABCDE operon
    CUTOFF 15
    NEIGHBOURHOOD 10
    CONDITIONS minimum(4, [BCCT, CoA_transf_3, AMP-binding, ECH_2, Hexapep, Hexapep_2, Acyl-CoA_dh_1, Acyl-CoA_dh_2, ACD1_car]) and Hexapep and ECH1_8_CARC #specific ECH_1 for carnitine met is required

RULE aminobutyrate2Butyrate
    COMMENT butyrate synthesis from (4)aminobutyrate
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS minimum(2, [Mal_decarbox_Al, AcetylCoA_hyd_C, AcetylCoA_hydro, Fe-ADH, Fe-ADH_2, HBT]) and cds(HpaB_N and HpaB) and not (LAM_C or BKACE) #either from 4-hydroxybutyrate or via crotonoyl-CoA, LAM_C to differentiate from aminobutyrate2Butyrate

RULE succinate2propionate
    COMMENT succinate to propionate pathway from B.theta
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS  minimum(4, [OAD_beta, Biotin_lipoyl, OAD_gamma, Glyoxalase_4, MeaB, B12-binding, MM_CoA_mutase, AcetylCoA_hydro, AcetylCoA_hyd_C, HMGL-like, PYC_OADA]) and minimum(1, [CT_Vparvula, CT_Btheta, CT_Propionyl_CoA1, CT_Propionyl_CoA2, CT_Propionyl_CoA3]) and not Cytidylate_kin

RULE acrylate2propionate
    COMMENT acrylate to propionate pathway
    SUPERIORS AAA_reductive_branch, Leucine_reduction
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS minimum(2, [CoA_trans, CoA_trans_230_acto, Mal_decarbox_Al, BcrAD_BadFG, AcetylCoA_hyd_C]) and Lactoyl-CoA2 and Lactoyl-CoA1 #(Lactoyl-CoA2 or Lactoyl-CoA1) #complete pathway or just the pHMMs specific to the Lactoyl-CoA transferase (markers)

RULE Threonine2propionate
    COMMENT Threonine to propionate pathway via tdcABCDEFG operon
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS minimum(3, [SDH_alpha, SDH_beta, MmgE_PrpD, Acetate_kinase, Butyrate_kinase, Trp_Tyr_perm, PALP]) and (PFL-like or PFL_acetate2 or PFL_acetate1) and Gly_radical and not NRDD

RULE Pyruvate2acetate-formate
    COMMENT pryuvate to acetate and formate
    SUPERIORS Threonine2propionate
    CUTOFF 2
    NEIGHBOURHOOD 10
    CONDITIONS (PFL_acetate1 or PFL_acetate2) and Radical_SAM

RULE Glycine_reductase
    COMMENT Glycine reductase, from glycine to ammonia and acetyl-P
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS minimum(3, [ACP_syn_III_C, GRDB, GRDA, ACP_syn_III, FA_synthesis]) and Glycine_reductase and not Pro_racemase #Pro_racemase belongs to the proline2aminovalerate cluster

RULE Glycine_cleavage
	COMMENT glycine cleavage into ammonia and methylene-folate
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS minimum(2, [GCV_T, SoxG, GCV_H, GDC-P, Aminotran_5]) and GCV_H and GCV_T_C

RULE histidine2glutamate_hutHGIU_operon
    COMMENT Histidine to glutamate via hutHGIU operon
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS minimum(3, [Arginase, Urocanase, Amidohydro_3, Amidohydro_1, FGase]) and Lyase_aromatic and Urocanase_C

RULE Oxidative_glycerol
    COMMENT Glycerol degradation to glycerone phosphate
    CUTOFF 20
    NEIGHBOURHOOD 10
    CONDITIONS (Fe-ADH or Fe-ADH_2) and Dak1 and Dak2

RULE Acetyl-CoA_pathway
    COMMENT Acetate formation from CO2 and H2
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS CdhC and CdhD and minimum(8, [Prismane, FTHFS, FTCD_C, THF_DHG_CYH, THF_DHG_CYH_C, MTHFR_C, MTHFR, Pyr_redox_2, Pyr_redox_dim, CbiA, FeS, Pterin_bind, GCV_H, Fer2, RACo_C_ter])

RULE Fumarate2succinate
    COMMENT fumarate to succinate
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS Succ_DH_flav_C and FAD_binding_2 and (Fer2_3 or Fer4_7 or SucD_FumR)

RULE Indoleacetate2scatole
    COMMENT Scatole formation from indoleacetate
    CUTOFF 2
    NEIGHBOURHOOD 10
    CONDITIONS PFL-like and Gly_radical_scatole and minimum(1, [MFS_1, Radical_SAM, TPR_12])
        
RULE Phenylacetate2toluene
    COMMENT toluene formation from phenylacetate
    CUTOFF 2
    NEIGHBOURHOOD 10
    CONDITIONS PFL_toluene and minimum(1, [Gly_430_pcre, Gly_radical, Radical_SAM])

RULE Hydroxy-L-proline2proline
    COMMENT proline formation from hydroxy-L-proline
    CUTOFF 2
    NEIGHBOURHOOD 10
    CONDITIONS (PFL_proline or cds(PFL-like and Gly_radical)) and Radical_SAM and P5CR_dimer and F420_oxidored

RULE Sulfate2sulfide
    COMMENT sulfate to sulfide reaction
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS DsrD and (NIR_SIR_ferr or NIR_SIR)

RULE Rnf_complex
    COMMENT Fdred and NAD converstion to Fdox and NADH
    CUTOFF 2
    NEIGHBOURHOOD 10
    CONDITIONS Complex1_51K and minimum(5, [RnfC_N, SLBB, Fer4_9, NQR2_RnfD_RnfE, FMN_bind, Rnf-Nqr, FeS, Fer4])

RULE Molybdopterin_dependent_oxidoreductase
    COMMENT from DMSO to dimethylsulfide or TMAO to TMA or Tetrathionite reductase
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS (DmsC and Molybdopterin and minimum(2, [Molybdop_Fe4S4, Fer4_11, Fer4_4, Molydop_binding])) or (NrfD and Molybdopterin and minimum(2, [Molybdop_Fe4S4, Fer4_11, Molydop_binding]) and not (Nitr_red_bet_C or Nitrate_red_del))

RULE Nitrate_reductase
    COMMENT Nitrate to nitrite
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS Nitr_red_bet_C and Nitrate_red_del and Nitrate_red_gam and Molybdopterin and minimum(2, [Nitr_red_alph_N, Molybdopterin, Molydop_binding, Fer4_11])

RULE Ech_complex
    COMMENT Fdred to Fdox 
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS NADHdh and Oxidored_q6 and Complex1_30kDa and Complex1_49kDa and Proton_antipo_M and Proton_antipo_N and not (Oxidored_q4 or Oxidored_q3 or Molybdopterin or Molydop_binding)

RULE Formate_dehydrogenase
    COMMENT formate to CO2 and H
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS Molybdopterin and Form-deh_trans and not (Nitr_red_bet_C or Nitr_red_alph_N) and minimum(3, [Ni_hydr_CYTB, Fer4_11, Fer4_4, Molydop_binding, Molybdop_Fe4S4])

RULE Respiratory_glycerol
    COMMENT Glycerol-3-P dehydrogenase
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS DAO and Fer2_BFD and FAD_binding_2 and Fer4_8

RULE NADH_dehydrogenase_I
    COMMENT NADH and ubiquinone to NAD and ubiquinol
    CUTOFF 10
    NEIGHBOURHOOD 10
    CONDITIONS (Oxidored_q4 and Oxidored_q6 and Complex1_30kDa and Complex1_49kDa and NADHdh and Oxidored_q3 and Oxidored_q2 and minimum(4, [Fe-2S_thioredx, Fer2_4, Fer4_7, Molybdop_Fe4S4, Molydop_binding, NADH-G_4Fe-4S_3, NADH_4Fe-4S, Proton_antipo_M, Proton_antipo_N, SLBB]))
