Search in sources :

Example 1 with DetailedLibraryImpl

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

the class V2LibraryAliasGeneratorTest method constructHierarchy.

private static Library constructHierarchy(String identityNumber, String tissueNumber) {
    SampleIdentity identity = new SampleIdentityImpl();
    identity.setAlias("TEST_" + identityNumber);
    SampleTissue tissue = new SampleTissueImpl();
    tissue.setParent(identity);
    tissue.setAlias("TEST_" + identityNumber + "_" + tissueNumber);
    SampleStock stock = new SampleStockImpl();
    stock.setParent(tissue);
    stock.setAlias("TEST_" + identityNumber + "_" + tissueNumber + "_SG01");
    SampleAliquot aliquot = new SampleAliquotImpl();
    aliquot.setParent(stock);
    aliquot.setAlias("TEST_" + identityNumber + "_" + tissueNumber + "_SG01-02");
    DetailedLibrary lib = new DetailedLibraryImpl();
    lib.setSample(aliquot);
    return lib;
}
Also used : SampleTissue(uk.ac.bbsrc.tgac.miso.core.data.SampleTissue) SampleIdentityImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleIdentityImpl) SampleAliquot(uk.ac.bbsrc.tgac.miso.core.data.SampleAliquot) SampleIdentity(uk.ac.bbsrc.tgac.miso.core.data.SampleIdentity) SampleAliquotImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleAliquotImpl) SampleStockImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleStockImpl) DetailedLibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedLibraryImpl) SampleTissueImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleTissueImpl) DetailedLibrary(uk.ac.bbsrc.tgac.miso.core.data.DetailedLibrary) SampleStock(uk.ac.bbsrc.tgac.miso.core.data.SampleStock)

Example 2 with DetailedLibraryImpl

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

the class OicrLibraryAliasGeneratorTest method testGenerateOxfordNanoporeAlias.

@Test
public void testGenerateOxfordNanoporeAlias() throws Exception {
    DetailedLibrary library = new DetailedLibraryImpl();
    library.setPlatformType(PlatformType.OXFORDNANOPORE);
    DetailedSample sample = new DetailedSampleImpl();
    sample.setAlias("LALA_1234567_Ly_R_nn_1-1_D_1");
    library.setSample(sample);
    LibraryType libraryType = new LibraryType();
    libraryType.setAbbreviation("RPD");
    library.setLibraryType(libraryType);
    library.setDnaSize(300);
    LibraryDesignCode code = new LibraryDesignCode();
    code.setCode("WG");
    library.setLibraryDesignCode(code);
    Mockito.when(siblingNumberGenerator.getNextSiblingNumber(Mockito.any(), Mockito.any())).thenReturn(5);
    assertEquals("LALA_1234567_Ly_R_RPD_WG_5", sut.generate(library));
}
Also used : LibraryDesignCode(uk.ac.bbsrc.tgac.miso.core.data.LibraryDesignCode) LibraryType(uk.ac.bbsrc.tgac.miso.core.data.type.LibraryType) DetailedSample(uk.ac.bbsrc.tgac.miso.core.data.DetailedSample) DetailedLibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedLibraryImpl) DetailedSampleImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedSampleImpl) DetailedLibrary(uk.ac.bbsrc.tgac.miso.core.data.DetailedLibrary) Test(org.junit.Test)

Example 3 with DetailedLibraryImpl

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

the class Dtos method toDetailed.

private static DetailedLibraryAliquot toDetailed(DetailedLibraryAliquotDto from) {
    DetailedLibraryAliquot to = new DetailedLibraryAliquot();
    setBoolean(to::setNonStandardAlias, from.isNonStandardAlias(), false);
    setObject(to::setLibraryDesignCode, LibraryDesignCode::new, from.getLibraryDesignCodeId());
    setString(to::setGroupId, from.getGroupId());
    setString(to::setGroupDescription, from.getGroupDescription());
    setObject(to::setLibrary, DetailedLibraryImpl::new, from.getLibraryId());
    setObject(to::setParentAliquot, DetailedLibraryAliquot::new, from.getParentAliquotId());
    return to;
}
Also used : LibraryDesignCode(uk.ac.bbsrc.tgac.miso.core.data.LibraryDesignCode) DetailedLibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedLibraryAliquot) DetailedLibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedLibraryImpl) 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 4 with DetailedLibraryImpl

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

