Search in sources :

Example 1 with SolidRunDto

use of uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto in project miso-lims by miso-lims.

the class Dtos method getPlatformRunDto.

private static RunDto getPlatformRunDto(@Nonnull Run from) {
    if (from instanceof IlluminaRun) {
        IlluminaRunDto dto = new IlluminaRunDto();
        IlluminaRun illuminaRun = (IlluminaRun) from;
        setString(dto::setWorkflowType, maybeGetProperty(illuminaRun.getWorkflowType(), IlluminaWorkflowType::getRawValue));
        dto.setNumCycles(illuminaRun.getNumCycles());
        dto.setCalledCycles(illuminaRun.getCallCycle());
        dto.setImagedCycles(illuminaRun.getImgCycle());
        dto.setScoredCycles(illuminaRun.getScoreCycle());
        dto.setPairedEnd(illuminaRun.getPairedEnd());
        setString(dto::setBasesMask, illuminaRun.getRunBasesMask());
        return dto;
    } else if (from instanceof IonTorrentRun) {
        return new IonTorrentRunDto();
    } else if (from instanceof LS454Run) {
        Ls454RunDto dto = new Ls454RunDto();
        LS454Run ls454Run = (LS454Run) from;
        dto.setCycles(ls454Run.getCycles());
        dto.setPairedEnd(ls454Run.getPairedEnd());
        return dto;
    } else if (from instanceof SolidRun) {
        SolidRunDto dto = new SolidRunDto();
        SolidRun solidRun = (SolidRun) from;
        dto.setPairedEnd(solidRun.getPairedEnd());
        return dto;
    } else if (from instanceof OxfordNanoporeRun) {
        OxfordNanoporeRunDto dto = new OxfordNanoporeRunDto();
        OxfordNanoporeRun ontRun = (OxfordNanoporeRun) from;
        setString(dto::setMinKnowVersion, ontRun.getMinKnowVersion());
        setString(dto::setProtocolVersion, ontRun.getProtocolVersion());
        return dto;
    } else if (from instanceof PacBioRun) {
        return new PacBioRunDto();
    } else {
        throw new IllegalArgumentException("Unknown run type");
    }
}
Also used : IonTorrentRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto) LS454Run(uk.ac.bbsrc.tgac.miso.core.data.LS454Run) OxfordNanoporeRun(uk.ac.bbsrc.tgac.miso.core.data.OxfordNanoporeRun) SolidRunDto(uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto) OxfordNanoporeRunDto(uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto) IlluminaRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto) PacBioRun(uk.ac.bbsrc.tgac.miso.core.data.PacBioRun) IonTorrentRun(uk.ac.bbsrc.tgac.miso.core.data.IonTorrentRun) SolidRun(uk.ac.bbsrc.tgac.miso.core.data.SolidRun) IlluminaRun(uk.ac.bbsrc.tgac.miso.core.data.IlluminaRun) Ls454RunDto(uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto) PacBioRunDto(uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto)

Example 2 with SolidRunDto

use of uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto in project miso-lims by miso-lims.

the class Dtos method getPlatformRun.

private static Run getPlatformRun(RunDto from) {
    if (from instanceof IlluminaRunDto) {
        IlluminaRun run = new IlluminaRun();
        IlluminaRunDto illuminaDto = (IlluminaRunDto) from;
        setObject(run::setWorkflowType, illuminaDto.getWorkflowType(), wf -> IlluminaWorkflowType.get(wf));
        run.setNumCycles(illuminaDto.getNumCycles());
        run.setCallCycle(illuminaDto.getCalledCycles());
        run.setImgCycle(illuminaDto.getImagedCycles());
        run.setScoreCycle(illuminaDto.getScoredCycles());
        run.setPairedEnd(illuminaDto.getPairedEnd());
        setString(run::setRunBasesMask, illuminaDto.getBasesMask());
        return run;
    } else if (from instanceof IonTorrentRunDto) {
        return new IonTorrentRun();
    } else if (from instanceof Ls454RunDto) {
        LS454Run run = new LS454Run();
        Ls454RunDto ls454Dto = (Ls454RunDto) from;
        run.setCycles(ls454Dto.getCycles());
        run.setPairedEnd(ls454Dto.getPairedEnd());
        return run;
    } else if (from instanceof SolidRunDto) {
        SolidRun run = new SolidRun();
        SolidRunDto solidDto = (SolidRunDto) from;
        run.setPairedEnd(solidDto.getPairedEnd());
        return run;
    } else if (from instanceof OxfordNanoporeRunDto) {
        OxfordNanoporeRun run = new OxfordNanoporeRun();
        OxfordNanoporeRunDto ontDto = (OxfordNanoporeRunDto) from;
        setString(run::setMinKnowVersion, ontDto.getMinKnowVersion());
        setString(run::setProtocolVersion, ontDto.getProtocolVersion());
        return run;
    } else if (from instanceof PacBioRunDto) {
        return new PacBioRun();
    } else {
        throw new IllegalArgumentException("Unknown run type");
    }
}
Also used : IonTorrentRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto) LS454Run(uk.ac.bbsrc.tgac.miso.core.data.LS454Run) OxfordNanoporeRun(uk.ac.bbsrc.tgac.miso.core.data.OxfordNanoporeRun) SolidRunDto(uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto) OxfordNanoporeRunDto(uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto) IlluminaRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto) PacBioRun(uk.ac.bbsrc.tgac.miso.core.data.PacBioRun) IonTorrentRun(uk.ac.bbsrc.tgac.miso.core.data.IonTorrentRun) SolidRun(uk.ac.bbsrc.tgac.miso.core.data.SolidRun) IlluminaRun(uk.ac.bbsrc.tgac.miso.core.data.IlluminaRun) Ls454RunDto(uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto) PacBioRunDto(uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto)

Aggregations

IlluminaRun (uk.ac.bbsrc.tgac.miso.core.data.IlluminaRun)2 IonTorrentRun (uk.ac.bbsrc.tgac.miso.core.data.IonTorrentRun)2 LS454Run (uk.ac.bbsrc.tgac.miso.core.data.LS454Run)2 OxfordNanoporeRun (uk.ac.bbsrc.tgac.miso.core.data.OxfordNanoporeRun)2 PacBioRun (uk.ac.bbsrc.tgac.miso.core.data.PacBioRun)2 SolidRun (uk.ac.bbsrc.tgac.miso.core.data.SolidRun)2 IlluminaRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto)2 IonTorrentRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto)2 Ls454RunDto (uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto)2 OxfordNanoporeRunDto (uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto)2 PacBioRunDto (uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto)2 SolidRunDto (uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto)2