Search in sources :

Example 1 with RunPurpose

use of uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose in project miso-lims by miso-lims.

the class Dtos method to.

public static Instrument to(@Nonnull InstrumentDto dto) {
    Instrument to = new InstrumentImpl();
    setLong(to::setId, dto.getId(), false);
    setDate(to::setDateCommissioned, dto.getDateCommissioned());
    setDate(to::setDateDecommissioned, dto.getDateDecommissioned());
    setString(to::setName, dto.getName());
    setObject(to::setInstrumentModel, InstrumentModel::new, dto.getInstrumentModelId());
    setString(to::setSerialNumber, dto.getSerialNumber());
    setObject(to::setUpgradedInstrument, InstrumentImpl::new, dto.getUpgradedInstrumentId());
    setObject(to::setDefaultRunPurpose, RunPurpose::new, dto.getDefaultRunPurposeId());
    setString(to::setIdentificationBarcode, dto.getIdentificationBarcode());
    setObject(to::setWorkstation, Workstation::new, dto.getWorkstationId());
    return to;
}
Also used : Workstation(uk.ac.bbsrc.tgac.miso.core.data.Workstation) RunPurpose(uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose) InstrumentImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.InstrumentImpl) Instrument(uk.ac.bbsrc.tgac.miso.core.data.Instrument) InstrumentModel(uk.ac.bbsrc.tgac.miso.core.data.InstrumentModel) IonTorrentRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto) QcHierarchyNodeDto(uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto) RunPositionDto(uk.ac.bbsrc.tgac.miso.dto.run.RunPositionDto) PacBioRunDto(uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto) Ls454RunDto(uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto) IlluminaNotificationDto(ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto) OxfordNanoporeRunDto(uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto) IlluminaRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto) NotificationDto(ca.on.oicr.gsi.runscanner.dto.NotificationDto) OxfordNanoporeNotificationDto(ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto) RunDto(uk.ac.bbsrc.tgac.miso.dto.run.RunDto) SolidRunDto(uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto) OrderAliquotDto(uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto)

Example 2 with RunPurpose

use of uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose in project miso-lims by miso-lims.

the class Dtos method to.

public static RunPartitionAliquot to(@Nonnull RunPartitionAliquotDto from) {
    RunPartitionAliquot to = new RunPartitionAliquot();
    PlatformType platform = PlatformType.valueOf(from.getPlatformType());
    setObject(to::setRun, platform::createRun, from.getRunId());
    setObject(to::setPartition, PartitionImpl::new, from.getPartitionId());
    setObject(to::setAliquot, LibraryAliquot::new, from.getAliquotId());
    setObject(to::setPurpose, RunPurpose::new, from.getRunPurposeId());
    setObject(to::setQcStatus, RunLibraryQcStatus::new, from.getQcStatusId());
    setString(to::setQcNote, from.getQcNote());
    setBoolean(to::setDataReview, from.getDataReview(), true);
    return to;
}
Also used : RunPurpose(uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose) RunPartitionAliquot(uk.ac.bbsrc.tgac.miso.core.data.RunPartitionAliquot) PartitionImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.PartitionImpl) IonTorrentRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto) QcHierarchyNodeDto(uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto) RunPositionDto(uk.ac.bbsrc.tgac.miso.dto.run.RunPositionDto) PacBioRunDto(uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto) Ls454RunDto(uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto) IlluminaNotificationDto(ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto) OxfordNanoporeRunDto(uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto) IlluminaRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto) NotificationDto(ca.on.oicr.gsi.runscanner.dto.NotificationDto) OxfordNanoporeNotificationDto(ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto) RunDto(uk.ac.bbsrc.tgac.miso.dto.run.RunDto) SolidRunDto(uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto) OrderAliquotDto(uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto) TransferLibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferLibraryAliquot) WorksetLibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.workset.WorksetLibraryAliquot) OrderLibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.OrderLibraryAliquot) DetailedLibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedLibraryAliquot) LibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot) PlatformType(uk.ac.bbsrc.tgac.miso.core.data.type.PlatformType) RunLibraryQcStatus(uk.ac.bbsrc.tgac.miso.core.data.RunLibraryQcStatus)

