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

unused method removed

parent d8636777
No related branches found
No related tags found
1 merge request!595Resolve "Small molecules annotators to be rearranged"
......@@ -238,32 +238,6 @@ public class EnsemblAnnotator extends ElementAnnotator implements IExternalServi
}
}
/**
* Converts {@link MiriamType#ENSEMBL} identifier into {@link MiriamType#ENTREZ}
* identifier.
*
* @param miriamData
* {@link MiriamData} with {@link MiriamType#ENSEMBL} identifier
* @return {@link MiriamData} with {@link MiriamType#ENTREZ} or null if such
* identifier doesn't exists
* @throws AnnotatorException
* thrown when there was problem with accessing external database or
* any other unknown problem
*/
public MiriamData ensemblIdToEntrezId(MiriamData miriamData) throws AnnotatorException {
if (!MiriamType.ENSEMBL.equals(miriamData.getDataType())) {
throw new InvalidArgumentException("Only " + MiriamType.ENSEMBL + " identifier is accepted as an input");
}
GenericProtein proteinAlias = new GenericProtein("id");
annotateElement(proteinAlias, miriamData, "");
for (MiriamData md : proteinAlias.getMiriamData()) {
if (MiriamType.ENTREZ.equals(md.getDataType())) {
return md;
}
}
return null;
}
@Override
protected WebPageDownloader getWebPageDownloader() {
return super.getWebPageDownloader();
......
......@@ -241,45 +241,6 @@ public class EnsemblAnnotatorTest extends AnnotationTestFunctions {
}
}
@Test
public void testEnsemblToEntrez() throws Exception {
try {
MiriamData ensembl = new MiriamData(MiriamType.ENSEMBL, "ENSG00000154930");
MiriamData entrez = ensemblAnnotator.ensemblIdToEntrezId(ensembl);
assertEquals(new MiriamData(MiriamType.ENTREZ, "84532", EnsemblAnnotator.class), entrez);
} catch (Exception e) {
e.printStackTrace();
throw e;
}
}
@Test
public void testInvalidEnsemblToEntrez() throws Exception {
try {
MiriamData ensembl = new MiriamData(MiriamType.WIKIPEDIA, "ENSG00000154930");
ensemblAnnotator.ensemblIdToEntrezId(ensembl);
fail("Exception expected");
} catch (InvalidArgumentException e) {
} catch (Exception e) {
e.printStackTrace();
throw e;
}
}
@Test
public void testEnsemblToEntrez2() throws Exception {
try {
MiriamData ensembl = new MiriamData(MiriamType.ENSEMBL, "ENSRNOG00000050619");
MiriamData entrez = ensemblAnnotator.ensemblIdToEntrezId(ensembl);
assertNull(entrez);
} catch (Exception e) {
e.printStackTrace();
throw e;
}
}
@Test
public void testAnnotateWhenEntrezReturnWrongResponse() throws Exception {
WebPageDownloader downloader = ensemblAnnotator.getWebPageDownloader();
......
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