

claLength(startNode,0):-!.
claLength(endNode-EITIs,0):-!.
claLength(ClaID,ClaDescriptionLength):-
	ClaID=[rs-{ReactionID,LimitingType,HypothesizedState,Time}],
	scoreByGEData({ReactionID,LimitingType,HypothesizedState,Time},Score_GE),
% scale by earlier or later time point
% scale by different mutant type

	ClaDescriptionLength=Score_GE.


% no degree, but simply agree or not
% agree -- no description score%enzymlimiting,cataIncreased,
% not agree -- 2
% not annotated or not measured -- 1

% when enzyme limiting, it is the same as before
scoreByGEData({ReactionID,enzymeLimiting,HypothesizedState,Time},Score_GE):-
	catalyzed_by_ECclass(ReactionID,EC_Number),
	Time=DoseTime, %timeEquivenlent(Time,DoseTime),
	concentration_e(EC_Number,GEChange,Degree,DoseTime),!, 				%concentration_enzClass(EC_Number,GEChange,Time),
	(proportional(HypothesizedState,GEChange)->
			Score_GE=1; %write('Yes, agreed'),nl;  
			Score_GE=3 %,write('No, disagreed'),nl
		). 									%,geChangeDegree(EC_Number,GEChange,ChangeDegree,Time),
		% Score_GE is Score_GE0 * ChangeDegree;


scoreByGEData({ReactionID,substrateLimiting,HypothesizedState,Time},Score_GE):-
	catalyzed_by_ECclass(ReactionID,EC_Number),
	Time=DoseTime, %timeEquivenlent(Time,DoseTime),
	concentration_e(EC_Number,GEChange,Degree,DoseTime),!,
	(nonContradict(HypothesizedState,GEChange)->
			Score_GE=1; %write('Yes, agreed'),nl;  
			Score_GE=3 %,write('No, disagreed'),nl
		). 

/*scoreByGEData({ReactionID,substrateLimiting,HypothesizedState,Time},Score_GE):-
	catalyzed_by_ECclass(ReactionID,EC_Number),
	concentration_e(EC_Number,GEChange,Degree,Time),!, 				%concentration_enzClass(EC_Number,GEChange,Time),
	(nonContradict(HypothesizedState,GEChange)->
			Score_GE=0; %write('Yes, agreed'),nl;  
			Score_GE=100 %,write('No, disagreed'),nl
		).  
*/	


scoreByGEData({ReactionID,LimitingType,HypothesizedState,Time},2).

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


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




% alternatives: put those non-anotated, non-measured at the beginning. No, in that way, you have to ca



% including degree -- but normalize first



%*** have a measurement of the default accuracy
%*** how to put the default assumption??? : if no hypothesized, then substrateLimiting -- *** rather than enzyme limiting which will lead to contradiction. 

