Search in sources :

Example 1 with IndexerTaskCommand

use of ubic.gemma.core.tasks.maintenance.IndexerTaskCommand in project Gemma by PavlidisLab.

the class IndexServiceImpl method indexGenes.

@Override
public String indexGenes() {
    IndexerTaskCommand command = new IndexerTaskCommand();
    command.setIndexGene(true);
    return taskRunningService.submitLocalTask(new IndexerJob(command));
}
Also used : IndexerTaskCommand(ubic.gemma.core.tasks.maintenance.IndexerTaskCommand)

Example 2 with IndexerTaskCommand

use of ubic.gemma.core.tasks.maintenance.IndexerTaskCommand in project Gemma by PavlidisLab.

the class IndexServiceImpl method indexAll.

@Override
public String indexAll() {
    IndexerTaskCommand command = new IndexerTaskCommand();
    command.setAll(true);
    return taskRunningService.submitLocalTask(new IndexerJob(command));
}
Also used : IndexerTaskCommand(ubic.gemma.core.tasks.maintenance.IndexerTaskCommand)

Example 3 with IndexerTaskCommand

use of ubic.gemma.core.tasks.maintenance.IndexerTaskCommand in project Gemma by PavlidisLab.

the class IndexServiceImpl method indexExpressionExperiments.

@Override
public String indexExpressionExperiments() {
    IndexerTaskCommand command = new IndexerTaskCommand();
    command.setIndexEE(true);
    return taskRunningService.submitLocalTask(new IndexerJob(command));
}
Also used : IndexerTaskCommand(ubic.gemma.core.tasks.maintenance.IndexerTaskCommand)

Example 4 with IndexerTaskCommand

use of ubic.gemma.core.tasks.maintenance.IndexerTaskCommand in project Gemma by PavlidisLab.

the class SearchServiceTest method testSearchByBibRefId.

@Test
public void testSearchByBibRefId() {
    try {
        this.setup();
    } catch (Exception e) {
        e.printStackTrace();
    }
    String id;
    if (ee.getPrimaryPublication() == null) {
        PubMedXMLFetcher fetcher = new PubMedXMLFetcher();
        BibliographicReference bibref = fetcher.retrieveByHTTP(21878914);
        bibref = (BibliographicReference) persisterHelper.persist(bibref);
        ee.setPrimaryPublication(bibref);
        eeService.update(ee);
        id = "21878914";
    } else {
        id = ee.getPrimaryPublication().getPubAccession().getAccession();
    }
    log.info("indexing ...");
    IndexerTaskCommand c = new IndexerTaskCommand();
    c.setIndexBibRef(true);
    indexerTask.setTaskCommand(c);
    indexerTask.execute();
    SearchSettings settings = SearchSettings.Factory.newInstance();
    settings.noSearches();
    settings.setQuery(id);
    settings.setSearchExperiments(true);
    settings.setUseCharacteristics(false);
    Map<Class<?>, List<SearchResult>> found = this.searchService.search(settings);
    assertTrue(!found.isEmpty());
    for (SearchResult sr : found.get(ExpressionExperiment.class)) {
        if (sr.getResultObject().equals(ee)) {
            this.tearDown();
            return;
        }
    }
    this.tearDown();
    fail("Didn't get expected result from search");
}
Also used : IndexerTaskCommand(ubic.gemma.core.tasks.maintenance.IndexerTaskCommand) SearchSettings(ubic.gemma.model.common.search.SearchSettings) PubMedXMLFetcher(ubic.gemma.core.loader.entrez.pubmed.PubMedXMLFetcher) BibliographicReference(ubic.gemma.model.common.description.BibliographicReference) Test(org.junit.Test) BaseSpringContextTest(ubic.gemma.core.testing.BaseSpringContextTest)

Example 5 with IndexerTaskCommand

use of ubic.gemma.core.tasks.maintenance.IndexerTaskCommand 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");
}
Also used : IndexerTaskCommand(ubic.gemma.core.tasks.maintenance.IndexerTaskCommand) SearchSettings(ubic.gemma.model.common.search.SearchSettings) PubMedXMLFetcher(ubic.gemma.core.loader.entrez.pubmed.PubMedXMLFetcher) BibliographicReference(ubic.gemma.model.common.description.BibliographicReference) Test(org.junit.Test) BaseSpringContextTest(ubic.gemma.core.testing.BaseSpringContextTest)

Aggregations

IndexerTaskCommand (ubic.gemma.core.tasks.maintenance.IndexerTaskCommand)10 Test (org.junit.Test)3 PubMedXMLFetcher (ubic.gemma.core.loader.entrez.pubmed.PubMedXMLFetcher)3 BaseSpringContextTest (ubic.gemma.core.testing.BaseSpringContextTest)3 BibliographicReference (ubic.gemma.model.common.description.BibliographicReference)3 SearchSettings (ubic.gemma.model.common.search.SearchSettings)3