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

list of implemented annotators is provided by spring

parent ce85cfcd
No related branches found
No related tags found
1 merge request!595Resolve "Small molecules annotators to be rearranged"
......@@ -10,30 +10,13 @@ import java.util.Map;
import java.util.Queue;
import java.util.Set;
import javax.annotation.PostConstruct;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import lcsb.mapviewer.annotation.services.annotators.AnnotationParameters;
import lcsb.mapviewer.annotation.services.annotators.AnnotatorException;
import lcsb.mapviewer.annotation.services.annotators.BiocompendiumAnnotator;
import lcsb.mapviewer.annotation.services.annotators.BrendaAnnotator;
import lcsb.mapviewer.annotation.services.annotators.CazyAnnotator;
import lcsb.mapviewer.annotation.services.annotators.ChebiAnnotator;
import lcsb.mapviewer.annotation.services.annotators.ElementAnnotator;
import lcsb.mapviewer.annotation.services.annotators.EnsemblAnnotator;
import lcsb.mapviewer.annotation.services.annotators.EntrezAnnotator;
import lcsb.mapviewer.annotation.services.annotators.GoAnnotator;
import lcsb.mapviewer.annotation.services.annotators.HgncAnnotator;
import lcsb.mapviewer.annotation.services.annotators.KeggAnnotator;
import lcsb.mapviewer.annotation.services.annotators.PdbAnnotator;
import lcsb.mapviewer.annotation.services.annotators.ReconAnnotator;
import lcsb.mapviewer.annotation.services.annotators.StitchAnnotator;
import lcsb.mapviewer.annotation.services.annotators.StringAnnotator;
import lcsb.mapviewer.annotation.services.annotators.TairAnnotator;
import lcsb.mapviewer.annotation.services.annotators.UniprotAnnotator;
import lcsb.mapviewer.common.IProgressUpdater;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.model.map.BioEntity;
......@@ -77,84 +60,6 @@ public class ModelAnnotator {
*/
private static Logger logger = Logger.getLogger(ModelAnnotator.class);
/**
* BRENDA annotator.
*/
private BrendaAnnotator brendaAnnotator;
/**
* Service accessing <a href= "http://biocompendium.embl.de/" >internal
* annotating service</a>.
*/
private BiocompendiumAnnotator biocompendiumAnnotator;
/**
* CAZy annotator.
*/
private CazyAnnotator cazyAnnotator;
/**
* Backend to the chebi database.
*/
private ChebiAnnotator chebiBackend;
/**
* Uniprot annotator.
*/
private UniprotAnnotator uniprotAnnotator;
/**
* PDB annotator.
*/
private PdbAnnotator pdbAnnotator;
/**
* Recon annotator.
*/
private ReconAnnotator reconAnnotator;
/**
* Service accessing <a href= "http://www.ebi.ac.uk/QuickGO/" >Gene
* Ontology</a>.
*/
private GoAnnotator goAnnotator;
/**
* Service accessing <a href= "http://www.genenames.org/" >HUGO Gene
* Nomenclature Committee</a>.
*/
private HgncAnnotator hgncAnnotator;
/**
* Service accessing <a href= "http://www.kegg.jp/" > KEGG EC Nomenclature</a>.
*/
private KeggAnnotator keggAnnotator;
/**
* Service accessing <a href= "http://www.ncbi.nlm.nih.gov/gene/" >Entrez</a>.
*/
private EntrezAnnotator entrezAnnotator;
/**
* Service accessing <a href= "http://ensembl.org">Ensembl</a>.
*/
private EnsemblAnnotator ensemblAnnotator;
/**
* STITCH annotator.
*/
private StitchAnnotator stitchAnnotator;
/**
* STRING annotator.
*/
private StringAnnotator stringAnnotator;
/**
* TAIR annotator.
*/
private TairAnnotator tairAnnotator;
/**
* List of all avaliable {@link ElementAnnotator} objects.
*/
......@@ -169,76 +74,14 @@ public class ModelAnnotator {
* Constructor
*/
@Autowired
public ModelAnnotator(MiriamConnector miriamConnector,
BrendaAnnotator brendaAnnotator,
BiocompendiumAnnotator biocompendiumAnnotator,
CazyAnnotator cazyAnnotator,
ChebiAnnotator chebiBackend,
UniprotAnnotator uniprotAnnotator,
PdbAnnotator pdbAnnotator,
ReconAnnotator reconAnnotator,
GoAnnotator goAnnotator,
HgncAnnotator hgncAnnotator,
KeggAnnotator keggAnnotator,
EntrezAnnotator entrezAnnotator,
EnsemblAnnotator ensemblAnnotator,
StitchAnnotator stitchAnnotator,
StringAnnotator stringAnnotator,
TairAnnotator tairAnnotator) {
public ModelAnnotator(MiriamConnector miriamConnector, List<ElementAnnotator> availableAnnotators) {
this.miriamConnector = miriamConnector;
this.brendaAnnotator = brendaAnnotator;
this.biocompendiumAnnotator = biocompendiumAnnotator;
this.cazyAnnotator = cazyAnnotator;
this.chebiBackend = chebiBackend;
this.uniprotAnnotator = uniprotAnnotator;
this.pdbAnnotator = pdbAnnotator;
this.reconAnnotator = reconAnnotator;
this.goAnnotator = goAnnotator;
this.hgncAnnotator = hgncAnnotator;
this.keggAnnotator = keggAnnotator;
this.entrezAnnotator = entrezAnnotator;
this.ensemblAnnotator = ensemblAnnotator;
this.stitchAnnotator = stitchAnnotator;
this.stringAnnotator = stringAnnotator;
this.tairAnnotator = tairAnnotator;
}
/**
* Post intintialization method. Will be called after spring creates beans and
* set the list of valid annotators.
*/
@PostConstruct
public final void init() {
availableAnnotators = new ArrayList<>();
this.availableAnnotators = availableAnnotators;
defaultAnnotators = new ArrayList<>();
addAnnotator(brendaAnnotator);
addAnnotator(biocompendiumAnnotator);
addAnnotator(cazyAnnotator);
addAnnotator(chebiBackend);
addAnnotator(uniprotAnnotator);
addAnnotator(goAnnotator);
addAnnotator(hgncAnnotator);
addAnnotator(keggAnnotator);
addAnnotator(pdbAnnotator);
addAnnotator(reconAnnotator);
addAnnotator(entrezAnnotator);
addAnnotator(ensemblAnnotator);
addAnnotator(stitchAnnotator);
addAnnotator(stringAnnotator);
addAnnotator(tairAnnotator);
}
/**
* Adds annotator list of available annotators in {@link ModelAnnotator} class.
*
* @param annotator
* {@link ElementAnnotator} annotator o add
*/
private void addAnnotator(ElementAnnotator annotator) {
availableAnnotators.add(annotator);
if (annotator.isDefault()) {
defaultAnnotators.add(annotator);
for (ElementAnnotator annotator : availableAnnotators) {
if (annotator.isDefault()) {
defaultAnnotators.add(annotator);
}
}
}
......
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