Example 3 with RunPurpose

use of uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose in project miso-lims by miso-lims.

the class RunRestController method setPartitionPurposes.

@PutMapping("/{runId}/partition-purposes")
@ResponseStatus(HttpStatus.NO_CONTENT)
public void setPartitionPurposes(@PathVariable long runId, @RequestBody RunPartitionPurposeRequest request) throws IOException {
    Run run = RestUtils.retrieve("Run", runId, runService);
    RunPurpose purpose = RestUtils.retrieve("Run purpose", request.getRunPurposeId(), runPurposeService);
    List<Partition> partitions = run.getSequencerPartitionContainers().stream().flatMap(container -> container.getPartitions().stream()).filter(partition -> request.getPartitionIds().contains(partition.getId())).collect(Collectors.toList());
    for (Partition partition : partitions) {
        RunPartition runPartition = runPartitionService.get(run, partition);
        if (runPartition == null) {
            runPartition = new RunPartition();
            runPartition.setRunId(run.getId());
            runPartition.setPartitionId(partition.getId());
        }
        runPartition.setPurpose(purpose);
        runPartitionService.save(runPartition);
    }
}
Also used : RunPurposeService(uk.ac.bbsrc.tgac.miso.core.service.RunPurposeService) PathVariable(org.springframework.web.bind.annotation.PathVariable) UriComponentsBuilder(org.springframework.web.util.UriComponentsBuilder) RequestParam(org.springframework.web.bind.annotation.RequestParam) SampleTissueProcessing(uk.ac.bbsrc.tgac.miso.core.data.SampleTissueProcessing) PaginationFilter(uk.ac.bbsrc.tgac.miso.core.util.PaginationFilter) DataTablesResponseDto(uk.ac.bbsrc.tgac.miso.dto.DataTablesResponseDto) Autowired(org.springframework.beans.factory.annotation.Autowired) SampleSheet(uk.ac.bbsrc.tgac.miso.core.util.SampleSheet) RunPartition(uk.ac.bbsrc.tgac.miso.core.data.RunPartition) Dtos(uk.ac.bbsrc.tgac.miso.dto.Dtos) RunPartitionDto(uk.ac.bbsrc.tgac.miso.dto.ExperimentDto.RunPartitionDto) PutMapping(org.springframework.web.bind.annotation.PutMapping) Sample(uk.ac.bbsrc.tgac.miso.core.data.Sample) Map(java.util.Map) SequencerPartitionContainer(uk.ac.bbsrc.tgac.miso.core.data.SequencerPartitionContainer) PartitionQCType(uk.ac.bbsrc.tgac.miso.core.data.PartitionQCType) RunPartitionAliquotService(uk.ac.bbsrc.tgac.miso.core.service.RunPartitionAliquotService) ValidationException(uk.ac.bbsrc.tgac.miso.core.service.exception.ValidationException) PostMapping(org.springframework.web.bind.annotation.PostMapping) SampleService(uk.ac.bbsrc.tgac.miso.core.service.SampleService) PoolDto(uk.ac.bbsrc.tgac.miso.dto.PoolDto) AdvancedSearchParser(uk.ac.bbsrc.tgac.miso.webapp.controller.component.AdvancedSearchParser) HttpHeaders(org.springframework.http.HttpHeaders) ListLibraryAliquotView(uk.ac.bbsrc.tgac.miso.core.data.impl.view.ListLibraryAliquotView) Collection(java.util.Collection) MediaType(org.springframework.http.MediaType) ExperimentDto(uk.ac.bbsrc.tgac.miso.dto.ExperimentDto) Partition(uk.ac.bbsrc.tgac.miso.core.data.Partition) Collectors(java.util.stream.Collectors) IndexChecker(uk.ac.bbsrc.tgac.miso.core.util.IndexChecker) RunLibrarySpreadsheets(uk.ac.bbsrc.tgac.miso.core.data.spreadsheet.RunLibrarySpreadsheets) Objects(java.util.Objects) LibraryDto(uk.ac.bbsrc.tgac.miso.dto.LibraryDto) List(java.util.List) HttpEntity(org.springframework.http.HttpEntity) MisoWebUtils(uk.ac.bbsrc.tgac.miso.webapp.util.MisoWebUtils) Stream(java.util.stream.Stream) SampleStock(uk.ac.bbsrc.tgac.miso.core.data.SampleStock) RunService(uk.ac.bbsrc.tgac.miso.core.service.RunService) Pair(uk.ac.bbsrc.tgac.miso.core.data.Pair) LibraryAliquotDto(uk.ac.bbsrc.tgac.miso.dto.LibraryAliquotDto) InstrumentModelDto(uk.ac.bbsrc.tgac.miso.dto.InstrumentModelDto) InstrumentModel(uk.ac.bbsrc.tgac.miso.core.data.InstrumentModel) SampleIdentity(uk.ac.bbsrc.tgac.miso.core.data.SampleIdentity) StudyDto(uk.ac.bbsrc.tgac.miso.dto.StudyDto) User(com.eaglegenomics.simlims.core.User) RunPurpose(uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose) AuthorizationManager(uk.ac.bbsrc.tgac.miso.core.security.AuthorizationManager) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) Controller(org.springframework.stereotype.Controller) LibraryAliquotService(uk.ac.bbsrc.tgac.miso.core.service.LibraryAliquotService) ArrayList(java.util.ArrayList) RunDto(uk.ac.bbsrc.tgac.miso.dto.run.RunDto) Value(org.springframework.beans.factory.annotation.Value) RequestBody(org.springframework.web.bind.annotation.RequestBody) LibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot) HttpServletRequest(javax.servlet.http.HttpServletRequest) SampleDto(uk.ac.bbsrc.tgac.miso.dto.SampleDto) Run(uk.ac.bbsrc.tgac.miso.core.data.Run) RunPartitionAliquot(uk.ac.bbsrc.tgac.miso.core.data.RunPartitionAliquot) RunPartitionAliquotDto(uk.ac.bbsrc.tgac.miso.dto.RunPartitionAliquotDto) LimsUtils(uk.ac.bbsrc.tgac.miso.core.util.LimsUtils) Library(uk.ac.bbsrc.tgac.miso.core.data.Library) ContainerService(uk.ac.bbsrc.tgac.miso.core.service.ContainerService) GetMapping(org.springframework.web.bind.annotation.GetMapping) ResponseStatus(org.springframework.web.bind.annotation.ResponseStatus) PoolElement(uk.ac.bbsrc.tgac.miso.core.data.impl.view.PoolElement) RunPartitionService(uk.ac.bbsrc.tgac.miso.core.service.RunPartitionService) Status(javax.ws.rs.core.Response.Status) SampleAliquot(uk.ac.bbsrc.tgac.miso.core.data.SampleAliquot) SampleTissue(uk.ac.bbsrc.tgac.miso.core.data.SampleTissue) LibraryService(uk.ac.bbsrc.tgac.miso.core.service.LibraryService) WhineyFunction(uk.ac.bbsrc.tgac.miso.core.util.WhineyFunction) HttpServletResponse(javax.servlet.http.HttpServletResponse) SpreadsheetRequest(uk.ac.bbsrc.tgac.miso.dto.SpreadsheetRequest) IOException(java.io.IOException) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) WhineyConsumer(uk.ac.bbsrc.tgac.miso.core.util.WhineyConsumer) ContainerDto(uk.ac.bbsrc.tgac.miso.dto.ContainerDto) Consumer(java.util.function.Consumer) HttpStatus(org.springframework.http.HttpStatus) RunPosition(uk.ac.bbsrc.tgac.miso.core.data.impl.RunPosition) ExperimentService(uk.ac.bbsrc.tgac.miso.core.service.ExperimentService) PartitionQcTypeService(uk.ac.bbsrc.tgac.miso.core.service.PartitionQcTypeService) PlatformType(uk.ac.bbsrc.tgac.miso.core.data.type.PlatformType) PaginatedDataSource(uk.ac.bbsrc.tgac.miso.core.util.PaginatedDataSource) PartitionDto(uk.ac.bbsrc.tgac.miso.dto.PartitionDto) Pool(uk.ac.bbsrc.tgac.miso.core.data.Pool) RunPurpose(uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose) RunPartition(uk.ac.bbsrc.tgac.miso.core.data.RunPartition) Partition(uk.ac.bbsrc.tgac.miso.core.data.Partition) RunPartition(uk.ac.bbsrc.tgac.miso.core.data.RunPartition) Run(uk.ac.bbsrc.tgac.miso.core.data.Run) ResponseStatus(org.springframework.web.bind.annotation.ResponseStatus) PutMapping(org.springframework.web.bind.annotation.PutMapping)

