Commit cd8d1eb1 authored by piotr.gawron's avatar piotr.gawron
Browse files

base refactoring finsihed

classes renamed to species (there are no aliases anymore)
database data about annotators cleared
parent ad998297
......@@ -31,10 +31,10 @@ import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.model.map.AnnotatedObject;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamType;
import lcsb.mapviewer.model.map.layout.alias.Alias;
import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
import lcsb.mapviewer.model.map.model.Model;
import lcsb.mapviewer.model.map.reaction.Reaction;
import lcsb.mapviewer.model.map.species.Element;
import lcsb.mapviewer.model.map.species.Species;
import lcsb.mapviewer.modelutils.map.ClassTreeNode;
import lcsb.mapviewer.modelutils.map.ElementUtils;
......@@ -241,10 +241,10 @@ public class ModelAnnotator {
protected void copyAnnotationFromOtherSpecies(Model model, IProgressUpdater progressUpdater) {
double counter = 0;
double amount = model.getAliases().size();
for (SpeciesAlias element : model.getSpeciesAliases()) {
for (Species element : model.getSpeciesAliases()) {
if (element.getMiriamData().size() == 0) {
List<Alias> speciesList = model.getAliasByName(element.getName());
for (Alias species2 : speciesList) {
List<Element> speciesList = model.getAliasByName(element.getName());
for (Element species2 : speciesList) {
if (species2.getClass().equals(element.getClass()) && species2.getMiriamData().size() > 0 && element.getMiriamData().size() == 0) {
for (MiriamData md : species2.getMiriamData()) {
element.addMiriamData(new MiriamData(md));
......@@ -278,7 +278,7 @@ public class ModelAnnotator {
double amount = model.getAliases().size() + model.getReactions().size();
// annotate all elements
for (Alias element : model.getAliases()) {
for (Element element : model.getAliases()) {
List<ElementAnnotator> list = null;
if (annotators != null) {
list = annotators.get(element.getClass());
......@@ -363,7 +363,7 @@ public class ModelAnnotator {
double ratio = modelCounter / modelSize;
double size = model.getAliases().size() + model.getReactions().size();
double counter = 0;
for (Alias element : model.getAliases()) {
for (Element element : model.getAliases()) {
result.addAll(findImproperAnnotations(element, validAnnotations.get(element.getClass())));
counter++;
updater.setProgress(ratio * IProgressUpdater.MAX_PROGRESS + (counter / size * IProgressUpdater.MAX_PROGRESS) / modelSize);
......@@ -427,7 +427,7 @@ public class ModelAnnotator {
models.add(m);
models.addAll(m.getSubmodels());
for (Model model : models) {
for (Alias alias : model.getAliases()) {
for (Element alias : model.getAliases()) {
result.addAll(findMissing(alias, requestedAnnotations.get(alias.getClass())));
}
for (Reaction reaction : model.getReactions()) {
......
......@@ -35,7 +35,7 @@ import lcsb.mapviewer.converter.model.celldesigner.annotation.RestAnnotationPars
import lcsb.mapviewer.model.map.AnnotatedObject;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamType;
import lcsb.mapviewer.model.map.layout.alias.ProteinAlias;
import lcsb.mapviewer.model.map.species.Protein;
/**
* This class is responsible for connection to Vencata annotation service. The
......@@ -75,7 +75,7 @@ public class BiocompendiumAnnotator extends ElementAnnotator implements IExterna
* Default constructor.
*/
public BiocompendiumAnnotator() {
super(BiocompendiumAnnotator.class, new Class[] { ProteinAlias.class, ProteinAlias.class, ProteinAlias.class }, true);
super(BiocompendiumAnnotator.class, new Class[] { Protein.class, Protein.class, Protein.class }, true);
}
@Override
......
......@@ -24,7 +24,7 @@ import lcsb.mapviewer.model.map.AnnotatedObject;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamRelationType;
import lcsb.mapviewer.model.map.MiriamType;
import lcsb.mapviewer.model.map.layout.alias.ChemicalAlias;
import lcsb.mapviewer.model.map.species.Chemical;
import lcsb.mapviewer.modelutils.map.ElementUtils;
import uk.ac.ebi.chebi.webapps.chebiWS.client.ChebiWebServiceClient;
import uk.ac.ebi.chebi.webapps.chebiWS.model.ChebiWebServiceFault_Exception;
......@@ -132,7 +132,7 @@ public class ChebiAnnotator extends ElementAnnotator implements IExternalService
* {@link Chebi} from/to xml.
*/
public ChebiAnnotator() {
super(ChebiAnnotator.class, new Class[] { ChemicalAlias.class }, true);
super(ChebiAnnotator.class, new Class[] { Chemical.class }, true);
chebiSerializer = new XmlSerializer<>(Chebi.class);
}
......@@ -457,7 +457,7 @@ public class ChebiAnnotator extends ElementAnnotator implements IExternalService
chebi = getChebiElementForChebiId(md);
}
}
ChemicalAlias species = (ChemicalAlias) element;
Chemical species = (Chemical) element;
if (chebi != null) {
super.setFullName(species, chebi.getName(), warnPrefix);
......
......@@ -7,14 +7,14 @@ import org.apache.log4j.Logger;
import lcsb.mapviewer.annotation.cache.CachableInterface;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.converter.model.celldesigner.structure.Chemical;
import lcsb.mapviewer.converter.model.celldesigner.structure.CellDesignerChemical;
import lcsb.mapviewer.model.map.AnnotatedObject;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamType;
import lcsb.mapviewer.model.map.layout.alias.Alias;
import lcsb.mapviewer.model.map.layout.alias.ChemicalAlias;
import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
import lcsb.mapviewer.model.map.reaction.Reaction;
import lcsb.mapviewer.model.map.species.Element;
import lcsb.mapviewer.model.map.species.Chemical;
import lcsb.mapviewer.model.map.species.Species;
/**
* Interface that allows to annotate {@link AnnotatedObject elements} in the
......@@ -186,7 +186,7 @@ public abstract class ElementAnnotator extends CachableInterface {
* @param prefix
* prefix used in warnings
*/
protected void setFullName(Alias element, String name, String prefix) {
protected void setFullName(Element element, String name, String prefix) {
if (element.getFullName() == null || element.getFullName().equals("") || element.getFullName().equals(name)) {
element.setFullName(name);
} else {
......@@ -223,7 +223,7 @@ public abstract class ElementAnnotator extends CachableInterface {
}
/**
* Sets {@link Chemical#inChI}.
* Sets {@link CellDesignerChemical#inChI}.
*
* @param element
* element where annotation should be added
......@@ -232,7 +232,7 @@ public abstract class ElementAnnotator extends CachableInterface {
* @param value
* value to set
*/
protected void setInchi(ChemicalAlias element, String value, String prefix) {
protected void setInchi(Chemical element, String value, String prefix) {
if (element.getInChI() == null || element.getInChI().isEmpty() || element.getInChI().equals(value)) {
element.setInChI(value);
} else {
......@@ -242,7 +242,7 @@ public abstract class ElementAnnotator extends CachableInterface {
}
/**
* Sets {@link Chemical#inChIKey}.
* Sets {@link CellDesignerChemical#inChIKey}.
*
* @param element
* element where annotation should be added
......@@ -251,7 +251,7 @@ public abstract class ElementAnnotator extends CachableInterface {
* @param value
* value to set
*/
protected void setInchiKey(ChemicalAlias element, String value, String prefix) {
protected void setInchiKey(Chemical element, String value, String prefix) {
if (element.getInChIKey() == null || element.getInChIKey().equals("")) {
element.setInChIKey(value);
} else if (!element.getInChIKey().equalsIgnoreCase(value)) {
......@@ -261,7 +261,7 @@ public abstract class ElementAnnotator extends CachableInterface {
}
/**
* Sets {@link Chemical#smiles}.
* Sets {@link CellDesignerChemical#smiles}.
*
* @param element
* element where annotation should be added
......@@ -270,7 +270,7 @@ public abstract class ElementAnnotator extends CachableInterface {
* @param value
* value to set
*/
protected void setSmile(ChemicalAlias element, String value, String prefix) {
protected void setSmile(Chemical element, String value, String prefix) {
if (element.getSmiles() == null || element.getSmiles().isEmpty() || element.getSmiles().equals(value)) {
element.setSmiles(value);
} else {
......@@ -295,7 +295,7 @@ public abstract class ElementAnnotator extends CachableInterface {
}
/**
* Sets {@link SpeciesAlias#charge}.
* Sets {@link Species#charge}.
*
* @param element
* element where annotation should be added
......@@ -304,7 +304,7 @@ public abstract class ElementAnnotator extends CachableInterface {
* @param prefix
* prefix used in warnings
*/
protected void setCharge(SpeciesAlias element, String value, String prefix) {
protected void setCharge(Species element, String value, String prefix) {
Integer charge = Integer.parseInt(value);
if (element.getCharge() == null || element.getCharge() == 0 || element.getCharge().equals(charge)) {
element.setCharge(Integer.valueOf(charge));
......
......@@ -23,11 +23,11 @@ import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
import lcsb.mapviewer.model.map.AnnotatedObject;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamType;
import lcsb.mapviewer.model.map.layout.alias.Alias;
import lcsb.mapviewer.model.map.layout.alias.GeneAlias;
import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
import lcsb.mapviewer.model.map.layout.alias.ProteinAlias;
import lcsb.mapviewer.model.map.layout.alias.RnaAlias;
import lcsb.mapviewer.model.map.species.Element;
import lcsb.mapviewer.model.map.species.Gene;
import lcsb.mapviewer.model.map.species.GenericProtein;
import lcsb.mapviewer.model.map.species.Protein;
import lcsb.mapviewer.model.map.species.Rna;
import lcsb.mapviewer.modelutils.map.ElementUtils;
/**
......@@ -66,7 +66,7 @@ public class EnsemblAnnotator extends ElementAnnotator implements IExternalServi
* Default constructor.
*/
public EnsemblAnnotator() {
super(EnsemblAnnotator.class, new Class[] { ProteinAlias.class, RnaAlias.class, GeneAlias.class }, false);
super(EnsemblAnnotator.class, new Class[] { Protein.class, Rna.class, Gene.class }, false);
}
@Override
......@@ -112,7 +112,7 @@ public class EnsemblAnnotator extends ElementAnnotator implements IExternalServi
try {
GenericProteinAlias proteinAlias = new GenericProteinAlias("mock_id");
GenericProtein proteinAlias = new GenericProtein("mock_id");
proteinAlias.addMiriamData(new MiriamData(MiriamType.ENSEMBL, "ENSG00000157764"));
annotateElement(proteinAlias);
......@@ -219,7 +219,7 @@ public class EnsemblAnnotator extends ElementAnnotator implements IExternalServi
}
String fullName = super.getNodeAttr("description", node);
if (symbol != null) {
setFullName((Alias) annotatedObject, fullName, prefix);
setFullName((Element) annotatedObject, fullName, prefix);
}
NodeList synonymNodeList = node.getChildNodes();
......@@ -280,7 +280,7 @@ public class EnsemblAnnotator extends ElementAnnotator implements IExternalServi
if (!MiriamType.ENSEMBL.equals(miriamData.getDataType())) {
throw new InvalidArgumentException("Only " + MiriamType.ENSEMBL + " identifier is accepted as an input");
}
GenericProteinAlias proteinAlias = new GenericProteinAlias("id");
GenericProtein proteinAlias = new GenericProtein("id");
annotateElement(proteinAlias, miriamData, "");
for (MiriamData md : proteinAlias.getMiriamData()) {
if (MiriamType.ENTREZ.equals(md.getDataType())) {
......
......@@ -27,11 +27,11 @@ import lcsb.mapviewer.model.map.AnnotatedObject;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamRelationType;
import lcsb.mapviewer.model.map.MiriamType;
import lcsb.mapviewer.model.map.layout.alias.Alias;
import lcsb.mapviewer.model.map.layout.alias.GeneAlias;
import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
import lcsb.mapviewer.model.map.layout.alias.ProteinAlias;
import lcsb.mapviewer.model.map.layout.alias.RnaAlias;
import lcsb.mapviewer.model.map.species.Element;
import lcsb.mapviewer.model.map.species.Gene;
import lcsb.mapviewer.model.map.species.GenericProtein;
import lcsb.mapviewer.model.map.species.Protein;
import lcsb.mapviewer.model.map.species.Rna;
import lcsb.mapviewer.modelutils.map.ElementUtils;
/**
......@@ -72,7 +72,7 @@ public class EntrezAnnotator extends ElementAnnotator implements IExternalServic
* Default constructor.
*/
public EntrezAnnotator() {
super(EntrezAnnotator.class, new Class[] { ProteinAlias.class, RnaAlias.class, GeneAlias.class }, false);
super(EntrezAnnotator.class, new Class[] { Protein.class, Rna.class, Gene.class }, false);
entrezSerializer = new XmlSerializer<>(EntrezData.class);
}
......@@ -130,7 +130,7 @@ public class EntrezAnnotator extends ElementAnnotator implements IExternalServic
this.setCache(null);
try {
GenericProteinAlias proteinAlias = new GenericProteinAlias("id");
GenericProtein proteinAlias = new GenericProtein("id");
proteinAlias.addMiriamData(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.ENTREZ, "9999"));
annotateElement(proteinAlias);
......@@ -186,7 +186,7 @@ public class EntrezAnnotator extends ElementAnnotator implements IExternalServic
if (data != null) {
setSymbol(element, data.getSymbol(), prefix);
setFullName((Alias) element, data.getFullName(), prefix);
setFullName((Element) element, data.getFullName(), prefix);
element.addMiriamData(data.getMiriamData());
element.setSynonyms(data.getSynonyms());
......@@ -343,7 +343,7 @@ public class EntrezAnnotator extends ElementAnnotator implements IExternalServic
String key = CACHE_HGNC_ID_PREFIX + miriamData.getResource();
String value = getCacheValue(key);
if (value == null) {
GenericProteinAlias proteinAlias = new GenericProteinAlias("some_id");
GenericProtein proteinAlias = new GenericProtein("some_id");
annotateElement(proteinAlias, miriamData, "");
for (MiriamData md : proteinAlias.getMiriamData()) {
if (MiriamType.HGNC.equals(md.getDataType())) {
......
......@@ -25,10 +25,10 @@ import lcsb.mapviewer.model.map.AnnotatedObject;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamRelationType;
import lcsb.mapviewer.model.map.MiriamType;
import lcsb.mapviewer.model.map.layout.alias.Alias;
import lcsb.mapviewer.model.map.layout.alias.CompartmentAlias;
import lcsb.mapviewer.model.map.layout.alias.ComplexAlias;
import lcsb.mapviewer.model.map.layout.alias.PhenotypeAlias;
import lcsb.mapviewer.model.map.compartment.Compartment;
import lcsb.mapviewer.model.map.species.Element;
import lcsb.mapviewer.model.map.species.Complex;
import lcsb.mapviewer.model.map.species.Phenotype;
import lcsb.mapviewer.modelutils.map.ElementUtils;
/**
......@@ -90,7 +90,7 @@ public class GoAnnotator extends ElementAnnotator implements IExternalService {
* {@link Go} from/to xml.
*/
public GoAnnotator() {
super(GoAnnotator.class, new Class[] { PhenotypeAlias.class, CompartmentAlias.class, ComplexAlias.class }, true);
super(GoAnnotator.class, new Class[] { Phenotype.class, Compartment.class, Complex.class }, true);
goSerializer = new XmlSerializer<>(Go.class);
}
......@@ -112,7 +112,7 @@ public class GoAnnotator extends ElementAnnotator implements IExternalService {
String commonName = go.getCommonName();
setFullName((Alias) object, commonName, new ElementUtils().getElementTag(object, this));
setFullName((Element) object, commonName, new ElementUtils().getElementTag(object, this));
String description = go.getDescription();
setDescription(object, description);
} catch (GoSearchException e) {
......@@ -173,7 +173,7 @@ public class GoAnnotator extends ElementAnnotator implements IExternalService {
this.setCache(null);
try {
CompartmentAlias compartmentAlias = new CompartmentAlias("some_id");
Compartment compartmentAlias = new Compartment("some_id");
compartmentAlias.addMiriamData(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.GO, "GO:0046902"));
annotateElement(compartmentAlias);
......
......@@ -19,11 +19,11 @@ import lcsb.mapviewer.model.map.AnnotatedObject;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamRelationType;
import lcsb.mapviewer.model.map.MiriamType;
import lcsb.mapviewer.model.map.layout.alias.Alias;
import lcsb.mapviewer.model.map.layout.alias.GeneAlias;
import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
import lcsb.mapviewer.model.map.layout.alias.ProteinAlias;
import lcsb.mapviewer.model.map.layout.alias.RnaAlias;
import lcsb.mapviewer.model.map.species.Element;
import lcsb.mapviewer.model.map.species.Gene;
import lcsb.mapviewer.model.map.species.GenericProtein;
import lcsb.mapviewer.model.map.species.Protein;
import lcsb.mapviewer.model.map.species.Rna;
import lcsb.mapviewer.modelutils.map.ElementUtils;
/**
......@@ -45,7 +45,7 @@ public class HgncAnnotator extends ElementAnnotator implements IExternalService
* Default constructor.
*/
public HgncAnnotator() {
super(HgncAnnotator.class, new Class[] { ProteinAlias.class, RnaAlias.class, GeneAlias.class }, true);
super(HgncAnnotator.class, new Class[] { Protein.class, Rna.class, Gene.class }, true);
}
@Override
......@@ -90,7 +90,7 @@ public class HgncAnnotator extends ElementAnnotator implements IExternalService
this.setCache(null);
try {
GenericProteinAlias proteinAlias = new GenericProteinAlias("id");
GenericProtein proteinAlias = new GenericProtein("id");
proteinAlias.addMiriamData(new MiriamData(MiriamRelationType.BQ_BIOL_IS_DESCRIBED_BY, MiriamType.HGNC_SYMBOL, "SNCA"));
annotateElement(proteinAlias);
......@@ -184,7 +184,7 @@ public class HgncAnnotator extends ElementAnnotator implements IExternalService
}
setSymbol(element, getNodeValue(node), prefix);
} else if (type.equals("name")) {
setFullName((Alias) element, getNodeValue(node), prefix);
setFullName((Element) element, getNodeValue(node), prefix);
}
} else if (node.getNodeName().equals("arr")) {
String type = getNodeAttr("name", node);
......@@ -205,7 +205,7 @@ public class HgncAnnotator extends ElementAnnotator implements IExternalService
strings.add(getNodeValue(subnode));
}
}
((Alias) element).setFormerSymbols(strings);
((Element) element).setFormerSymbols(strings);
} else if (type.equals("alias_symbol")) {
List<String> strings = new ArrayList<String>();
NodeList sublist = node.getChildNodes();
......
......@@ -17,13 +17,13 @@ import lcsb.mapviewer.annotation.services.ExternalServiceStatusType;
import lcsb.mapviewer.annotation.services.IExternalService;
import lcsb.mapviewer.common.EventStorageLoggerAppender;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.converter.model.celldesigner.structure.Chemical;
import lcsb.mapviewer.converter.model.celldesigner.structure.CellDesignerChemical;
import lcsb.mapviewer.model.map.AnnotatedObject;
import lcsb.mapviewer.model.map.layout.alias.Alias;
import lcsb.mapviewer.model.map.layout.alias.ChemicalAlias;
import lcsb.mapviewer.model.map.layout.alias.SimpleMoleculeAlias;
import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
import lcsb.mapviewer.model.map.reaction.Reaction;
import lcsb.mapviewer.model.map.species.Element;
import lcsb.mapviewer.model.map.species.Chemical;
import lcsb.mapviewer.model.map.species.SimpleMolecule;
import lcsb.mapviewer.model.map.species.Species;
import lcsb.mapviewer.modelutils.map.ElementUtils;
/**
......@@ -79,7 +79,7 @@ public class ReconAnnotator extends ElementAnnotator implements IExternalService
* Default constructor.
*/
public ReconAnnotator() {
super(ReconAnnotator.class, new Class[] { ChemicalAlias.class, Reaction.class }, false);
super(ReconAnnotator.class, new Class[] { Chemical.class, Reaction.class }, false);
}
@Override
......@@ -91,7 +91,7 @@ public class ReconAnnotator extends ElementAnnotator implements IExternalService
EventStorageLoggerAppender appender = new EventStorageLoggerAppender();
Logger.getRootLogger().addAppender(appender);
try {
SimpleMoleculeAlias smallMoleculeAlias = new SimpleMoleculeAlias("some_id");
SimpleMolecule smallMoleculeAlias = new SimpleMolecule("some_id");
smallMoleculeAlias.setName("h2o");
annotateElement(smallMoleculeAlias);
status.setStatus(ExternalServiceStatusType.OK);
......@@ -124,7 +124,7 @@ public class ReconAnnotator extends ElementAnnotator implements IExternalService
id = tmp[tmp.length - 1];
}
String url = null;
if (annotatedObject instanceof Alias) {
if (annotatedObject instanceof Element) {
url = ELEMENT_ANNOTATION_URL_PREFIX + id;
} else if (annotatedObject instanceof Reaction) {
url = REACTION_ANNOTATION_URL_PREFIX + id;
......@@ -194,20 +194,20 @@ public class ReconAnnotator extends ElementAnnotator implements IExternalService
} else if (key.equals("chargedFormula")) {
setFormula(annotatedObject, value, prefix);
} else if (key.equals("charge")) {
if (annotatedObject instanceof SpeciesAlias) {
setCharge((SpeciesAlias) annotatedObject, value, prefix);
if (annotatedObject instanceof Species) {
setCharge((Species) annotatedObject, value, prefix);
} else {
unknown = true;
}
} else if (key.equals("inchiString")) {
if (annotatedObject instanceof ChemicalAlias) {
setInchi((ChemicalAlias) annotatedObject, value, prefix);
if (annotatedObject instanceof Chemical) {
setInchi((Chemical) annotatedObject, value, prefix);
} else {
unknown = true;
}
} else if (key.equals("smile")) {
if (annotatedObject instanceof Chemical) {
setSmile((ChemicalAlias) annotatedObject, value, prefix);
if (annotatedObject instanceof CellDesignerChemical) {
setSmile((Chemical) annotatedObject, value, prefix);
} else {
unknown = true;
}
......
......@@ -20,9 +20,9 @@ import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.model.map.AnnotatedObject;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamType;
import lcsb.mapviewer.model.map.layout.alias.GeneAlias;
import lcsb.mapviewer.model.map.layout.alias.ProteinAlias;
import lcsb.mapviewer.model.map.layout.alias.RnaAlias;
import lcsb.mapviewer.model.map.species.Gene;
import lcsb.mapviewer.model.map.species.Protein;
import lcsb.mapviewer.model.map.species.Rna;
import lcsb.mapviewer.modelutils.map.ElementUtils;
/**
......@@ -57,7 +57,7 @@ public class UniprotAnnotator extends ElementAnnotator implements IExternalServi
* Default constructor.
*/
public UniprotAnnotator() {
super(UniprotAnnotator.class, new Class[] { ProteinAlias.class, GeneAlias.class, RnaAlias.class }, false);
super(UniprotAnnotator.class, new Class[] { Protein.class, Gene.class, Rna.class }, false);
}
@Override
......
......@@ -15,7 +15,7 @@ import org.junit.Test;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamType;
import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
import lcsb.mapviewer.model.map.species.GenericProtein;
public class ImproperAnnotationsTest {
......@@ -36,7 +36,7 @@ public class ImproperAnnotationsTest {
try {
List<MiriamData> list = new ArrayList<>();
list.add(new MiriamData(MiriamType.CAS, "a"));
ImproperAnnotations ie = new ImproperAnnotations(new GenericProteinAlias("id"), list);
ImproperAnnotations ie = new ImproperAnnotations(new GenericProtein("id"), list);
assertNotNull(ie.toString());
} catch (InvalidArgumentException e) {
assertTrue(e.getMessage().contains("Only miriam data from elements are accepted"));
......@@ -46,7 +46,7 @@ public class ImproperAnnotationsTest {
@Test
public void testConstructor4() {
try {
new ImproperAnnotations(new GenericProteinAlias("id"), new ArrayList<>());
new ImproperAnnotations(new GenericProtein("id"), new ArrayList<>());
fail("Exception expected");
} catch (InvalidArgumentException e) {
assertTrue(e.getMessage().contains("List of improper annotations cannot be null"));
......
......@@ -7,7 +7,7 @@ import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
import lcsb.mapviewer.model.map.species.GenericProtein;
public class MissingAnnotationTest {
......@@ -25,7 +25,7 @@ public class MissingAnnotationTest {
@Test
public void test() {
MissingAnnotation annotation = new MissingAnnotation(new GenericProteinAlias("id"));
MissingAnnotation annotation = new MissingAnnotation(new GenericProtein("id"));
assertTrue(annotation.toString().contains("misses annotations"));
}
......
......@@ -12,7 +12,7 @@ import org.junit.Test;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.model.map.MiriamType;
import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
import lcsb.mapviewer.model.map.species.GenericProtein;
public class MissingRequiredAnnotationsTest {
......@@ -31,7 +31,7 @@ public class MissingRequiredAnnotationsTest {
@Test
public void testConstructorWithInvalidParams() {
try {
new MissingRequiredAnnotations(new GenericProteinAlias("id"), new ArrayList<>());
new MissingRequiredAnnotations(new GenericProtein("id"), new ArrayList<>());
} catch (InvalidArgumentException e) {
assertTrue(e.getMessage().contains("List of improper annotations cannot be null"));
}
......@@ -42,7 +42,7 @@ public class MissingRequiredAnnotationsTest {
try {
List<MiriamType> list = new ArrayList<>();
list.add(MiriamType.CAS);
MissingRequiredAnnotations mre = new MissingRequiredAnnotations(new GenericProteinAlias("id"), list);
MissingRequiredAnnotations mre = new MissingRequiredAnnotations(new GenericProtein("id"), list);
assertTrue(mre.toString().contains("misses one of the following annotations"));
} catch (InvalidArgumentException e) {
assertTrue(e.getMessage().contains("List of improper annotations cannot be null"));
......
......@@ -33,15 +33,15 @@ import lcsb.mapviewer.model.map.AnnotatedObject;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamRelationType;
import lcsb.mapviewer.model.map.MiriamType;