Commit 6932c247 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

cell designer structures for storing modification data simplified

parent ca4d2258
...@@ -11,7 +11,7 @@ import lcsb.mapviewer.converter.model.celldesigner.CellDesignerElementCollection ...@@ -11,7 +11,7 @@ import lcsb.mapviewer.converter.model.celldesigner.CellDesignerElementCollection
import lcsb.mapviewer.converter.model.celldesigner.annotation.RestAnnotationParser; import lcsb.mapviewer.converter.model.celldesigner.annotation.RestAnnotationParser;
import lcsb.mapviewer.converter.model.celldesigner.structure.CellDesignerAntisenseRna; import lcsb.mapviewer.converter.model.celldesigner.structure.CellDesignerAntisenseRna;
import lcsb.mapviewer.converter.model.celldesigner.structure.CellDesignerElement; import lcsb.mapviewer.converter.model.celldesigner.structure.CellDesignerElement;
import lcsb.mapviewer.converter.model.celldesigner.structure.fields.CellDesignerAntisenseRnaRegion; import lcsb.mapviewer.converter.model.celldesigner.structure.fields.CellDesignerModificationResidue;
import lcsb.mapviewer.model.map.species.AntisenseRna; import lcsb.mapviewer.model.map.species.AntisenseRna;
import lcsb.mapviewer.model.map.species.field.CodingRegion; import lcsb.mapviewer.model.map.species.field.CodingRegion;
import lcsb.mapviewer.model.map.species.field.ModificationResidue; import lcsb.mapviewer.model.map.species.field.ModificationResidue;
...@@ -166,9 +166,9 @@ public class AntisenseRnaXmlParser extends AbstractElementXmlParser<CellDesigner ...@@ -166,9 +166,9 @@ public class AntisenseRnaXmlParser extends AbstractElementXmlParser<CellDesigner
* @throws InvalidXmlSchemaException * @throws InvalidXmlSchemaException
* thrown when input xml node doesn't follow defined schema * thrown when input xml node doesn't follow defined schema
*/ */
private CellDesignerAntisenseRnaRegion getAntisenseRnaRegion(Node regionNode) throws InvalidXmlSchemaException { private CellDesignerModificationResidue getAntisenseRnaRegion(Node regionNode) throws InvalidXmlSchemaException {
CellDesignerAntisenseRnaRegion residue = new CellDesignerAntisenseRnaRegion(); CellDesignerModificationResidue residue = new CellDesignerModificationResidue();
residue.setIdAntisenseRnaRegion(getNodeAttr("id", regionNode)); residue.setIdModificationResidue(getNodeAttr("id", regionNode));
residue.setName(getNodeAttr("name", regionNode)); residue.setName(getNodeAttr("name", regionNode));
residue.setSize(getNodeAttr("size", regionNode)); residue.setSize(getNodeAttr("size", regionNode));
residue.setPos(getNodeAttr("pos", regionNode)); residue.setPos(getNodeAttr("pos", regionNode));
......
...@@ -12,7 +12,6 @@ import lcsb.mapviewer.converter.model.celldesigner.annotation.RestAnnotationPars ...@@ -12,7 +12,6 @@ import lcsb.mapviewer.converter.model.celldesigner.annotation.RestAnnotationPars
import lcsb.mapviewer.converter.model.celldesigner.geometry.CellDesignerAliasConverter; import lcsb.mapviewer.converter.model.celldesigner.geometry.CellDesignerAliasConverter;
import lcsb.mapviewer.converter.model.celldesigner.structure.CellDesignerElement; import lcsb.mapviewer.converter.model.celldesigner.structure.CellDesignerElement;
import lcsb.mapviewer.converter.model.celldesigner.structure.CellDesignerGene; import lcsb.mapviewer.converter.model.celldesigner.structure.CellDesignerGene;
import lcsb.mapviewer.converter.model.celldesigner.structure.fields.CellDesignerGeneRegion;
import lcsb.mapviewer.converter.model.celldesigner.structure.fields.CellDesignerModificationResidue; import lcsb.mapviewer.converter.model.celldesigner.structure.fields.CellDesignerModificationResidue;
import lcsb.mapviewer.model.map.species.Gene; import lcsb.mapviewer.model.map.species.Gene;
import lcsb.mapviewer.model.map.species.field.ModificationResidue; import lcsb.mapviewer.model.map.species.field.ModificationResidue;
...@@ -92,8 +91,8 @@ public class GeneXmlParser extends AbstractElementXmlParser<CellDesignerGene, Ge ...@@ -92,8 +91,8 @@ public class GeneXmlParser extends AbstractElementXmlParser<CellDesignerGene, Ge
* @throws InvalidXmlSchemaException * @throws InvalidXmlSchemaException
* thrown when input xml node doesn't follow defined schema * thrown when input xml node doesn't follow defined schema
*/ */
CellDesignerGeneRegion getModificationResidue(Node residueNode) throws InvalidXmlSchemaException { CellDesignerModificationResidue getModificationResidue(Node residueNode) throws InvalidXmlSchemaException {
CellDesignerGeneRegion residue = new CellDesignerGeneRegion(); CellDesignerModificationResidue residue = new CellDesignerModificationResidue();
residue.setIdModificationResidue(getNodeAttr("id", residueNode)); residue.setIdModificationResidue(getNodeAttr("id", residueNode));
residue.setName(getNodeAttr("name", residueNode)); residue.setName(getNodeAttr("name", residueNode));
residue.setSide(getNodeAttr("side", residueNode)); residue.setSide(getNodeAttr("side", residueNode));
......
...@@ -10,7 +10,7 @@ import lcsb.mapviewer.converter.model.celldesigner.CellDesignerElementCollection ...@@ -10,7 +10,7 @@ import lcsb.mapviewer.converter.model.celldesigner.CellDesignerElementCollection
import lcsb.mapviewer.converter.model.celldesigner.annotation.RestAnnotationParser; import lcsb.mapviewer.converter.model.celldesigner.annotation.RestAnnotationParser;
import lcsb.mapviewer.converter.model.celldesigner.structure.CellDesignerElement; import lcsb.mapviewer.converter.model.celldesigner.structure.CellDesignerElement;
import lcsb.mapviewer.converter.model.celldesigner.structure.CellDesignerRna; import lcsb.mapviewer.converter.model.celldesigner.structure.CellDesignerRna;
import lcsb.mapviewer.converter.model.celldesigner.structure.fields.CellDesignerRnaRegion; import lcsb.mapviewer.converter.model.celldesigner.structure.fields.CellDesignerModificationResidue;
import lcsb.mapviewer.model.map.species.Rna; import lcsb.mapviewer.model.map.species.Rna;
/** /**
...@@ -88,9 +88,9 @@ public class RnaXmlParser extends AbstractElementXmlParser<CellDesignerRna, Rna> ...@@ -88,9 +88,9 @@ public class RnaXmlParser extends AbstractElementXmlParser<CellDesignerRna, Rna>
* @throws InvalidXmlSchemaException * @throws InvalidXmlSchemaException
* thrown when input xml node doesn't follow defined schema * thrown when input xml node doesn't follow defined schema
*/ */
private CellDesignerRnaRegion getRnaRegion(Node residueNode) throws InvalidXmlSchemaException { private CellDesignerModificationResidue getRnaRegion(Node residueNode) throws InvalidXmlSchemaException {
CellDesignerRnaRegion residue = new CellDesignerRnaRegion(); CellDesignerModificationResidue residue = new CellDesignerModificationResidue();
residue.setIdRnaRegion(getNodeAttr("id", residueNode)); residue.setIdModificationResidue(getNodeAttr("id", residueNode));
residue.setSize(getNodeAttr("size", residueNode)); residue.setSize(getNodeAttr("size", residueNode));
residue.setPos(getNodeAttr("pos", residueNode)); residue.setPos(getNodeAttr("pos", residueNode));
String typeString = getNodeAttr("type", residueNode); String typeString = getNodeAttr("type", residueNode);
......
...@@ -20,10 +20,7 @@ import lcsb.mapviewer.converter.model.celldesigner.structure.CellDesignerProtein ...@@ -20,10 +20,7 @@ import lcsb.mapviewer.converter.model.celldesigner.structure.CellDesignerProtein
import lcsb.mapviewer.converter.model.celldesigner.structure.CellDesignerRna; import lcsb.mapviewer.converter.model.celldesigner.structure.CellDesignerRna;
import lcsb.mapviewer.converter.model.celldesigner.structure.CellDesignerSimpleMolecule; import lcsb.mapviewer.converter.model.celldesigner.structure.CellDesignerSimpleMolecule;
import lcsb.mapviewer.converter.model.celldesigner.structure.CellDesignerSpecies; import lcsb.mapviewer.converter.model.celldesigner.structure.CellDesignerSpecies;
import lcsb.mapviewer.converter.model.celldesigner.structure.fields.CellDesignerAntisenseRnaRegion;
import lcsb.mapviewer.converter.model.celldesigner.structure.fields.CellDesignerGeneRegion;
import lcsb.mapviewer.converter.model.celldesigner.structure.fields.CellDesignerModificationResidue; import lcsb.mapviewer.converter.model.celldesigner.structure.fields.CellDesignerModificationResidue;
import lcsb.mapviewer.converter.model.celldesigner.structure.fields.CellDesignerRnaRegion;
import lcsb.mapviewer.converter.model.celldesigner.structure.fields.SpeciesState; import lcsb.mapviewer.converter.model.celldesigner.structure.fields.SpeciesState;
import lcsb.mapviewer.model.map.compartment.Compartment; import lcsb.mapviewer.model.map.compartment.Compartment;
import lcsb.mapviewer.model.map.compartment.PathwayCompartment; import lcsb.mapviewer.model.map.compartment.PathwayCompartment;
...@@ -446,7 +443,7 @@ public class SpeciesSbmlParser extends AbstractElementXmlParser<CellDesignerSpec ...@@ -446,7 +443,7 @@ public class SpeciesSbmlParser extends AbstractElementXmlParser<CellDesignerSpec
throw new NotImplementedException("StructuralState not supported in Gene"); throw new NotImplementedException("StructuralState not supported in Gene");
} }
for (CellDesignerModificationResidue mr : state.getModifications()) { for (CellDesignerModificationResidue mr : state.getModifications()) {
gene.addModificationResidue(createGeneRegion(mr)); gene.addModificationResidue(mr);
} }
} else if (species instanceof CellDesignerProtein) { } else if (species instanceof CellDesignerProtein) {
CellDesignerProtein<?> protein = (CellDesignerProtein<?>) species; CellDesignerProtein<?> protein = (CellDesignerProtein<?>) species;
...@@ -461,7 +458,7 @@ public class SpeciesSbmlParser extends AbstractElementXmlParser<CellDesignerSpec ...@@ -461,7 +458,7 @@ public class SpeciesSbmlParser extends AbstractElementXmlParser<CellDesignerSpec
} }
for (CellDesignerModificationResidue mr : state.getModifications()) { for (CellDesignerModificationResidue mr : state.getModifications()) {
rna.addRegion(createRnaRegion(mr)); rna.addRegion(mr);
} }
} else if (species instanceof CellDesignerSimpleMolecule) { } else if (species instanceof CellDesignerSimpleMolecule) {
if (state.getStructuralState() != null && !state.getStructuralState().isEmpty()) { if (state.getStructuralState() != null && !state.getStructuralState().isEmpty()) {
...@@ -478,8 +475,7 @@ public class SpeciesSbmlParser extends AbstractElementXmlParser<CellDesignerSpec ...@@ -478,8 +475,7 @@ public class SpeciesSbmlParser extends AbstractElementXmlParser<CellDesignerSpec
} }
for (CellDesignerModificationResidue mr : state.getModifications()) { for (CellDesignerModificationResidue mr : state.getModifications()) {
CellDesignerAntisenseRnaRegion region = createAntisenseRnaRegion(mr); antisenseRna.addRegion(mr);
antisenseRna.addRegion(region);
} }
} else { } else {
if (state.getStructuralState() != null && !state.getStructuralState().isEmpty()) { if (state.getStructuralState() != null && !state.getStructuralState().isEmpty()) {
...@@ -492,23 +488,6 @@ public class SpeciesSbmlParser extends AbstractElementXmlParser<CellDesignerSpec ...@@ -492,23 +488,6 @@ public class SpeciesSbmlParser extends AbstractElementXmlParser<CellDesignerSpec
} }
private CellDesignerGeneRegion createGeneRegion(CellDesignerModificationResidue mr) {
CellDesignerGeneRegion region = new CellDesignerGeneRegion();
region.setIdModificationResidue(mr.getIdModificationResidue());
if (mr.getSize() != null) {
region.setSize(mr.getSize());
}
region.setState(mr.getState());
region.setName(mr.getName());
if (mr.getAngle() != null) {
region.setAngle(mr.getAngle());
}
if (mr.getModificationType() != null) {
region.setModificationType(mr.getModificationType());
}
return region;
}
/** /**
* Creates {@link SpeciesState} from xml node. * Creates {@link SpeciesState} from xml node.
* *
...@@ -623,49 +602,4 @@ public class SpeciesSbmlParser extends AbstractElementXmlParser<CellDesignerSpec ...@@ -623,49 +602,4 @@ public class SpeciesSbmlParser extends AbstractElementXmlParser<CellDesignerSpec
return "<celldesigner:modification residue=\"" + mr.getIdModificationResidue() + "\" state=\"" + state return "<celldesigner:modification residue=\"" + mr.getIdModificationResidue() + "\" state=\"" + state
+ "\"> </celldesigner:modification>\n"; + "\"> </celldesigner:modification>\n";
} }
/**
* Creates {@link CellDesignerAntisenseRnaRegion} from
* {@link CellDesignerModificationResidue} description.
*
* @param mr
* object from which we create {@link CellDesignerAntisenseRnaRegion}
* @return {@link CellDesignerAntisenseRnaRegion} object created from param
*/
CellDesignerAntisenseRnaRegion createAntisenseRnaRegion(CellDesignerModificationResidue mr) {
CellDesignerAntisenseRnaRegion region = new CellDesignerAntisenseRnaRegion();
region.setIdAntisenseRnaRegion(mr.getIdModificationResidue());
if (mr.getSize() != null) {
region.setSize(mr.getSize());
}
region.setState(mr.getState());
region.setName(mr.getName());
if (mr.getAngle() != null) {
region.setPos(mr.getAngle());
}
return region;
}
/**
* Creates {@link CellDesignerRnaRegion} from
* {@link CellDesignerModificationResidue} description.
*
* @param mr
* object from which we create {@link CellDesignerRnaRegion}
* @return {@link CellDesignerRnaRegion} object created from parameter
*/
public CellDesignerRnaRegion createRnaRegion(CellDesignerModificationResidue mr) {
CellDesignerRnaRegion result = new CellDesignerRnaRegion();
result.setIdRnaRegion(mr.getIdModificationResidue());
if (mr.getSize() != null) {
result.setSize(mr.getSize());
}
result.setState(mr.getState());
result.setName(mr.getName());
if (mr.getAngle() != null) {
result.setPos(mr.getAngle());
}
return result;
}
} }
...@@ -6,7 +6,7 @@ import java.util.List; ...@@ -6,7 +6,7 @@ import java.util.List;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import lcsb.mapviewer.common.exception.NotImplementedException; import lcsb.mapviewer.common.exception.NotImplementedException;
import lcsb.mapviewer.converter.model.celldesigner.structure.fields.CellDesignerAntisenseRnaRegion; import lcsb.mapviewer.converter.model.celldesigner.structure.fields.CellDesignerModificationResidue;
import lcsb.mapviewer.model.map.species.AntisenseRna; import lcsb.mapviewer.model.map.species.AntisenseRna;
import lcsb.mapviewer.model.map.species.Species; import lcsb.mapviewer.model.map.species.Species;
...@@ -32,7 +32,7 @@ public class CellDesignerAntisenseRna extends CellDesignerSpecies<AntisenseRna> ...@@ -32,7 +32,7 @@ public class CellDesignerAntisenseRna extends CellDesignerSpecies<AntisenseRna>
/** /**
* List of antisense rna regions (some rna sequences) in this object. * List of antisense rna regions (some rna sequences) in this object.
*/ */
private List<CellDesignerAntisenseRnaRegion> regions = new ArrayList<>(); private List<CellDesignerModificationResidue> regions = new ArrayList<>();
/** /**
* Constructor that copies the data from species given in the argument. * Constructor that copies the data from species given in the argument.
...@@ -44,8 +44,8 @@ public class CellDesignerAntisenseRna extends CellDesignerSpecies<AntisenseRna> ...@@ -44,8 +44,8 @@ public class CellDesignerAntisenseRna extends CellDesignerSpecies<AntisenseRna>
super(species); super(species);
if (species instanceof CellDesignerAntisenseRna) { if (species instanceof CellDesignerAntisenseRna) {
CellDesignerAntisenseRna asRna = (CellDesignerAntisenseRna) species; CellDesignerAntisenseRna asRna = (CellDesignerAntisenseRna) species;
for (CellDesignerAntisenseRnaRegion region : asRna.getRegions()) { for (CellDesignerModificationResidue region : asRna.getRegions()) {
addRegion(new CellDesignerAntisenseRnaRegion(region)); addRegion(new CellDesignerModificationResidue(region));
} }
} }
} }
...@@ -75,14 +75,13 @@ public class CellDesignerAntisenseRna extends CellDesignerSpecies<AntisenseRna> ...@@ -75,14 +75,13 @@ public class CellDesignerAntisenseRna extends CellDesignerSpecies<AntisenseRna>
* @param region * @param region
* region to add * region to add
*/ */
public void addRegion(CellDesignerAntisenseRnaRegion region) { public void addRegion(CellDesignerModificationResidue region) {
for (CellDesignerAntisenseRnaRegion region2 : regions) { for (CellDesignerModificationResidue region2 : regions) {
if (region2.getIdAntisenseRnaRegion().equals(region.getIdAntisenseRnaRegion())) { if (region2.getIdModificationResidue().equals(region.getIdModificationResidue())) {
region2.update(region); region2.update(region);
return; return;
} }
} }
regions.add(region); regions.add(region);
region.setSpecies(this); region.setSpecies(this);
} }
...@@ -92,11 +91,11 @@ public class CellDesignerAntisenseRna extends CellDesignerSpecies<AntisenseRna> ...@@ -92,11 +91,11 @@ public class CellDesignerAntisenseRna extends CellDesignerSpecies<AntisenseRna>
super.update(sp); super.update(sp);
if (sp instanceof CellDesignerAntisenseRna) { if (sp instanceof CellDesignerAntisenseRna) {
CellDesignerAntisenseRna rna = (CellDesignerAntisenseRna) sp; CellDesignerAntisenseRna rna = (CellDesignerAntisenseRna) sp;
for (CellDesignerAntisenseRnaRegion mr : getRegions()) { for (CellDesignerModificationResidue mr : getRegions()) {
mr.setState(null); mr.setState(null);
} }
for (CellDesignerAntisenseRnaRegion region : rna.getRegions()) { for (CellDesignerModificationResidue region : rna.getRegions()) {
updateRegion(region); updateRegion(region);
} }
} }
...@@ -110,9 +109,9 @@ public class CellDesignerAntisenseRna extends CellDesignerSpecies<AntisenseRna> ...@@ -110,9 +109,9 @@ public class CellDesignerAntisenseRna extends CellDesignerSpecies<AntisenseRna>
* @param param * @param param
* - object with new data from where update should be performed * - object with new data from where update should be performed
*/ */
private void updateRegion(CellDesignerAntisenseRnaRegion param) { private void updateRegion(CellDesignerModificationResidue param) {
for (CellDesignerAntisenseRnaRegion region : regions) { for (CellDesignerModificationResidue region : regions) {
if (region.getIdAntisenseRnaRegion().equals(param.getIdAntisenseRnaRegion())) { if (region.getIdModificationResidue().equals(param.getIdModificationResidue())) {
region.update(param); region.update(param);
return; return;
} }
...@@ -124,7 +123,7 @@ public class CellDesignerAntisenseRna extends CellDesignerSpecies<AntisenseRna> ...@@ -124,7 +123,7 @@ public class CellDesignerAntisenseRna extends CellDesignerSpecies<AntisenseRna>
* @return the regions * @return the regions
* @see #regions * @see #regions
*/ */
public List<CellDesignerAntisenseRnaRegion> getRegions() { public List<CellDesignerModificationResidue> getRegions() {
return regions; return regions;
} }
...@@ -133,7 +132,7 @@ public class CellDesignerAntisenseRna extends CellDesignerSpecies<AntisenseRna> ...@@ -133,7 +132,7 @@ public class CellDesignerAntisenseRna extends CellDesignerSpecies<AntisenseRna>
* the regions to set * the regions to set
* @see #regions * @see #regions
*/ */
public void setRegions(List<CellDesignerAntisenseRnaRegion> regions) { public void setRegions(List<CellDesignerModificationResidue> regions) {
this.regions = regions; this.regions = regions;
} }
...@@ -146,7 +145,7 @@ public class CellDesignerAntisenseRna extends CellDesignerSpecies<AntisenseRna> ...@@ -146,7 +145,7 @@ public class CellDesignerAntisenseRna extends CellDesignerSpecies<AntisenseRna>
@Override @Override
public void updateModelElementAfterLayoutAdded(Species element) { public void updateModelElementAfterLayoutAdded(Species element) {
for (CellDesignerAntisenseRnaRegion region : regions) { for (CellDesignerModificationResidue region : regions) {
((AntisenseRna) element).addRegion(region.createAntisenseRegionAlias(element)); ((AntisenseRna) element).addRegion(region.createAntisenseRegionAlias(element));
} }
} }
......
...@@ -4,7 +4,6 @@ import java.util.ArrayList; ...@@ -4,7 +4,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import lcsb.mapviewer.common.exception.NotImplementedException; import lcsb.mapviewer.common.exception.NotImplementedException;
import lcsb.mapviewer.converter.model.celldesigner.structure.fields.CellDesignerGeneRegion;
import lcsb.mapviewer.converter.model.celldesigner.structure.fields.CellDesignerModificationResidue; import lcsb.mapviewer.converter.model.celldesigner.structure.fields.CellDesignerModificationResidue;
import lcsb.mapviewer.model.map.species.Gene; import lcsb.mapviewer.model.map.species.Gene;
import lcsb.mapviewer.model.map.species.Species; import lcsb.mapviewer.model.map.species.Species;
...@@ -25,7 +24,7 @@ public class CellDesignerGene extends CellDesignerSpecies<Gene> { ...@@ -25,7 +24,7 @@ public class CellDesignerGene extends CellDesignerSpecies<Gene> {
/** /**
* List of modifications for the Gene. * List of modifications for the Gene.
*/ */
private List<CellDesignerGeneRegion> modificationResidues = new ArrayList<>(); private List<CellDesignerModificationResidue> modificationResidues = new ArrayList<>();
/** /**
* Constructor that initializes gene with the data passed in the argument. * Constructor that initializes gene with the data passed in the argument.
...@@ -37,8 +36,8 @@ public class CellDesignerGene extends CellDesignerSpecies<Gene> { ...@@ -37,8 +36,8 @@ public class CellDesignerGene extends CellDesignerSpecies<Gene> {
super(species); super(species);
if (species instanceof CellDesignerGene) { if (species instanceof CellDesignerGene) {
CellDesignerGene gene = (CellDesignerGene) species; CellDesignerGene gene = (CellDesignerGene) species;
for (CellDesignerGeneRegion mr : gene.getModificationResidues()) { for (CellDesignerModificationResidue mr : gene.getModificationResidues()) {
addModificationResidue(new CellDesignerGeneRegion(mr)); addModificationResidue(new CellDesignerModificationResidue(mr));
} }
} }
} }
...@@ -49,7 +48,7 @@ public class CellDesignerGene extends CellDesignerSpecies<Gene> { ...@@ -49,7 +48,7 @@ public class CellDesignerGene extends CellDesignerSpecies<Gene> {
if (species instanceof CellDesignerGene) { if (species instanceof CellDesignerGene) {
CellDesignerGene gene = (CellDesignerGene) species; CellDesignerGene gene = (CellDesignerGene) species;
for (CellDesignerGeneRegion mr : gene.getModificationResidues()) { for (CellDesignerModificationResidue mr : gene.getModificationResidues()) {
addModificationResidue(mr); addModificationResidue(mr);
} }
} }
...@@ -77,8 +76,8 @@ public class CellDesignerGene extends CellDesignerSpecies<Gene> { ...@@ -77,8 +76,8 @@ public class CellDesignerGene extends CellDesignerSpecies<Gene> {
* @param modificationResidue * @param modificationResidue
* modification to add * modification to add
*/ */
public void addModificationResidue(CellDesignerGeneRegion modificationResidue) { public void addModificationResidue(CellDesignerModificationResidue modificationResidue) {
for (CellDesignerGeneRegion mr : modificationResidues) { for (CellDesignerModificationResidue mr : modificationResidues) {
if (mr.getIdModificationResidue().equals(modificationResidue.getIdModificationResidue())) { if (mr.getIdModificationResidue().equals(modificationResidue.getIdModificationResidue())) {
mr.update(modificationResidue); mr.update(modificationResidue);
return; return;
...@@ -93,7 +92,7 @@ public class CellDesignerGene extends CellDesignerSpecies<Gene> { ...@@ -93,7 +92,7 @@ public class CellDesignerGene extends CellDesignerSpecies<Gene> {
* @return the modificationResidues * @return the modificationResidues
* @see #modificationResidues * @see #modificationResidues
*/ */
public List<CellDesignerGeneRegion> getModificationResidues() { public List<CellDesignerModificationResidue> getModificationResidues() {
return modificationResidues; return modificationResidues;
} }
...@@ -102,7 +101,7 @@ public class CellDesignerGene extends CellDesignerSpecies<Gene> { ...@@ -102,7 +101,7 @@ public class CellDesignerGene extends CellDesignerSpecies<Gene> {
* the modificationResidues to set * the modificationResidues to set
* @see #modificationResidues * @see #modificationResidues
*/ */
public void setModificationResidues(List<CellDesignerGeneRegion> modificationResidues) { public void setModificationResidues(List<CellDesignerModificationResidue> modificationResidues) {
this.modificationResidues = modificationResidues; this.modificationResidues = modificationResidues;
} }
...@@ -115,7 +114,7 @@ public class CellDesignerGene extends CellDesignerSpecies<Gene> { ...@@ -115,7 +114,7 @@ public class CellDesignerGene extends CellDesignerSpecies<Gene> {
@Override @Override
public void updateModelElementAfterLayoutAdded(Species element) { public void updateModelElementAfterLayoutAdded(Species element) {
for (CellDesignerGeneRegion region : modificationResidues) { for (CellDesignerModificationResidue region : modificationResidues) {
((Gene) element).addModificationResidue(region.createGeneModification(element)); ((Gene) element).addModificationResidue(region.createGeneModification(element));
} }
} }
......
...@@ -6,7 +6,7 @@ import java.util.List; ...@@ -6,7 +6,7 @@ import java.util.List;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import lcsb.mapviewer.common.exception.NotImplementedException; import lcsb.mapviewer.common.exception.NotImplementedException;
import lcsb.mapviewer.converter.model.celldesigner.structure.fields.CellDesignerRnaRegion; import lcsb.mapviewer.converter.model.celldesigner.structure.fields.CellDesignerModificationResidue;
import lcsb.mapviewer.model.map.species.Rna; import lcsb.mapviewer.model.map.species.Rna;
import lcsb.mapviewer.model.map.species.Species; import lcsb.mapviewer.model.map.species.Species;
...@@ -32,7 +32,7 @@ public class CellDesignerRna extends CellDesignerSpecies<Rna> { ...@@ -32,7 +32,7 @@ public class CellDesignerRna extends CellDesignerSpecies<Rna> {
/** /**
* List of rna regions (some rna sequences) in this object. * List of rna regions (some rna sequences) in this object.
*/ */
private List<CellDesignerRnaRegion> regions = new ArrayList<>(); private List<CellDesignerModificationResidue> regions = new ArrayList<>();
/** /**
* Constructor that initializes rna with the data passed in the argument. * Constructor that initializes rna with the data passed in the argument.
...@@ -44,8 +44,8 @@ public class CellDesignerRna extends CellDesignerSpecies<Rna> { ...@@ -44,8 +44,8 @@ public class CellDesignerRna extends CellDesignerSpecies<Rna> {
super(species); super(species);
if (species instanceof CellDesignerRna) { if (species instanceof CellDesignerRna) {
CellDesignerRna rna = (CellDesignerRna) species; CellDesignerRna rna = (CellDesignerRna) species;
for (CellDesignerRnaRegion region : rna.getRegions()) { for (CellDesignerModificationResidue region : rna.getRegions()) {
addRegion(new CellDesignerRnaRegion(region)); addRegion(new CellDesignerModificationResidue(region));
} }
} }
} }
...@@ -71,11 +71,11 @@ public class CellDesignerRna extends CellDesignerSpecies<Rna> { ...@@ -71,11 +71,11 @@ public class CellDesignerRna extends CellDesignerSpecies<Rna> {
super.update(species); super.update(species);
if (species instanceof CellDesignerRna) { if (species instanceof CellDesignerRna) {
CellDesignerRna rna = (CellDesignerRna) species; CellDesignerRna rna = (CellDesignerRna) species;
for (CellDesignerRnaRegion mr : getRegions()) { for (CellDesignerModificationResidue mr : getRegions()) {
mr.setState(null); mr.setState(null);
} }
for (CellDesignerRnaRegion region : rna.getRegions()) { for (CellDesignerModificationResidue region : rna.getRegions()) {
updateRegion(region); updateRegion(region);