COPASI API  4.16.103
Public Member Functions | Public Attributes | List of all members
CFunctionAnalyzer::Result::FunctionInformation Struct Reference

#include <CFunctionAnalyzer.h>

Collaboration diagram for CFunctionAnalyzer::Result::FunctionInformation:
Collaboration graph
[legend]

Public Member Functions

bool writeAnalysis (std::ostream &os, bool rt, bool reversible) const
 
void writeTable (std::ostream &os, bool rt) const
 

Public Attributes

std::vector< std::pair
< std::pair< size_t,
std::string >, std::vector
< CValue > > > 
mProductZero
 
std::vector< std::pair
< std::pair< size_t,
std::string >, std::vector
< CValue > > > 
mSubstrateZero
 
std::vector< CValuemUnchangedParameters
 

Detailed Description

This contains low level information about one function. The Result class contains three instances of this structure: For the complete function and for the forward and backwards part of a reversible function

Definition at line 150 of file CFunctionAnalyzer.h.

Member Function Documentation

bool CFunctionAnalyzer::Result::FunctionInformation::writeAnalysis ( std::ostream &  os,
bool  rt,
bool  reversible 
) const

This writes a (hopefully) user understandable interpretation of the results to os. The return value indicates if a problem was reported.

Definition at line 484 of file CFunctionAnalyzer.cpp.

References CFunctionAnalyzer::write().

