use of ubic.gemma.model.common.description.BibliographicReference in project Gemma by PavlidisLab.
the class LoadEvidenceForClassifier method findMeshTerms.
// return mesh term of a pubmed format : meshTerm1;meshTerm2;meshTerms3.... etc
private String findMeshTerms(String pubmed) {
StringBuilder result = new StringBuilder();
DatabaseEntry de = DatabaseEntry.Factory.newInstance();
de.setAccession(pubmed);
BibliographicReference bi = BibliographicReference.Factory.newInstance();
bi.setPubAccession(de);
System.out.println(pubmed);
BibliographicReference b = this.bibliographicReferenceService.find(bi);
for (MedicalSubjectHeading m : b.getMeshTerms()) {
result.append(m.getTerm()).append(";");
}
return result.toString();
}
use of ubic.gemma.model.common.description.BibliographicReference in project Gemma by PavlidisLab.
the class SearchServiceTest method testSearchByBibRefIdProblemsB.
@Test
public void testSearchByBibRefIdProblemsB() {
try {
this.setup();
} catch (Exception e) {
e.printStackTrace();
}
PubMedXMLFetcher fetcher = new PubMedXMLFetcher();
BibliographicReference bibref = fetcher.retrieveByHTTP(22780917);
bibref = (BibliographicReference) persisterHelper.persist(bibref);
assertTrue(bibref.getAbstractText().contains("d to chromosome 22q12. Our results confirm chromosome 22q12 as the solitary locus for FFEVF"));
IndexerTaskCommand c = new IndexerTaskCommand();
c.setIndexBibRef(true);
indexerTask.setTaskCommand(c);
indexerTask.execute();
SearchSettings settings = SearchSettings.Factory.newInstance();
settings.noSearches();
settings.setQuery("confirm chromosome 22q12");
settings.setSearchBibrefs(true);
Map<Class<?>, List<SearchResult>> found = this.searchService.search(settings);
assertTrue(!found.isEmpty());
for (SearchResult sr : found.get(BibliographicReference.class)) {
if (sr.getResultObject().equals(bibref)) {
this.tearDown();
return;
}
}
this.tearDown();
fail("Didn't get expected result from search");
}
use of ubic.gemma.model.common.description.BibliographicReference in project Gemma by PavlidisLab.
the class SearchServiceTest method testSearchByBibRefIdProblems.
@Test
public void testSearchByBibRefIdProblems() {
try {
this.setup();
} catch (Exception e) {
e.printStackTrace();
}
PubMedXMLFetcher fetcher = new PubMedXMLFetcher();
BibliographicReference bibref = fetcher.retrieveByHTTP(9600966);
bibref = (BibliographicReference) persisterHelper.persist(bibref);
assertTrue(bibref.getAbstractText().contains("ase proved to be a de novo mutation. In the third kindred, affected brothers both have a"));
IndexerTaskCommand c = new IndexerTaskCommand();
c.setIndexBibRef(true);
indexerTask.setTaskCommand(c);
indexerTask.execute();
SearchSettings settings = SearchSettings.Factory.newInstance();
settings.noSearches();
settings.setQuery("de novo mutation");
settings.setSearchBibrefs(true);
Map<Class<?>, List<SearchResult>> found = this.searchService.search(settings);
assertTrue(!found.isEmpty());
for (SearchResult sr : found.get(BibliographicReference.class)) {
if (sr.getResultObject().equals(bibref)) {
this.tearDown();
return;
}
}
this.tearDown();
fail("Didn't get expected result from search");
}
use of ubic.gemma.model.common.description.BibliographicReference in project Gemma by PavlidisLab.
the class BibliographicReferenceServiceImplTest method testFindByExternalId.
@Test
public final void testFindByExternalId() {
BibliographicReference mockBR = BibliographicReference.Factory.newInstance();
mockBR.setPubAccession(de);
mockBR.setTitle("My Title");
brdao.findByExternalId("12345", "PUBMED");
expectLastCall().andReturn(mockBR);
replay(brdao);
svc.findByExternalId("12345", "PUBMED");
verify(brdao);
}
use of ubic.gemma.model.common.description.BibliographicReference in project Gemma by PavlidisLab.
the class PubMedXMLFetcherTest method testRetrieveByHTTPNotFound.
@Test
public final void testRetrieveByHTTPNotFound() {
try {
BibliographicReference br = pmf.retrieveByHTTP(1517311444);
assertNull(br);
} catch (RuntimeException e) {
this.checkCause(e);
}
}
Aggregations