use of ubic.gemma.model.common.description.BibliographicReference in project Gemma by PavlidisLab.
the class ExpressionExperimentBibRefFinderTest method testLocatePrimaryReference.
@Test
public void testLocatePrimaryReference() throws Exception {
ExpressionExperimentBibRefFinder finder = new ExpressionExperimentBibRefFinder();
ExpressionExperiment ee = ExpressionExperiment.Factory.newInstance();
DatabaseEntry de = DatabaseEntry.Factory.newInstance();
ExternalDatabase ed = ExternalDatabase.Factory.newInstance();
ed.setName("GEO");
de.setAccession("GSE3023");
de.setExternalDatabase(ed);
ee.setAccession(de);
try {
BibliographicReference bibref = null;
for (int i = 0; i < 3; i++) {
bibref = finder.locatePrimaryReference(ee);
if (bibref != null)
break;
Thread.sleep(1000);
}
assertNotNull(bibref);
assertEquals("Differential gene expression in anatomical compartments of the human eye.", bibref.getTitle());
} catch (Exception e) {
checkCause(e);
}
}
use of ubic.gemma.model.common.description.BibliographicReference in project Gemma by PavlidisLab.
the class ExpressionExperimentBibRefFinderTest method testLocatePrimaryReferenceInvalidGSE.
@Test
public void testLocatePrimaryReferenceInvalidGSE() throws Exception {
ExpressionExperimentBibRefFinder finder = new ExpressionExperimentBibRefFinder();
ExpressionExperiment ee = ExpressionExperiment.Factory.newInstance();
DatabaseEntry de = DatabaseEntry.Factory.newInstance();
ExternalDatabase ed = ExternalDatabase.Factory.newInstance();
ed.setName("GEO");
de.setAccession("GSE30231111111111111");
de.setExternalDatabase(ed);
ee.setAccession(de);
try {
BibliographicReference bibref = finder.locatePrimaryReference(ee);
assert (bibref == null);
} catch (Exception e) {
checkCause(e);
}
}
use of ubic.gemma.model.common.description.BibliographicReference in project Gemma by PavlidisLab.
the class PubMedXMLParserTest method testParse.
@Test
public void testParse() {
try {
testStream = PubMedXMLParserTest.class.getResourceAsStream("/data/pubmed-test.xml");
Collection<BibliographicReference> brl = testParser.parse(testStream);
BibliographicReference br = brl.iterator().next();
assertEquals("Lee, Homin K; Hsu, Amy K; Sajdak, Jon; Qin, Jie; Pavlidis, Paul", br.getAuthorList());
assertNotNull(br.getAbstractText());
assertEquals("Genome Res", br.getPublication());
assertEquals("15173114", br.getPubAccession().getAccession());
assertEquals("Coexpression analysis of human genes across many microarray data sets.", br.getTitle());
assertNotNull(br.getVolume());
assertNotNull(br.getPages());
SimpleDateFormat f = new SimpleDateFormat("mm/HH/MM/dd/yyyy");
assertEquals("00/00/06/01/2004", f.format(br.getPublicationDate()));
} catch (RuntimeException e) {
this.logOrThrowException(e);
}
}
use of ubic.gemma.model.common.description.BibliographicReference in project Gemma by PavlidisLab.
the class PubMedXMLParserTest method testParseMesh.
@Test
public void testParseMesh() {
try {
testStream = PubMedXMLParserTest.class.getResourceAsStream("/data/pubmed-mesh-test.xml");
Collection<BibliographicReference> brl = testParser.parse(testStream);
BibliographicReference br = brl.iterator().next();
Collection<MedicalSubjectHeading> meshTerms = br.getMeshTerms();
assertEquals(16, meshTerms.size());
// for ( MedicalSubjectHeading heading : meshTerms ) {
// log.info( heading.getTerm() + " " + heading.getIsMajorTopic() );
// for ( MedicalSubjectHeading q : heading.getQualifiers() ) {
// log.info( " qualifier: " + q.getTerm() + " " + q.getIsMajorTopic() );
// }
// }
} catch (RuntimeException e) {
this.logOrThrowException(e);
}
}
use of ubic.gemma.model.common.description.BibliographicReference in project Gemma by PavlidisLab.
the class PubMedXMLParserTest method testParseBookArticle.
/*
* Test uses 2030131
*/
@Test
public void testParseBookArticle() {
try {
testStream = PubMedXMLParserTest.class.getResourceAsStream("/data/pubmed-bookarticle.xml");
Collection<BibliographicReference> brl = testParser.parse(testStream);
BibliographicReference br = brl.iterator().next();
assertNotNull(br);
assertEquals("Pagon, Roberta A; Bird, Thomas D; Dolan, Cynthia R; Stephens, Karen", br.getEditor());
assertEquals("Kuhlenbaumer, Gregor; Timmerman, Vincent", br.getAuthorList());
assertEquals("GeneReviews", br.getPublication());
assertEquals("Giant Axonal Neuropathy", br.getTitle());
SimpleDateFormat f = new SimpleDateFormat("yyyy");
Date publicationDate = br.getPublicationDate();
assertNotNull(publicationDate);
assertEquals("2003", f.format(publicationDate));
assertTrue(br.getAbstractText().startsWith("Giant axonal neuropathy (GAN) is characterized by a severe early-onset"));
assertTrue(br.getAbstractText().endsWith("offering custom prenatal testing if the disease-causing mutations in a family are known."));
} catch (RuntimeException e) {
this.logOrThrowException(e);
}
}
Aggregations