485 {
486  bool ret = false;
487 
488  if (reversible) //reversible function
489  {
490  //unchanged values
491  assert(mUnchangedParameters.size() >= 2);
492 
493  //first for positive parameter values
494  if (!mUnchangedParameters[1].containsPositive())
495  {
496  os << write(1, rt, "The kinetic function cannot take positive values for positive parameter values.\n",
497  "This means the reaction will never proceed in the forward direction.");
498  ret = true;
499  }
500 
501  if (!mUnchangedParameters[1].containsZero())
502  {
503  os << write(1, rt, "The kinetic function never equals zero for positive parameter values.\n",
504  "This is unexpected for reversible reactions.");
505  ret = true;
506  }
507 
508  if (!mUnchangedParameters[1].containsNegative())
509  {
510  os << write(1, rt, "The kinetic function cannot take negative values for positive parameter values.\n",
511  "This means the reaction will never proceed in the backwards direction.");
512  ret = true;
513  }
514 
515  if (mUnchangedParameters[1].isInvalid())
516  {
517  os << write(2, rt, "The kinetic function is always invalid for positive parameter values.\n", "");
518  ret = true;
519  }
520  else if (mUnchangedParameters[1].containsInvalid())
521  {
522  os << write(1, rt, "The kinetic function can be invalid even if metabolite concentrations and parameter values are positive.\n", "");
523  ret = true;
524  }
525 
526  //now report if the result is different for the actual parameters values
527  if ((mUnchangedParameters.size() > 2) && (!(mUnchangedParameters[1] == mUnchangedParameters[2])))
528  {
529  if (!mUnchangedParameters[2].containsPositive())
530  {
531  os << write(1, rt, "The kinetic function cannot take positive values for the actual parameter values.\n",
532  "This means the reaction will never proceed in the forward direction.");
533  ret = true;
534  }
535 
536  if (!mUnchangedParameters[2].containsZero())
537  {
538  os << write(1, rt, "The kinetic function never equals zero for the actual parameter values.\n",
539  "This is unexpected for reversible reactions.");
540  ret = true;
541  }
542 
543  if (!mUnchangedParameters[2].containsNegative())
544  {
545  os << write(1, rt, "The kinetic function cannot take negative values for the actual parameter values.\n",
546  "This means the reaction will never proceed in the backwards direction.");
547  ret = true;
548  }
549 
550  if (mUnchangedParameters[2].isInvalid())
551  {
552  os << write(2, rt, "The kinetic function is always invalid for the actual parameter values.\n", "");
553  ret = true;
554  }
555  else if (mUnchangedParameters[2].containsInvalid())
556  {
557  os << write(1, rt, "The kinetic function can be invalid for the actual parameter values even if metabolite concentrations are positive.\n", "");
558  ret = true;
559  }
560  }
561 
562  size_t i, imax;
563 
564  // Substrate concentrations set to zero
565  imax = mSubstrateZero.size();
566 
567  for (i = 0; i < imax; ++i)
568  {
569  assert(mSubstrateZero[i].second.size() >= 2);
570 
571  //first for positive parameter values
572  if (mSubstrateZero[i].second[1].isNegative())
573  {
574  os << write(0, rt, "The kinetic function is always negative for positive parameter values if substrate \""
575  + mSubstrateZero[i].first.second // pF->getVariables()[mSubstrateZero[i].first]->getObjectName()
576  + "\" is set to zero.\n" ,
577  "This is the expected behaviour for reversible reactions. Without substrates the reaction can only proceed backwards.");
578  }
579  else if (mSubstrateZero[i].second[1].containsNegative())
580  {
581  os << write(1, rt, "Copasi could not show that the kinetic function is always negative for positive parameter values if substrate \""
582  + mSubstrateZero[i].first.second //pF->getVariables()[mSubstrateZero[i].first]->getObjectName()
583  + "\" is set to zero.\n" , "");
584  ret = true;
585  }
586  else
587  {
588  os << write(2, rt, "The kinetic function is never negative for positive parameter values if substrate \""
589  + mSubstrateZero[i].first.second //pF->getVariables()[mSubstrateZero[i].first]->getObjectName()
590  + "\" is set to zero.\n" ,
591  "This means the reaction never proceeds backwards even if no substrate is present. This is unexpected for a reversible reaction.");
592  ret = true;
593  }
594 
595  if (mSubstrateZero[i].second[1].isInvalid())
596  {
597  os << write(2, rt, "The kinetic function is always invalid for positive parameter values if substrate \""
598  + mSubstrateZero[i].first.second //pF->getVariables()[mSubstrateZero[i].first]->getObjectName()
599  + "\" is set to zero.\n" , "");
600  ret = true;
601  }
602  else if (mSubstrateZero[i].second[1].containsInvalid())
603  {
604  os << write(1, rt, "The kinetic function can be invalid for positive parameter values if substrate \""
605  + mSubstrateZero[i].first.second // pF->getVariables()[mSubstrateZero[i].first]->getObjectName()
606  + "\" is set to zero.\n" , "");
607  ret = true;
608  }
609 
610  //now report if the result is different for the actual parameters values
611  if ((mSubstrateZero[i].second.size() > 2) && (!(mSubstrateZero[i].second[1] == mSubstrateZero[i].second[2])))
612  {
613  if (mSubstrateZero[i].second[2].isNegative())
614  {
615  os << write(0, rt, "The kinetic function is always negative for the actual parameter values if substrate \""
616  + mSubstrateZero[i].first.second // pF->getVariables()[mSubstrateZero[i].first]->getObjectName()
617  + "\" is set to zero.\n" ,
618  "This is the expected behaviour for reversible reactions. Without substrates the reaction can only proceed backwards.");
619  }
620  else if (mSubstrateZero[i].second[2].containsNegative())
621  {
622  os << write(1, rt, "Copasi could not show that the kinetic function is always negative for the actual parameter values if substrate \""
623  + mSubstrateZero[i].first.second //pF->getVariables()[mSubstrateZero[i].first]->getObjectName()
624  + "\" is set to zero.\n" , "");
625  ret = true;
626  }
627  else
628  {
629  os << write(2, rt, "The kinetic function is never negative for the actual parameter values if substrate \""
630  + mSubstrateZero[i].first.second //pF->getVariables()[mSubstrateZero[i].first]->getObjectName()
631  + "\" is set to zero.\n" ,
632  "This means the reaction never proceeds backwards even if no substrate is present. This is unexpected for a reversible reaction.");
633  ret = true;
634  }
635 
636  if (mSubstrateZero[i].second[2].isInvalid())
637  {
638  os << write(2, rt, "The kinetic function is always invalid for the actual parameter values if substrate \""
639  + mSubstrateZero[i].first.second //pF->getVariables()[mSubstrateZero[i].first]->getObjectName()
640  + "\" is set to zero.\n" , "");
641  ret = true;
642  }
643  else if (mSubstrateZero[i].second[2].containsInvalid())
644  {
645  os << write(1, rt, "The kinetic function can be invalid for the actual parameter values if substrate \""
646  + mSubstrateZero[i].first.second //pF->getVariables()[mSubstrateZero[i].first]->getObjectName()
647  + "\" is set to zero.\n" , "");
648  ret = true;
649  }
650  }
651  } //loop over substrates that are set to zero
652 
653  // Product concentrations set to zero
654  imax = mProductZero.size();
655 
656  for (i = 0; i < imax; ++i)
657  {
658  assert(mProductZero[i].second.size() >= 2);
659 
660  //first for positive parameter values
661  if (mProductZero[i].second[1].isPositive())
662  {
663  os << write(0, rt, "The kinetic function is always positive for positive parameter values if product \""
664  + mProductZero[i].first.second // pF->getVariables()[mProductZero[i].first]->getObjectName()
665  + "\" is set to zero.\n" ,
666  "This is the expected behaviour for reversible reactions. With products absent the reaction can only proceed forward.");
667  }
668  else if (mProductZero[i].second[1].containsPositive())
669  {
670  os << write(1, rt, "Copasi could not show that the kinetic function is always positive for positive parameter values if product \""
671  + mProductZero[i].first.second //pF->getVariables()[mProductZero[i].first]->getObjectName()
672  + "\" is set to zero.\n" , "");
673  ret = true;
674  }
675  else
676  {
677  os << write(2, rt, "The kinetic function is never positive for positive parameter values if product \""
678  + mProductZero[i].first.second //pF->getVariables()[mProductZero[i].first]->getObjectName()
679  + "\" is set to zero.\n" ,
680  "This means the reaction never proceeds forward even if no product is present. This is unexpected for a reversible reaction.");
681  ret = true;
682  }
683 
684  if (mProductZero[i].second[1].isInvalid())
685  {
686  os << write(2, rt, "The kinetic function is always invalid for positive parameter values if product \""
687  + mProductZero[i].first.second //pF->getVariables()[mProductZero[i].first]->getObjectName()
688  + "\" is set to zero.\n" , "");
689  ret = true;
690  }
691  else if (mProductZero[i].second[1].containsInvalid())
692  {
693  os << write(1, rt, "The kinetic function can be invalid for positive parameter values if product \""
694  + mProductZero[i].first.second // pF->getVariables()[mProductZero[i].first]->getObjectName()
695  + "\" is set to zero.\n" , "");
696  ret = true;
697  }
698 
699  //now report if the result is different for the actual parameters values
700  if ((mProductZero[i].second.size() > 2) && (!(mProductZero[i].second[1] == mProductZero[i].second[2])))
701  {
702  if (mProductZero[i].second[2].isPositive())
703  {
704  os << write(0, rt, "The kinetic function is always positive for the actual parameter values if product \""
705  + mProductZero[i].first.second // pF->getVariables()[mProductZero[i].first]->getObjectName()
706  + "\" is set to zero.\n" ,
707  "This is the expected behaviour for reversible reactions. With products absent the reaction can only proceed forward.");
708  }
709  else if (mProductZero[i].second[2].containsPositive())
710  {
711  os << write(1, rt, "Copasi could not show that the kinetic function is always positive for the actual parameter values if product \""
712  + mProductZero[i].first.second //pF->getVariables()[mProductZero[i].first]->getObjectName()
713  + "\" is set to zero.\n" , "");
714  ret = true;
715  }
716  else
717  {
718  os << write(2, rt, "The kinetic function is never positive for the actual parameter values if product \""
719  + mProductZero[i].first.second //pF->getVariables()[mProductZero[i].first]->getObjectName()
720  + "\" is set to zero.\n" ,
721  "This means the reaction never proceeds forward even if no product is present. This is unexpected for a reversible reaction.");
722  ret = true;
723  }
724 
725  if (mProductZero[i].second[2].isInvalid())
726  {
727  os << write(2, rt, "The kinetic function is always invalid for the actual parameter values if substrate \""
728  + mProductZero[i].first.second //pF->getVariables()[mProductZero[i].first]->getObjectName()
729  + "\" is set to zero.\n" , "");
730  ret = true;
731  }
732  else if (mProductZero[i].second[2].containsInvalid())
733  {
734  os << write(1, rt, "The kinetic function can be invalid for the actual parameter values if substrate \""
735  + mProductZero[i].first.second //pF->getVariables()[mProductZero[i].first]->getObjectName()
736  + "\" is set to zero.\n" , "");
737  ret = true;
738  }
739  }
740  } //loop over products that are set to zero
741  }
742  else //irreversible function
743  {
744  //unchanged values
745  assert(mUnchangedParameters.size() >= 2);
746 
747  //first for positive parameter values
748  if (mUnchangedParameters[1].isPositive())
749  {
750  os << write(0, rt, "The kinetic function is positive for positive parameter values.\n", "");
751  }
752  else
753  {
754  os << write(1, rt, "Copasi could not show that the kinetic function is positive for positive parameter values.\n", "");
755  ret = true;
756  }
757 
758  if (mUnchangedParameters[1].isZero())
759  {
760  os << write(2, rt, "The kinetic function is always zero for positive parameter values.\n", "");
761  ret = true;
762  }
763  else if (mUnchangedParameters[1].containsZero())
764  {
765  os << write(1, rt, "The kinetic function can be zero even if substrate concentrations and parameter values are positive.\n", "");
766  ret = true;
767  }
768 
769  if (mUnchangedParameters[1].isNegative())
770  {
771  os << write(2, rt, "The kinetic function is always negative for positive parameter values.\n", "");
772  ret = true;
773  }
774  else if (mUnchangedParameters[1].containsNegative())
775  {
776  os << write(1, rt, "The kinetic function can be negative even if substrate concentrations and parameter values are positive.\n", "");
777  ret = true;
778  }
779 
780  if (mUnchangedParameters[1].isInvalid())
781  {
782  os << write(2, rt, "The kinetic function is always invalid for positive parameter values.\n", "");
783  ret = true;
784  }
785  else if (mUnchangedParameters[1].containsInvalid())
786  {
787  os << write(1, rt, "The kinetic function can be invalid even if substrate concentrations and parameter values are positive.\n", "");
788  ret = true;
789  }
790 
791  //now report if the result is different for the actual parameters values
792  if ((mUnchangedParameters.size() > 2) && (!(mUnchangedParameters[1] == mUnchangedParameters[2])))
793  {
794  if (mUnchangedParameters[2].isPositive())
795  {
796  os << write(0, rt, "The kinetic function is positive for the actual parameter values.\n", "");
797  }
798  else
799  {
800  os << write(1, rt, "Copasi could not show that the kinetic function is positive for the actual parameter values.\n", "");
801  ret = true;
802  }
803 
804  if (mUnchangedParameters[2].isZero())
805  {
806  os << write(2, rt, "The kinetic function is always zero for the actual parameter values.\n", "");
807  ret = true;
808  }
809  else if (mUnchangedParameters[2].containsZero())
810  {
811  os << write(1, rt, "The kinetic function can be zero for the actual parameter values even if substrate concentrations are positive.\n", "");
812  ret = true;
813  }
814 
815  if (mUnchangedParameters[2].isNegative())
816  {
817  os << write(2, rt, "The kinetic function is always negative for the actual parameter values.\n", "");
818  ret = true;
819  }
820  else if (mUnchangedParameters[2].containsNegative())
821  {
822  os << write(1, rt, "The kinetic function can be negative for the actual parameter values even if substrate concentrations are positive.\n", "");
823  ret = true;
824  }
825 
826  if (mUnchangedParameters[2].isInvalid())
827  {
828  os << write(2, rt, "The kinetic function is always invalid for the actual parameter values.\n", "");
829  ret = true;
830  }
831  else if (mUnchangedParameters[2].containsInvalid())
832  {
833  os << write(1, rt, "The kinetic function can be invalid for the actual parameter values even if substrate concentrations are positive.\n", "");
834  ret = true;
835  }
836  }
837 
838  size_t i, imax;
839 
840  // Substrate concentrations set to zero
841  imax = mSubstrateZero.size();
842 
843  for (i = 0; i < imax; ++i)
844  {
845  assert(mSubstrateZero[i].second.size() >= 2);
846 
847  //first for positive parameter values
848  if (mSubstrateZero[i].second[1].isZero())
849  {
850  os << write(0, rt, "The kinetic function is always zero for positive parameter values if substrate \""
851  + mSubstrateZero[i].first.second // pF->getVariables()[mSubstrateZero[i].first]->getObjectName()
852  + "\" is set to zero.\n" , "");
853  }
854  else if (mSubstrateZero[i].second[1].containsZero())
855  {
856  os << write(1, rt, "Copasi could not show that the kinetic function is always zero for positive parameter values if substrate \""
857  + mSubstrateZero[i].first.second //pF->getVariables()[mSubstrateZero[i].first]->getObjectName()
858  + "\" is set to zero.\n" , "");
859  ret = true;
860  }
861  else
862  {
863  os << write(2, rt, "The kinetic function is never zero for positive parameter values if substrate \""
864  + mSubstrateZero[i].first.second //pF->getVariables()[mSubstrateZero[i].first]->getObjectName()
865  + "\" is set to zero.\n" , "");
866  ret = true;
867  }
868 
869  if (mSubstrateZero[i].second[1].isInvalid())
870  {
871  os << write(2, rt, "The kinetic function is always invalid for positive parameter values if substrate \""
872  + mSubstrateZero[i].first.second //pF->getVariables()[mSubstrateZero[i].first]->getObjectName()
873  + "\" is set to zero.\n" , "");
874  ret = true;
875  }
876  else if (mSubstrateZero[i].second[1].containsInvalid())
877  {
878  os << write(1, rt, "The kinetic function can be invalid for positive parameter values if substrate \""
879  + mSubstrateZero[i].first.second // pF->getVariables()[mSubstrateZero[i].first]->getObjectName()
880  + "\" is set to zero.\n" , "");
881  ret = true;
882  }
883 
884  //now report if the result is different for the actual parameters values
885  if ((mSubstrateZero[i].second.size() > 2) && (!(mSubstrateZero[i].second[1] == mSubstrateZero[i].second[2])))
886  {
887  if (mSubstrateZero[i].second[2].isZero())
888  {
889  os << write(0, rt, "The kinetic function is always zero for the actual parameter values if substrate \""
890  + mSubstrateZero[i].first.second //pF->getVariables()[mSubstrateZero[i].first]->getObjectName()
891  + "\" is set to zero.\n" , "");
892  }
893  else if (mSubstrateZero[i].second[2].containsZero())
894  {
895  os << write(1, rt, "Copasi could not show that the kinetic function is always zero for the actual parameter values if substrate \""
896  + mSubstrateZero[i].first.second //pF->getVariables()[mSubstrateZero[i].first]->getObjectName()
897  + "\" is set to zero.\n" , "");
898  ret = true;
899  }
900  else
901  {
902  os << write(2, rt, "The kinetic function is never zero for the actual parameter values if substrate \""
903  + mSubstrateZero[i].first.second //pF->getVariables()[mSubstrateZero[i].first]->getObjectName()
904  + "\" is set to zero.\n" , "");
905  ret = true;
906  }
907 
908  if (mSubstrateZero[i].second[2].isInvalid())
909  {
910  os << write(2, rt, "The kinetic function is always invalid for the actual parameter values if substrate \""
911  + mSubstrateZero[i].first.second //pF->getVariables()[mSubstrateZero[i].first]->getObjectName()
912  + "\" is set to zero.\n" , "");
913  ret = true;
914  }
915  else if (mSubstrateZero[i].second[2].containsInvalid())
916  {
917  os << write(1, rt, "The kinetic function can be invalid for the actual parameter values if substrate \""
918  + mSubstrateZero[i].first.second //pF->getVariables()[mSubstrateZero[i].first]->getObjectName()
919  + "\" is set to zero.\n" , "");
920  ret = true;
921  }
922  }
923  } //loop over substrates that are set to zero
924  } //irreversible
925 
926  //mUnchangedParameters
927  //mSubstrateZero
928  //mProductZero
929 
930  return ret;
931 }
std::vector< std::pair< std::pair< size_t, std::string >, std::vector< CValue > > > mProductZero
static std::string write(int level, bool rt, const std::string &text, const std::string &longText)
std::vector< std::pair< std::pair< size_t, std::string >, std::vector< CValue > > > mSubstrateZero
void CFunctionAnalyzer::Result::FunctionInformation::writeTable ( std::ostream &  os,
bool  rt 
) const

