Ordered promoters

Added code to check order of tandem promoters, so that the roadblocking effect is in the correct promoter
This commit is contained in:
Pedro Fontanarrosa 2020-01-18 19:13:00 -03:00
parent e0b7c2a22f
commit 7c2074fbfb
2 changed files with 28 additions and 5 deletions

View file

@ -36,6 +36,7 @@ import org.sbolstandard.core2.RefinementType;
import org.sbolstandard.core2.SBOLConversionException;
import org.sbolstandard.core2.SBOLDocument;
import org.sbolstandard.core2.SBOLValidationException;
import org.sbolstandard.core2.SequenceConstraint;
import org.sbolstandard.core2.SequenceOntology;
import org.sbolstandard.core2.SystemsBiologyOntology;
import org.sbolstandard.core2.Measure;
@ -1019,6 +1020,24 @@ public class CelloModeling {
}
}
//Check if there are two tandem promoters. If there are, then list them in order to have the method createCelloSDProductionReactions create roadblocking effects.
List<String> ordered_promoters = new ArrayList<>();
if (promoterCnt == 2) {
if (promoter.getDefinition() != null) {
ComponentDefinition tuCD = promoter.getDefinition();
for (SequenceConstraint SC : tuCD.getSequenceConstraints()) {
if (SC.getRestriction().toString().equals("precedes")) {
ComponentDefinition object = SC.getObjectDefinition();
ComponentDefinition subject = SC.getSubjectDefinition();
if (object.getRoles().contains(SequenceOntology.PROMOTER) || object.getRoles().contains(SequenceOntology.OPERATOR) && subject.getRoles().contains(SequenceOntology.PROMOTER) || subject.getRoles().contains(SequenceOntology.OPERATOR)){
ordered_promoters.add(SBOL2SBML.getDisplayID(subject));
ordered_promoters.add(SBOL2SBML.getDisplayID(object));
}
}
}
}
}
// each promoter will have a set of interactions
List<String> promoters = new ArrayList<>();
for (int i = 0; i < promoterCnt; i++) {
@ -1102,7 +1121,7 @@ public class CelloModeling {
}
}
//Update the Kinetic Law using the Hamid's Paper for dynamic modeling using Cello Parameters.
SDproductionRxn.getKineticLaw().setMath(SBMLutilities.myParseFormula(BioModel.createCelloProductionKineticLaw(SDproductionRxn, celloParameters, promoterInteractions, promoters)));
SDproductionRxn.getKineticLaw().setMath(SBMLutilities.myParseFormula(BioModel.createCelloProductionKineticLaw(SDproductionRxn, celloParameters, promoterInteractions, promoters, ordered_promoters)));
//TFproductionRxn.getKineticLaw().setMath(SBMLutilities.myParseFormula(BioModel.createProductionKineticLaw(TFproductionRxn)));
TFproductionRxn.getKineticLaw().setMath(SBMLutilities.myParseFormula("kdegrad*"+mRNA.getId()));

View file

@ -2307,12 +2307,16 @@ public class BioModel extends CoreObservable{
* @return the string
*/
//TODO PEDRO createCelloProductionKineticLaw
public static String createCelloProductionKineticLaw(Reaction reaction, HashMap<String, List<String>> celloParameters, HashMap<String, HashMap <String, String>> promoterInteractions, List <String> promoters) {
public static String createCelloProductionKineticLaw(Reaction reaction, HashMap<String, List<String>> celloParameters, HashMap<String, HashMap <String, String>> promoterInteractions, List <String> promoters, List<String> ordered_promoters) {
String kineticLaw = "";
//boolean activated = false;
String promoter = "";
int promoterCnt = 0;
if(ordered_promoters.size() == 2) {
promoters = ordered_promoters;
}
for (Object it : promoters.toArray()) {
promoter = it.toString();
promoterCnt++;
@ -2406,7 +2410,7 @@ public class BioModel extends CoreObservable{
in_parentesis = "(" + numerator + "/(" + denominator + ") +" + ymin + ")";
// This adds roadblocking effects if this promoter is the downstream one of tandem promoters.
if(promoters.toArray().length == 2 && promoterCnt == 2) {
if(ordered_promoters.get(1).equals(promoter)) {
String top = "";
String bottom = "";
@ -2496,7 +2500,7 @@ public class BioModel extends CoreObservable{
in_parentesis = "(" + numerator + "/(" + denominator + ") +" + ymin + ")";
// This adds roadblocking effects if this promoter is the downstream one of tandem promoters.
if(promoters.toArray().length == 2 && promoterCnt == 2) {
if(ordered_promoters.get(1).equals(promoter)) {
String top = "";
String bottom = "";
@ -2559,7 +2563,7 @@ public class BioModel extends CoreObservable{
in_parentesis = "(" + numerator + ")";
// This adds roadblocking effects if this promoter is the downstream one of tandem promoters.
if(promoters.toArray().length == 2 && promoterCnt == 2) {
if(ordered_promoters.get(1).equals(promoter)) {
String roadblock = "";
String delta_function = "";