Commit b79ba47c authored by Piotr Gawron's avatar Piotr Gawron
Browse files

rename field to be more descriptive

parent e800dad6
......@@ -868,7 +868,6 @@ public class SbgnmlXmlParser {
Residue residue = stateVariableToResidue(child);
if (residue != null && (!canAssignStructuralState || residue.getState() != null
|| (child.getState() == null || child.getState().getValue() == null))) {
// if (residue != null) {
if (newSpecies instanceof Protein) {
((Protein) newSpecies).addResidue(residue);
} else if (newSpecies instanceof Complex) {
......@@ -1232,35 +1231,35 @@ public class SbgnmlXmlParser {
/**
* Method used to parse state variable.
*
* @param unitOfInformationGlyph
* @param stateVariable
* unit of information glyph from sbgn-ml file
* @throws Exception
* Exception is thrown if state variable is parsed for species other
* than Protein
*/
private Residue stateVariableToResidue(final Glyph unitOfInformationGlyph) {
if (unitOfInformationGlyph.getState() != null && (unitOfInformationGlyph.getState().getVariable() == null
|| unitOfInformationGlyph.getState().getVariable().trim().isEmpty())) {
private Residue stateVariableToResidue(final Glyph stateVariable) {
if (stateVariable.getState() != null && (stateVariable.getState().getVariable() == null
|| stateVariable.getState().getVariable().trim().isEmpty())) {
return null;
}
Residue mr = new Residue();
mr.setIdModificationResidue(unitOfInformationGlyph.getId());
if (unitOfInformationGlyph.getState() != null) {
mr.setIdModificationResidue(stateVariable.getId());
if (stateVariable.getState() != null) {
// If State variable consists of value and variable
mr.setName(unitOfInformationGlyph.getState().getVariable());
mr.setName(stateVariable.getState().getVariable());
for (final ModificationState ms : ModificationState.values()) {
if (ms.getAbbreviation().equals(unitOfInformationGlyph.getState().getValue())) {
if (ms.getAbbreviation().equals(stateVariable.getState().getValue())) {
mr.setState(ms);
}
}
}
// Compute the angle from coordinates and dimensions
double x = unitOfInformationGlyph.getBbox().getX() + unitOfInformationGlyph.getBbox().getW() / 2;
double y = unitOfInformationGlyph.getBbox().getY() + unitOfInformationGlyph.getBbox().getH() / 2;
double x = stateVariable.getBbox().getX() + stateVariable.getBbox().getW() / 2;
double y = stateVariable.getBbox().getY() + stateVariable.getBbox().getH() / 2;
mr.setPosition(new Point2D.Double(x, y));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment