


claLength(startNode,ClaEICoverage,0):-!.
claLength(endNode-EITIs,ClaEICoverage,0):-!.
claLength(ClaID,ClaEICoverage,ClaDescriptionLength):-
	claLength(ClaID,ClaDescriptionLength).


claLength([rs-{ReactionID,substrateLimiting,HypothesizedState,Time}],Score):- 
	!,scoreSubstrateLimiting(ReactionID,substrateLimiting,HypothesizedState,Time,Score).
scoreSubstrateLimiting(reversed-ReactionID,substrateLimiting,HypothesizedState,Time,Score):-
	!,scoreSubstrateLimiting0(ReactionID,substrateLimiting,HypothesizedState,Time,Score0),Score is Score0*2.
scoreSubstrateLimiting(ReactionID,substrateLimiting,HypothesizedState,Time,Score):-
	scoreSubstrateLimiting0(ReactionID,substrateLimiting,HypothesizedState,Time,Score).


scoreSubstrateLimiting0(ReactionID,substrateLimiting,HypothesizedState,Time,Score):-
      	catalyzed_by_ECclass(ReactionID,EC_Number),
	concentration_e(EC_Number,GEChange,Degree,Time),!,
	(GEChange == 'noChange'->
		Score=5; % do nothing and pass
		Score=1
	).
scoreSubstrateLimiting0(ReactionID,substrateLimiting,HypothesizedState,Time,Score):- Score=3.

claLength([rs-{reversed-ReactionID,enzymeLimiting,HypothesizedState,Time}],20):-!.
claLength([rs-{ReactionID,enzymeLimiting,HypothesizedState,Time}],10).
claLength([met-{MID,Change,Time}],1).



proportional(cataIncreased,up).
proportional(cataDecreased,down).
proportional(cataNoChange,noChange).


nonContradict(sUp,GEChange):- GEChange\==down.
nonContradict(sDown,GEChange):- GEChange\==up.
nonContradict(sNoChange,GEChange):- GEChange=='noChange'.