Definition at line 933 of file CFunctionAnalyzer.cpp.

934 {
935  //if (!pF) return;
936 
937  size_t i, imax;
938 
939  if (rt)
940  {
941  os << "<font color=\"#505080\"><TABLE>\n";
942 
943  os << " <TR>\n";
944  os << " <TD></TD>\n";
945  //CValue results
946  size_t j, jmax = mUnchangedParameters.size();
947 
948  for (j = 0; j < jmax; ++j)
949  os << " <TD>" << mUnchangedParameters[j] << "</TD>\n";
950 
951  os << " </TR>\n";
952 
953  imax = mSubstrateZero.size();
954 
955  for (i = 0; i < imax; ++i)
956  {
957  os << " <TR>\n";
958  //parameter name
959  os << " <TD>Substrate \"" << mSubstrateZero[i].first.second /*pF->getVariables()[mSubstrateZero[i].first]->getObjectName()*/ << "\" set to 0:</TD>\n";
960 
961  //CValue results
962  size_t j, jmax = mSubstrateZero[i].second.size();
963 
964  for (j = 0; j < jmax; ++j)
965  os << " <TD>" << mSubstrateZero[i].second[j] << "</TD>\n";
966 
967  os << " </TR>\n";
968  }
969 
970  imax = mProductZero.size();
971 
972  for (i = 0; i < imax; ++i)
973  {
974  os << " <TR>\n";
975  //parameter name
976  os << " <TD>Product \"" << mProductZero[i].first.second << "\" set to 0: </TD>\n";
977 
978  //CValue results
979  size_t j, jmax = mProductZero[i].second.size();
980 
981  for (j = 0; j < jmax; ++j)
982  os << " <TD>" << mProductZero[i].second[j] << "</TD>\n";
983 
984  os << " </TR>\n";
985  }
986 
987  os << "</TABLE></font>\n";
988  }
989 }
std::vector< std::pair< std::pair< size_t, std::string >, std::vector< CValue > > > mProductZero
std::vector< std::pair< std::pair< size_t, std::string >, std::vector< CValue > > > mSubstrateZero

Member Data Documentation

std::vector<std::pair<std::pair<size_t, std::string>, std::vector<CValue> > > CFunctionAnalyzer::Result::FunctionInformation::mProductZero

Definition at line 154 of file CFunctionAnalyzer.h.

Referenced by CFunctionAnalyzer::checkKineticFunction().

std::vector<std::pair<std::pair<size_t, std::string>, std::vector<CValue> > > CFunctionAnalyzer::Result::FunctionInformation::mSubstrateZero

Definition at line 153 of file CFunctionAnalyzer.h.

Referenced by CFunctionAnalyzer::checkKineticFunction().

std::vector<CValue> CFunctionAnalyzer::Result::FunctionInformation::mUnchangedParameters

Definition at line 152 of file CFunctionAnalyzer.h.

Referenced by CFunctionAnalyzer::checkKineticFunction().


The documentation for this struct was generated from the following files: