Search in sources :

Example 1 with Description

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

the class BlastServiceImpl method blastIsoformSequence.

@Override
public BlastProgramOutput blastIsoformSequence(BlastIsoformInput params) {
    String isoformAccession = params.getIsoformAccession();
    String entryAccession = isoformAccession.split("-")[0];
    try {
        Isoform isoform = getIsoform(isoformAccession, entryAccession);
        params.setSequence(isoform.getSequence());
        params.validateSequencePositions();
        params.setSequence(params.getSequence().substring(params.getBeginPos() - 1, params.getEndPos()));
        params.setTitle(buildTitle(params, isoform, entryAccession));
        params.setEntryAccession(entryAccession);
        Description queryDescription = new Description();
        blastResultUpdaterService.updateDescription(queryDescription, isoformAccession, entryAccession);
        params.setDescription(queryDescription);
        return blastProteinSequence(params);
    } catch (ExceptionWithReason exceptionWithReason) {
        return new BlastProgramFailure(params, exceptionWithReason);
    }
}
Also used : Description(org.nextprot.api.blast.domain.gen.Description) Isoform(org.nextprot.api.core.domain.Isoform) ExceptionWithReason(org.nextprot.api.commons.utils.ExceptionWithReason)

Aggregations

Description (org.nextprot.api.blast.domain.gen.Description)1 ExceptionWithReason (org.nextprot.api.commons.utils.ExceptionWithReason)1 Isoform (org.nextprot.api.core.domain.Isoform)1