Search in sources :

Example 1 with Report

use of org.nextprot.api.blast.domain.gen.Report in project nextprot-api by calipho-sib.

the class BlastResultUpdaterServiceImplTest method updateShouldDefineNewFields.

@Test
public void updateShouldDefineNewFields() throws Exception {
    Report blastResult = runBlast();
    Assert.assertNull(blastResult.getResults().getSearch().getHits().get(0).getHsps().get(0).getIdentityPercent());
    updater.update(blastResult, "GTTYVTDKSEEDNEIESEEEVQPKTQGSRR");
    Assert.assertNotNull(blastResult.getResults().getSearch().getHits().get(0).getHsps().get(0).getIdentityPercent());
    GlobalHit globalHit = blastResult.getResults().getSearch().getHits().get(0).getGlobalHit();
    Assert.assertEquals(100, globalHit.getIdentityPercent(), 0.01);
    Assert.assertEquals(148, globalHit.getTotalScore(), 0.01);
    Assert.assertEquals(1.45816e-12, globalHit.getMinEvalue(), 0.01);
    Assert.assertEquals(148, globalHit.getMaxScore(), 0.01);
}
Also used : GlobalHit(org.nextprot.api.blast.domain.GlobalHit) Report(org.nextprot.api.blast.domain.gen.Report) Test(org.junit.Test)

Example 2 with Report

use of org.nextprot.api.blast.domain.gen.Report in project nextprot-api by calipho-sib.

the class BlastResultUpdaterServiceImplTest method updateShouldSetSomeFieldsToNull.

@Test
public void updateShouldSetSomeFieldsToNull() throws Exception {
    Report blastResult = runBlast();
    Assert.assertNotNull(blastResult.getReference());
    Assert.assertNotNull(blastResult.getResults().getSearch().getQueryTitle());
    Assert.assertNotNull(blastResult.getResults().getSearch().getQueryLen());
    Assert.assertNotNull(blastResult.getResults().getSearch().getStat().getEntropy());
    updater.update(blastResult, "GTTYVTDKSEEDNEIESEEEVQPKTQGSRR");
    Assert.assertNull(blastResult.getReference());
    Assert.assertNull(blastResult.getResults().getSearch().getQueryId());
    Assert.assertNull(blastResult.getResults().getSearch().getStat().getEntropy());
    Assert.assertNull(blastResult.getResults().getSearch().getQueryTitle());
    Assert.assertNull(blastResult.getResults().getSearch().getQueryLen());
}
Also used : Report(org.nextprot.api.blast.domain.gen.Report) Test(org.junit.Test)

Example 3 with Report

use of org.nextprot.api.blast.domain.gen.Report in project nextprot-api by calipho-sib.

the class BlastServiceImpl method blastProteinSequence.

@Override
public BlastProgramOutput blastProteinSequence(BlastSequenceInput params) {
    try {
        BlastPRunner.FastaEntry fastaEntry = new BlastPRunner.FastaEntry(params.getTitle(), params.getSequence());
        Report result = new BlastPRunner(params).run(fastaEntry);
        blastResultUpdaterService.update(result, fastaEntry.getSequence());
        return new BlastProgramSuccess(params, result);
    } catch (ExceptionWithReason exceptionWithReason) {
        return new BlastProgramFailure(params, exceptionWithReason);
    }
}
Also used : Report(org.nextprot.api.blast.domain.gen.Report) ExceptionWithReason(org.nextprot.api.commons.utils.ExceptionWithReason)

Example 4 with Report

use of org.nextprot.api.blast.domain.gen.Report in project nextprot-api by calipho-sib.

the class BlastPRunnerTest method blastpShouldFindResult.

@Test
public void blastpShouldFindResult() throws Exception {
    config = new BlastSequenceInput(blastBinPath, blastDb);
    BlastPRunner runner = new BlastPRunner(config);
    Report blastReport = runner.run(new BlastPRunner.FastaEntry("subseq 211-239 of NX_P52701", "GTTYVTDKSEEDNEIESEEEVQPKTQGSRR"));
    Assert.assertNull(config.getBinPath());
    Assert.assertNull(config.getNextprotBlastDbPath());
    Assert.assertEquals(4, blastReport.getResults().getSearch().getHits().size());
}
Also used : Report(org.nextprot.api.blast.domain.gen.Report) BlastSequenceInput(org.nextprot.api.blast.domain.BlastSequenceInput) Test(org.junit.Test)

Aggregations

Report (org.nextprot.api.blast.domain.gen.Report)4 Test (org.junit.Test)3 BlastSequenceInput (org.nextprot.api.blast.domain.BlastSequenceInput)1 GlobalHit (org.nextprot.api.blast.domain.GlobalHit)1 ExceptionWithReason (org.nextprot.api.commons.utils.ExceptionWithReason)1