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);
}
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());
}
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);
}
}
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());
}
Aggregations