the class OicrLibraryAliasGeneratorTest method testGeneratePacBioLibraryAlias.

@Test
public void testGeneratePacBioLibraryAlias() throws Exception {
    DetailedLibrary library = new DetailedLibraryImpl();
    library.setPlatformType(PlatformType.PACBIO);
    DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
    library.setCreationDate(df.parse("2017-09-13"));
    DetailedSample parent = new DetailedSampleImpl();
    parent.setAlias("PROJ_1234_Pa_P_nn_1-1_D_8");
    library.setSample(parent);
    Mockito.when(siblingNumberGenerator.getNextSiblingNumber(Mockito.any(), Mockito.any())).thenReturn(2);
    assertEquals("PROJ_1234_20170913_2", sut.generate(library));
}
Also used : SimpleDateFormat(java.text.SimpleDateFormat) DateFormat(java.text.DateFormat) DetailedSample(uk.ac.bbsrc.tgac.miso.core.data.DetailedSample) DetailedLibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedLibraryImpl) DetailedSampleImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedSampleImpl) DetailedLibrary(uk.ac.bbsrc.tgac.miso.core.data.DetailedLibrary) SimpleDateFormat(java.text.SimpleDateFormat) Test(org.junit.Test)

Example 5 with DetailedLibraryImpl

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

the class OicrLibraryAliasGeneratorTest method testGenerateIlluminaLibraryAlias.

@Test
public void testGenerateIlluminaLibraryAlias() throws Exception {
    DetailedLibrary library = new DetailedLibraryImpl();
    library.setPlatformType(PlatformType.ILLUMINA);
    DetailedSample sample = new DetailedSampleImpl();
    sample.setAlias("BART_1273_Br_P_nn_1-1_D_1");
    library.setSample(sample);
    LibraryType libraryType = new LibraryType();
    libraryType.setAbbreviation("PE");
    library.setLibraryType(libraryType);
    library.setDnaSize(300);
    LibraryDesignCode code = new LibraryDesignCode();
    code.setCode("WG");
    library.setLibraryDesignCode(code);
    assertEquals("BART_1273_Br_P_PE_300_WG", sut.generate(library));
}
Also used : LibraryDesignCode(uk.ac.bbsrc.tgac.miso.core.data.LibraryDesignCode) LibraryType(uk.ac.bbsrc.tgac.miso.core.data.type.LibraryType) DetailedSample(uk.ac.bbsrc.tgac.miso.core.data.DetailedSample) DetailedLibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedLibraryImpl) DetailedSampleImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedSampleImpl) DetailedLibrary(uk.ac.bbsrc.tgac.miso.core.data.DetailedLibrary) Test(org.junit.Test)

Aggregations

DetailedLibraryImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedLibraryImpl)10 DetailedLibrary (uk.ac.bbsrc.tgac.miso.core.data.DetailedLibrary)8 Test (org.junit.Test)6 DetailedSample (uk.ac.bbsrc.tgac.miso.core.data.DetailedSample)6 LibraryDesignCode (uk.ac.bbsrc.tgac.miso.core.data.LibraryDesignCode)6 DetailedSampleImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedSampleImpl)6 DetailedLibraryAliquot (uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedLibraryAliquot)5 LibraryType (uk.ac.bbsrc.tgac.miso.core.data.type.LibraryType)4 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 DateFormat (java.text.DateFormat)2 SimpleDateFormat (java.text.SimpleDateFormat)2 OrderAliquotDto (uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto)2 QcHierarchyNodeDto (uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto)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