Commit 3ef46380 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

antisense rna are visualized

parent d45c3603
......@@ -60,7 +60,7 @@ public class AntisenseRnaConverter extends SpeciesConverter<AntisenseRna> {
graphics.setStroke(stroke);
for (AntisenseRnaRegion mr : antisenseRna.getRegions()) {
drawRegion(antisenseRna, mr, graphics, false, false);
drawRegion(antisenseRna, mr, graphics, false);
}
drawText(antisenseRna, graphics, params);
......@@ -99,16 +99,11 @@ public class AntisenseRnaConverter extends SpeciesConverter<AntisenseRna> {
* {@link AntisenseRnaRegion} to be drawn
* @param graphics
* {@link Graphics2D} where we draw region
* @param drawEmptyRegion
* flag determining if we should draw empty regions
* @param drawDescription
* flag determining if we want to draw description as well
*/
private void drawRegion(final AntisenseRna antisenseRna, final AntisenseRnaRegion region, final Graphics2D graphics,
final boolean drawEmptyRegion, final boolean drawDescription) {
if ((!drawEmptyRegion) && (region.getState() == null)) {
return;
}
final boolean drawDescription) {
double diameter = DEFAULT_MODIFICATION_DIAMETER;
double y = antisenseRna.getY();
......@@ -129,16 +124,5 @@ public class AntisenseRnaConverter extends SpeciesConverter<AntisenseRna> {
Point2D p2 = new Point2D.Double(p.getX() - textWidth / 2, p.getY() - DEFAULT_SPECIES_MODIFIER_FONT_SIZE);
graphics.drawString(text, (int) p2.getX(), (int) p2.getY());
}
ModificationState state = region.getState();
if (state != null) {
String str = state.getAbbreviation();
Font tmpFont = graphics.getFont();
graphics.setFont(getStructuralFont());
double textX = p.getX() - graphics.getFontMetrics().stringWidth(str) / 2;
double textY = p.getY() + graphics.getFontMetrics().getAscent() / 2;
graphics.drawString(str, (int) textX, (int) textY);
graphics.setFont(tmpFont);
}
}
}
......@@ -70,14 +70,6 @@ public class AntisenseRnaRegion implements Serializable, ElementModification {
@Column(name = "name")
private String name = "";
/**
* Defines a state of the region (for instance ubiquitinated etc).
*
* @see ModificationState
*/
@Column(name = "state")
private ModificationState state = null;
/**
* Type of the region in the rna. There are three possible values:
* <ul>
......@@ -173,9 +165,6 @@ public class AntisenseRnaRegion implements Serializable, ElementModification {
throw new InvalidArgumentException("Cannot update from mr with different id");
}
this.size = mr.getSize();
if (mr.getState() != null) {
this.state = mr.getState();
}
if (mr.getName() != null) {
this.name = mr.getName();
}
......@@ -231,16 +220,7 @@ public class AntisenseRnaRegion implements Serializable, ElementModification {
* @see #state
*/
public ModificationState getState() {
return state;
}
/**
* @param state
* the state to set
* @see #state
*/
public void setState(ModificationState state) {
this.state = state;
return null;
}
/**
......
......@@ -55,12 +55,11 @@ public class AntisenseRnaRegionTest {
public void testUpdate() {
try {
AntisenseRnaRegion antisenseRna = new AntisenseRnaRegion();
antisenseRna.setState(ModificationState.EMPTY);
antisenseRna.setName("as");
antisenseRna.setPosition(new Point2D.Double(10, 0));
AntisenseRnaRegion antisenseRna2 = new AntisenseRnaRegion();
antisenseRna2.update(antisenseRna);
assertEquals(antisenseRna.getState(), antisenseRna2.getState());
assertEquals(antisenseRna.getName(), antisenseRna2.getName());
} catch (Exception e) {
e.printStackTrace();
throw e;
......@@ -102,7 +101,6 @@ public class AntisenseRnaRegionTest {
region.setType(type);
region.setName(name);
region.setIdAntisenseRnaRegion(idAntisenseRnaRegion);
region.setState(ModificationState.ACETYLATED);
assertEquals(id, region.getId());
assertEquals(species, region.getSpecies());
......@@ -112,8 +110,6 @@ public class AntisenseRnaRegionTest {
assertEquals(name, region.getName());
assertEquals(idAntisenseRnaRegion, region.getIdAntisenseRnaRegion());
assertEquals(ModificationState.ACETYLATED, region.getState());
try {
region.setSize("text");
fail("Exception expected");
......
......@@ -183,7 +183,6 @@ public class AliasDaoTest2 extends PersistTestFunctions {
mr.setName("name");
mr.setSize(3.0);
mr.setType(AntisenseRnaRegionType.MODIFICATION_SITE);
mr.setState(ModificationState.UNKNOWN);
sp.addRegion(mr);
aliasDao.add(sp);
......@@ -199,7 +198,6 @@ public class AliasDaoTest2 extends PersistTestFunctions {
assertEquals(sp2.getRegions().get(0).getIdAntisenseRnaRegion(), mr.getIdAntisenseRnaRegion());
assertEquals(sp2.getRegions().get(0).getName(), mr.getName());
assertEquals(sp2.getRegions().get(0).getSize(), mr.getSize(), EPSILON);
assertEquals(sp2.getRegions().get(0).getState(), mr.getState());
assertEquals(sp2.getRegions().get(0).getType(), mr.getType());
aliasDao.delete(sp2);
......
......@@ -160,7 +160,6 @@ public class ElementRestImplTest extends RestTestFunctions {
String state = "asd";
AntisenseRna antisenseRna = new AntisenseRna("s1");
AntisenseRnaRegion mr = new AntisenseRnaRegion();
mr.setState(ModificationState.ACETYLATED);
mr.setName("S250");
antisenseRna.addRegion(mr);
antisenseRna.setState(state);
......
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