Example 4 with RunPurpose

use of uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose in project miso-lims by miso-lims.

the class HibernateRunPurposeDaoIT method getCreateItem.

@Override
public RunPurpose getCreateItem() {
    RunPurpose purpose = new RunPurpose();
    purpose.setAlias("New Purpose");
    return purpose;
}
Also used : RunPurpose(uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose)

Example 5 with RunPurpose

use of uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose in project miso-lims by miso-lims.

the class HibernatePoolOrderDaoIT method testCreate.

@Test
public void testCreate() throws IOException {
    String alias = "New Category";
    PoolOrder order = new PoolOrder();
    order.setAlias(alias);
    Date now = new Date();
    order.setCreationTime(now);
    order.setLastModified(now);
    User user = (User) currentSession().get(UserImpl.class, 1L);
    order.setCreator(user);
    order.setLastModifier(user);
    RunPurpose purpose = (RunPurpose) currentSession().get(RunPurpose.class, 1L);
    order.setPurpose(purpose);
    long savedId = sut.create(order);
    clearSession();
    PoolOrder saved = (PoolOrder) getSessionFactory().getCurrentSession().get(PoolOrder.class, savedId);
    assertEquals(alias, saved.getAlias());
}
Also used : PoolOrder(uk.ac.bbsrc.tgac.miso.core.data.impl.PoolOrder) RunPurpose(uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose) User(com.eaglegenomics.simlims.core.User) UserImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.UserImpl) Date(java.util.Date) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest) Test(org.junit.Test)

Aggregations

RunPurpose (uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose)16 Test (org.junit.Test)8 RunDto (uk.ac.bbsrc.tgac.miso.dto.run.RunDto)6 IlluminaNotificationDto (ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto)5 NotificationDto (ca.on.oicr.gsi.runscanner.dto.NotificationDto)5 OxfordNanoporeNotificationDto (ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto)5 OrderAliquotDto (uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto)5 QcHierarchyNodeDto (uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto)5 IlluminaRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto)5 IonTorrentRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto)5 Ls454RunDto (uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto)5 OxfordNanoporeRunDto (uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto)5 PacBioRunDto (uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto)5 RunPositionDto (uk.ac.bbsrc.tgac.miso.dto.run.RunPositionDto)5 SolidRunDto (uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto)5 AbstractHibernateSaveDaoTest (uk.ac.bbsrc.tgac.miso.AbstractHibernateSaveDaoTest)4 RunPartitionAliquot (uk.ac.bbsrc.tgac.miso.core.data.RunPartitionAliquot)4 LibraryAliquot (uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot)4 SequencingContainerModel (uk.ac.bbsrc.tgac.miso.core.data.impl.SequencingContainerModel)4 User (com.eaglegenomics.simlims.core.User)3