Skip to content
Snippets Groups Projects
Commit c663f2c1 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

reaction contain information about reaction type

parent b689f058
No related branches found
No related tags found
1 merge request!14reaction contain information about reaction type
......@@ -106,7 +106,8 @@ Reaction.prototype.update = function(javaObject) {
this.setDescription(javaObject.notes);
this.setOther(javaObject.other);
this.setReferences(javaObject.references);
this.setType(javaObject.type);
if (javaObject.reactants !== "") {
this.setReactants(javaObject.reactants.split(","));
} else {
......@@ -122,7 +123,7 @@ Reaction.prototype.update = function(javaObject) {
} else {
this.setModifiers([]);
}
this.setHierarchyVisibilityLevel(javaObject.hierarchyVisibilityLevel);
this.setIsComplete(true);
};
......@@ -151,15 +152,15 @@ Reaction.prototype.setSymbol = function(symbol) {
this._symbol = symbol;
};
Reaction.prototype.getAbbreviation= function() {
Reaction.prototype.getAbbreviation = function() {
return this._abbreviation;
};
Reaction.prototype.setAbbreviation= function(abbreviation) {
Reaction.prototype.setAbbreviation = function(abbreviation) {
this._abbreviation = abbreviation;
};
Reaction.prototype.getFormula= function() {
Reaction.prototype.getFormula = function() {
return this._formula;
};
......@@ -167,7 +168,7 @@ Reaction.prototype.setFormula = function(formula) {
this._formula = formula;
};
Reaction.prototype.getMechanicalConfidenceScore= function() {
Reaction.prototype.getMechanicalConfidenceScore = function() {
return this._mechanicalConfidenceScore;
};
......@@ -175,7 +176,7 @@ Reaction.prototype.setMechanicalConfidenceScore = function(mechanicalConfidenceS
this._mechanicalConfidenceScore = mechanicalConfidenceScore;
};
Reaction.prototype.getLowerBound= function() {
Reaction.prototype.getLowerBound = function() {
return this._lowerBound;
};
......@@ -183,7 +184,7 @@ Reaction.prototype.setLowerBound = function(lowerBound) {
this._lowerBound = lowerBound;
};
Reaction.prototype.getUpperBound= function() {
Reaction.prototype.getUpperBound = function() {
return this._upperBound;
};
......@@ -195,7 +196,7 @@ Reaction.prototype.setGeneProteinReaction = function(geneProteinReaction) {
this._geneProteinReaction = geneProteinReaction;
};
Reaction.prototype.getGeneProteinReaction= function() {
Reaction.prototype.getGeneProteinReaction = function() {
return this._geneProteinReaction;
};
......@@ -203,7 +204,7 @@ Reaction.prototype.setSubsystem = function(subsystem) {
this._subsystem = subsystem;
};
Reaction.prototype.getSubsystem= function() {
Reaction.prototype.getSubsystem = function() {
return this._subsystem;
};
......@@ -211,7 +212,7 @@ Reaction.prototype.setSynonyms = function(synonyms) {
this._synonyms = synonyms;
};
Reaction.prototype.getSynonyms= function() {
Reaction.prototype.getSynonyms = function() {
return this._synonyms;
};
......@@ -219,7 +220,7 @@ Reaction.prototype.setDescription = function(description) {
this._description = description;
};
Reaction.prototype.getDescription= function() {
Reaction.prototype.getDescription = function() {
return this._description;
};
......@@ -255,6 +256,14 @@ Reaction.prototype.getModifiers = function() {
return this._modifiers;
};
Reaction.prototype.setType = function(type) {
this._type = type;
};
Reaction.prototype.getType = function() {
return this._type;
};
Reaction.prototype.getOther = function(type) {
if (this._other !== undefined) {
return this._other[type];
......
......@@ -17,30 +17,13 @@ describe('Reaction', function() {
});
it("contructor", function() {
var javaObject = {
lines : [ {
start : Object,
end : Object,
type : "START"
}, {
start : Object,
end : Object,
type : "END"
}, {
start : Object,
end : Object,
type : "MIDDLE"
} ],
modelId : 319,
idObject : "13178",
centerPoint : {
x : 10,
y : 12,
},
};
var reaction = new Reaction(javaObject);
assert.ok(reaction);
assert.ok(reaction.getId());
return ServerConnector.readFile("testFiles/reaction.json").then(function(content) {
var javaObject = JSON.parse(content);
var reaction = new Reaction(javaObject);
assert.ok(reaction);
assert.ok(reaction.getId());
assert.ok(reaction.getType());
});
});
it("constructor from invalid", function() {
var javaObject = {
......
{
"modelId" : 15781,
"reactants" : "329166",
"reactionId" : "re21",
"id" : 153508,
"type" : "State transition",
"lines" : [ {
"start" : {
"x" : 129.00000000000003,
"y" : 269.9853478599471
},
"end" : {
"x" : 217.3857151822324,
"y" : 271.4614610007049
},
"type" : "START"
}, {
"start" : {
"x" : 217.3857151822324,
"y" : 271.4614610007049
},
"end" : {
"x" : 217.98919008325365,
"y" : 297.73178548394236
},
"type" : "MIDDLE"
}, {
"start" : {
"x" : 218.17291548409574,
"y" : 305.7296755167626
},
"end" : {
"x" : 218.77639038511697,
"y" : 332.0
},
"type" : "END"
} ],
"modifiers" : "",
"centerPoint" : {
"x" : 218.0810527836747,
"y" : 301.7307305003525
},
"products" : "329171"
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment