Search in sources :

Example 11 with SampleClass

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

the class Dtos method to.

public static SampleClass to(@Nonnull SampleClassDto from) {
    SampleClass to = new SampleClassImpl();
    setLong(to::setId, from.getId(), false);
    to.setAlias(from.getAlias());
    to.setSampleCategory(from.getSampleCategory());
    to.setSampleSubcategory(from.getSampleSubcategory());
    to.setSuffix(from.getSuffix());
    setString(to::setV2NamingCode, from.getV2NamingCode());
    to.setArchived(from.isArchived());
    to.setDirectCreationAllowed(from.isDirectCreationAllowed());
    setObject(to::setDefaultSampleType, from.getDefaultSampleType(), name -> {
        SampleType st = new SampleType();
        st.setName(name);
        return st;
    });
    if (from.getParentRelationships() != null) {
        to.getParentRelationships().addAll(from.getParentRelationships().stream().map(Dtos::to).collect(Collectors.toSet()));
    }
    if (from.getChildRelationships() != null) {
        to.getChildRelationships().addAll(from.getChildRelationships().stream().map(Dtos::to).collect(Collectors.toSet()));
    }
    return to;
}
Also used : SampleClass(uk.ac.bbsrc.tgac.miso.core.data.SampleClass) SampleClassImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleClassImpl) 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) SampleType(uk.ac.bbsrc.tgac.miso.core.data.SampleType)

Example 12 with SampleClass

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

the class V2SampleAliasGeneratorTest method makeStockFromProcessing.

private Sample makeStockFromProcessing() throws Exception {
    SampleStock stock = new SampleStockImpl();
    DetailedSample lcmTube = makeLcmTube();
    lcmTube.setAlias("PROJ_0001_TL03");
    stock.setParent(lcmTube);
    SampleClass sc = new SampleClassImpl();
    sc.setSampleCategory(SampleStock.CATEGORY_NAME);
    sc.setV2NamingCode("SG");
    stock.setSampleClass(sc);
    stock.setSiblingNumber(4);
    return stock;
}
Also used : SampleClass(uk.ac.bbsrc.tgac.miso.core.data.SampleClass) SampleClassImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleClassImpl) DetailedSample(uk.ac.bbsrc.tgac.miso.core.data.DetailedSample) SampleStockImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleStockImpl) SampleStock(uk.ac.bbsrc.tgac.miso.core.data.SampleStock)

Example 13 with SampleClass

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

the class V2SampleAliasGeneratorTest method makeTissue.

private SampleTissue makeTissue() {
    SampleTissue tissue = new SampleTissueImpl();
    SampleClass sc = new SampleClassImpl();
    sc.setSampleCategory(SampleTissue.CATEGORY_NAME);
    tissue.setSampleClass(sc);
    tissue.setParent(makeIdentity());
    tissue.setTimesReceived(1);
    tissue.setTubeNumber(1);
    return tissue;
}
Also used : SampleTissue(uk.ac.bbsrc.tgac.miso.core.data.SampleTissue) SampleClass(uk.ac.bbsrc.tgac.miso.core.data.SampleClass) SampleClassImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleClassImpl) SampleTissueImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleTissueImpl)

Example 14 with SampleClass

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

the class V2SampleAliasGeneratorTest method makeStockFromTissue.

private SampleStock makeStockFromTissue() throws Exception {
    SampleStock stock = new SampleStockImpl();
    SampleTissue tissue = makeTissue();
    tissue.setAlias("PROJ_0001_01");
    stock.setParent(tissue);
    SampleClass sc = new SampleClassImpl();
    sc.setSampleCategory(SampleStock.CATEGORY_NAME);
    sc.setV2NamingCode("SG");
    stock.setSampleClass(sc);
    stock.setSiblingNumber(4);
    return stock;
}
Also used : SampleTissue(uk.ac.bbsrc.tgac.miso.core.data.SampleTissue) SampleClass(uk.ac.bbsrc.tgac.miso.core.data.SampleClass) SampleClassImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleClassImpl) SampleStockImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleStockImpl) SampleStock(uk.ac.bbsrc.tgac.miso.core.data.SampleStock)

Example 15 with SampleClass

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

the class V2SampleAliasGeneratorTest method makeStockFromStock.

private Sample makeStockFromStock() throws Exception {
    SampleStock stock = new SampleStockImpl();
    SampleStock parentStock = makeStockFromTissue();
    parentStock.setAlias("PROJ_0001_01_SG04");
    stock.setParent(parentStock);
    SampleClass sc = new SampleClassImpl();
    sc.setSampleCategory(SampleStock.CATEGORY_NAME);
    sc.setV2NamingCode("SG");
    stock.setSampleClass(sc);
    stock.setSiblingNumber(6);
    return stock;
}
Also used : SampleClass(uk.ac.bbsrc.tgac.miso.core.data.SampleClass) SampleClassImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleClassImpl) SampleStockImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleStockImpl) SampleStock(uk.ac.bbsrc.tgac.miso.core.data.SampleStock)

Aggregations

SampleClass (uk.ac.bbsrc.tgac.miso.core.data.SampleClass)41 SampleClassImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.SampleClassImpl)27 SampleStock (uk.ac.bbsrc.tgac.miso.core.data.SampleStock)10 SampleTissue (uk.ac.bbsrc.tgac.miso.core.data.SampleTissue)10 Test (org.junit.Test)8 AbstractDAOTest (uk.ac.bbsrc.tgac.miso.AbstractDAOTest)8 DetailedSample (uk.ac.bbsrc.tgac.miso.core.data.DetailedSample)8 SampleStockImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.SampleStockImpl)8 SampleAliquot (uk.ac.bbsrc.tgac.miso.core.data.SampleAliquot)6 SampleIdentity (uk.ac.bbsrc.tgac.miso.core.data.SampleIdentity)5 SampleValidRelationship (uk.ac.bbsrc.tgac.miso.core.data.SampleValidRelationship)5 SampleTissueImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.SampleTissueImpl)4 User (com.eaglegenomics.simlims.core.User)3 HashSet (java.util.HashSet)3 Project (uk.ac.bbsrc.tgac.miso.core.data.Project)3 SampleTissuePiece (uk.ac.bbsrc.tgac.miso.core.data.SampleTissuePiece)3 SampleAliquotImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.SampleAliquotImpl)3 IlluminaNotificationDto (ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto)2 NotificationDto (ca.on.oicr.gsi.runscanner.dto.NotificationDto)2 OxfordNanoporeNotificationDto (ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto)2