createCelloProductionKineticLaw modifitaction

Modified the method to be able to assign parameters for k, n, ymax, ymin
from the Cello parameters and promoter interaction lists

pom.xml

Changed VPR version from .12 to .14

productionInteractions

added method that makes a map of promoters, if they are repressed or
activated, and by which protein

hasCelloParameters2

added new method that searches all sbol document, and creates a list
with all components and their Cello parameters, if they exist
This commit is contained in:
Pedro Fontanarrosa 2018-11-26 12:01:41 -07:00
parent aa5efc7bf3
commit 56cc0cfd61
2 changed files with 183 additions and 15 deletions

View file

@ -347,9 +347,45 @@ public class SBOL2SBML {
//if this is a Cello Modeling event, check all the interactions in the SBOL document and record with which particular promoter do they interact
HashMap<String, HashMap <String, String>> promoterInteractions = promoterInteractions(sbolDoc);
//Determine the product of each engineered region, and extract it's cello parameters
HashMap<String, List<String>> Prot_2_Param = productionInteractions(sbolDoc);
// Flatten ModuleDefinition. Combine all parts of a Transcriptional Unit into a single TU.
ModuleDefinition resultMD = MDFlattener(sbolDoc, moduleDef);
//HashMap<String, List<String>> Prot_2_Param3 = productionInteractions(sbolDoc);
/* HashMap<String, List<String>> Prot_2_Param = new HashMap <String, List<String>>();
for (Interaction interaction : resultMD.getInteractions()) {
if (isProductionInteraction(interaction, resultMD, sbolDoc)) {
String protein1 = "";
for (Participation participator2 : interaction.getParticipations()) {
if (participator2.containsRole(SystemsBiologyOntology.PRODUCT)){
protein1 = participator2.getParticipant().getDisplayId();
if (!Prot_2_Param.containsKey(protein1)) {
Prot_2_Param.put(protein1, new ArrayList());
}
}
}
for (Participation participator : interaction.getParticipations()) {
if (participator.containsRole(SystemsBiologyOntology.PROMOTER)||
participator.containsRole(SystemsBiologyOntology.TEMPLATE)) {
for (Component comp : participator.getParticipantDefinition().getComponents()) {
if (comp.getDefinition().getRoles().contains(SequenceOntology.ENGINEERED_REGION)){
List<String> CelloParameters = hasCelloParameters2(comp.getDefinition());
Prot_2_Param.put(protein1, CelloParameters);
if (!Prot_2_Param.get(protein1).isEmpty()) {
System.out.println("has Cello Parameters!");
}
}
}
}
}
}
}*/
HashMap<FunctionalComponent, HashMap<String, String>> celloParameters = new HashMap<FunctionalComponent, HashMap<String, String>>();
boolean CelloModel = false;
// TODO there has to be a better way to determine if we are in a Cello model generation or not
@ -539,7 +575,7 @@ public class SBOL2SBML {
generateCelloProductionRxns(promoter, promoterToPartici.get(promoter), promoterToProductions.get(promoter),
promoterToActivations.get(promoter), promoterToRepressions.get(promoter), promoterToProducts.get(promoter),
promoterToTranscribed.get(promoter), promoterToActivators.get(promoter),
promoterToRepressors.get(promoter), resultMD, sbolDoc, targetModel, celloParameters, promoterInteractions);
promoterToRepressors.get(promoter), resultMD, sbolDoc, targetModel, Prot_2_Param, promoterInteractions);
//TODO PEDRO calling cello methods
//generateCelloDegradationRxn for all species produced, and for all mRNAs produced for each TU
}
@ -651,6 +687,55 @@ public class SBOL2SBML {
return promoterInteractions;
}
/**
* This method returns a Hashmap with a protein, and Cello Parameters associated with it if it has any.
*
* @author Pedro Fontanarrosa
* @param sbolDoc the sbol doc
* @return the hash map
*/
private static HashMap<String, List<String>> productionInteractions(SBOLDocument sbolDoc){
HashMap<String, List<String>> Prot_2_Param = new HashMap <String, List<String>>();
for (ComponentDefinition CD : sbolDoc.getComponentDefinitions()) {
if (CD.containsRole(SequenceOntology.ENGINEERED_REGION)) {
System.out.println("Role!");
System.out.println(CD);
for (Component comp : CD.getComponents()) {
if (comp.getDefinition().containsRole(SequenceOntology.CDS)) {
System.out.println("CDS");
System.out.println(comp);
for (ModuleDefinition moduleDef : sbolDoc.getModuleDefinitions()) {
for (Interaction interaction : moduleDef.getInteractions()) {
if (isProductionInteraction(interaction, moduleDef, sbolDoc)) {
for (Participation participator : interaction.getParticipations()) {
// use .equals() rather than == in the If statement, because .equals() compares objects and == only compares int.
if (participator.getParticipant().getDisplayId().equals(comp.getDefinition().getDisplayId())) {
for (Participation participator2 : interaction.getParticipations()) {
if (participator2.containsRole(SystemsBiologyOntology.PRODUCT)) {
String protein1 = participator2.getParticipant().getDisplayId();
if (!Prot_2_Param.containsKey(protein1)) {
Prot_2_Param.put(protein1, hasCelloParameters2(CD));
System.out.println(CD.getDisplayId() + protein1 + "YAY!");
}
}
}
//System.out.println("P" + participator2.getParticipant().getDisplayId());
//System.out.println("D" + comp.getDefinition().getDisplayId());
}
}
}
}
}
}
}
}
}
return Prot_2_Param;
}
/**
* Checks for Cello parameters. This method searches annotations of parts to see if there are stored any Cello parameters.
@ -673,8 +758,7 @@ public class SBOL2SBML {
ComponentDefinition tuCD = promoter.getDefinition();
for (Component comp : tuCD.getComponents()) {
if (comp.getDefinition() != null) {
if (comp.getDefinition().getRoles().contains(SequenceOntology.PROMOTER)||
comp.getDefinition().getRoles().contains(SequenceOntology.ENGINEERED_REGION)) {
if (comp.getDefinition().getRoles().contains(SequenceOntology.ENGINEERED_REGION)) {
ComponentDefinition Part = comp.getDefinition();
//get all the annotations of the part, which is where the cello parameters are stored as from (09/05/18). Eventually
//the location of these parameters can change
@ -700,6 +784,7 @@ public class SBOL2SBML {
}
//Create HashMap where to store all parameters. It will return empty "" string values if it hasn't found any Cello parameters.
HashMap<String, String> celloParameters = new HashMap<String, String>();
celloParameters.put("n", n);
celloParameters.put("K", K);
celloParameters.put("ymax", ymax);
@ -707,6 +792,54 @@ public class SBOL2SBML {
return celloParameters;
}
//TODO PEDRO hasCelloParameters
private static ArrayList<String> hasCelloParameters2(ComponentDefinition promoter){
//Initialize the parameters we are looking for
String n = "";
String K = "";
String ymax = "";
String ymin = "";
if (promoter != null) {
if (promoter.getRoles().contains(SequenceOntology.ENGINEERED_REGION)) {
//get all the annotations of the part, which is where the cello parameters are stored as from (09/05/18). Eventually
//the location of these parameters can change
List<Annotation> Annot = promoter.getAnnotations();
//cicle through all annotations looking for Cello parameters
for (int i = 0; i < Annot.size(); i++) {
if (Annot.get(i).getQName().toString().equals(new String("{http://cellocad.org/Terms/cello#}K"))) {
K = Annot.get(i).getStringValue();
}
if (Annot.get(i).getQName().toString().equals(new String("{http://cellocad.org/Terms/cello#}n"))) {
n = Annot.get(i).getStringValue();
}
if (Annot.get(i).getQName().toString().equals(new String("{http://cellocad.org/Terms/cello#}ymax"))) {
ymax = Annot.get(i).getStringValue();
}
if (Annot.get(i).getQName().toString().equals(new String("{http://cellocad.org/Terms/cello#}ymin"))) {
ymin = Annot.get(i).getStringValue();
}
}
}
}
//Create HashMap where to store all parameters. It will return empty "" string values if it hasn't found any Cello parameters.
HashMap<String, String> celloParameters = new HashMap<String, String>();
ArrayList<String> CelloParameters2 = new ArrayList<String>();
CelloParameters2.add(n);
CelloParameters2.add(K);
CelloParameters2.add(ymax);
CelloParameters2.add(ymin);
celloParameters.put("n", n);
celloParameters.put("K", K);
celloParameters.put("ymax", ymax);
celloParameters.put("ymin", ymin);
return CelloParameters2;
}
/**
* Convert the given SBOL ModuleDefinition and its submodule to equivalent SBML models.
* SBML replacement and replacedBy objects will be created for each SBOL MapsTo that occur in the given SBML submodule.
@ -1243,7 +1376,7 @@ public class SBOL2SBML {
private static void generateCelloProductionRxns(FunctionalComponent promoter, List<Participation> partici, List<Interaction> productions,
List<Interaction> activations, List<Interaction> repressions,
List<Participation> products, List<Participation> transcribed, List<Participation> activators,
List<Participation> repressors, ModuleDefinition moduleDef, SBOLDocument sbolDoc, BioModel targetModel, HashMap<FunctionalComponent, HashMap<String, String>> celloParameters, HashMap<String, HashMap <String, String>> promoterInteractions) throws BioSimException {
List<Participation> repressors, ModuleDefinition moduleDef, SBOLDocument sbolDoc, BioModel targetModel, HashMap<String, List<String>> celloParameters, HashMap<String, HashMap <String, String>> promoterInteractions) throws BioSimException {
//This method should create a mRNA species for each promoter, since this species are not present in the SBOLdocument returned by VPR
// collect data, create mRNA species, mRNA degradation reaction, mRNA Production reaction, TF production reaction

View file

@ -2020,7 +2020,7 @@ public class BioModel extends CoreObservable{
}
//TODO PEDRO createCelloSDProductionReaction
public Reaction createCelloSDProductionReactions(Species mRNA, String reactionID, String TU , HashMap<FunctionalComponent, HashMap<String, String>> celloParameters, String kSDdegrad, String n, String k_react,
public Reaction createCelloSDProductionReactions(Species mRNA, String reactionID, String TU , HashMap<String, List<String>> celloParameters, String kSDdegrad, String n, String k_react,
String ymax, String ymin, boolean onPort, String[] dimensions, BioModel targetModel) {
//This method should create a production reaction for the mRNA that is transcribed from the TU.
@ -2098,7 +2098,7 @@ public class BioModel extends CoreObservable{
}
//TODO PEDRO createCelloTFProductionReaction
public Reaction createCelloTFProductionReactions(Species mRNA, String rxnID, List<Participation> products, HashMap<FunctionalComponent, HashMap<String, String>> celloParameters, String kTFdegrad, String ko,
public Reaction createCelloTFProductionReactions(Species mRNA, String rxnID, List<Participation> products, HashMap<String, List<String>> celloParameters, String kTFdegrad, String ko,
String kb, String KoStr, String KaoStr, boolean onPort, String[] dimensions) {
//This method should create a production reaction for all Protein or Products the TU produces.
@ -2227,7 +2227,7 @@ public class BioModel extends CoreObservable{
}
//TODO PEDRO createCelloProductionKineticLaw
public static String createCelloProductionKineticLaw(Reaction reaction, HashMap<FunctionalComponent, HashMap<String, String>> celloParameters, HashMap<String, HashMap <String, String>> promoterInteractions, Set<String> promoters) {
public static String createCelloProductionKineticLaw(Reaction reaction, HashMap<String, List<String>> celloParameters, HashMap<String, HashMap <String, String>> promoterInteractions, Set<String> promoters) {
String kineticLaw = "";
//boolean activated = false;
String promoter = "";
@ -2259,13 +2259,30 @@ public class BioModel extends CoreObservable{
String temp = "("+ K +"/" + activator + ")^" + n;
denominator += temp;
LocalParameter K_para = reaction.getKineticLaw().createLocalParameter();
K_para.setId(K);
//K_para.setValue(kdegrad);
LocalParameter n_para = reaction.getKineticLaw().createLocalParameter();
n_para.setId(n);
//n_para.setValue(kdegrad);
if (celloParameters.get(activator).get(0) != null) {
double n_value = Double.parseDouble(celloParameters.get(activator).get(0));
n_para.setValue(n_value);
}
LocalParameter K_para = reaction.getKineticLaw().createLocalParameter();
K_para.setId(K);
if (celloParameters.get(activator) != null) {
double K_value = Double.parseDouble(celloParameters.get(activator).get(1));
K_para.setValue(K_value);
}
if (celloParameters.get(activator) != null) {
double ymax_value = Double.parseDouble(celloParameters.get(activator).get(2));
ymax_p.setValue(ymax_value);
}
if (celloParameters.get(activator) != null) {
double ymin_value = Double.parseDouble(celloParameters.get(activator).get(3));
ymin_p.setValue(ymin_value);
}
} else if (interaction.equals("repression")) {
String repressor = promInter.get(entry).toString();
String K = "K_" + repressor;
@ -2274,12 +2291,30 @@ public class BioModel extends CoreObservable{
String temp = "(" + repressor + "/"+ K + ")^" + n;
denominator += temp;
LocalParameter K_para = reaction.getKineticLaw().createLocalParameter();
K_para.setId(K);
//K_para.setValue(kdegrad);
LocalParameter n_para = reaction.getKineticLaw().createLocalParameter();
n_para.setId(n);
//n_para.setValue(kdegrad);
if (celloParameters.get(repressor) != null) {
double n_value = Double.parseDouble(celloParameters.get(repressor).get(0));
n_para.setValue(n_value);
}
LocalParameter K_para = reaction.getKineticLaw().createLocalParameter();
K_para.setId(K);
if (celloParameters.get(repressor) != null) {
double K_value = Double.parseDouble(celloParameters.get(repressor).get(1));
K_para.setValue(K_value);
}
if (celloParameters.get(repressor) != null) {
double ymax_value = Double.parseDouble(celloParameters.get(repressor).get(2));
ymax_p.setValue(ymax_value);
}
if (celloParameters.get(repressor) != null) {
double ymin_value = Double.parseDouble(celloParameters.get(repressor).get(3));
ymin_p.setValue(ymin_value);
}
}
}
kineticLaw += "+" + "kdegrad" + "*(" + numerator + "/(" + denominator + ")+" + ymin + ")";