Search in sources :

Example 1 with SpecimenSampleTuple

use of org.icgc.dcc.song.importer.convert.SpecimenSampleConverter.SpecimenSampleTuple in project SONG by overture-stack.

the class Importer method processSpecimensAndSamples.

private void processSpecimensAndSamples(List<PortalFileMetadata> portalFileMetadataList) {
    log.info("Converting Specimen and Samples...");
    val specimenSampleTuples = SPECIMEN_SAMPLE_CONVERTER.convertSpecimenSampleTuples(portalFileMetadataList);
    // Aggregating specimens
    val specimens = specimenSampleTuples.stream().collect(groupingBy(SpecimenSampleTuple::getSpecimen)).keySet();
    log.info("Updating SpecimenRepository with {} specimens", specimens.size());
    specimens.forEach(repositoryDao::createSpecimen);
    // Aggregating samples
    val samples = specimenSampleTuples.stream().collect(groupingBy(x -> x.getSample().getSampleId())).entrySet().stream().map(// TODO: why??
    x -> x.getValue().get(0).getSample()).collect(toImmutableSet());
    log.info("Updating SampleRepository with {} samples", samples.size());
    samples.forEach(repositoryDao::createSample);
}
Also used : lombok.val(lombok.val) SpecimenSampleTuple(org.icgc.dcc.song.importer.convert.SpecimenSampleConverter.SpecimenSampleTuple) PortalFileMetadata(org.icgc.dcc.song.importer.model.PortalFileMetadata) Collectors.toImmutableSet(org.icgc.dcc.common.core.util.stream.Collectors.toImmutableSet) SSLCertificateValidation(org.icgc.dcc.common.core.security.SSLCertificateValidation) File(org.icgc.dcc.song.server.model.entity.File) FILE_CONVERTER(org.icgc.dcc.song.importer.Factory.FILE_CONVERTER) SPECIMEN_SAMPLE_CONVERTER(org.icgc.dcc.song.importer.Factory.SPECIMEN_SAMPLE_CONVERTER) RequiredArgsConstructor(lombok.RequiredArgsConstructor) Collectors.groupingBy(java.util.stream.Collectors.groupingBy) Autowired(org.springframework.beans.factory.annotation.Autowired) AnalysisConverter.createAnalysisConverter(org.icgc.dcc.song.importer.convert.AnalysisConverter.createAnalysisConverter) PcawgSampleSheetStrategy.createPcawgSampleSheetStrategy(org.icgc.dcc.song.importer.strategies.PcawgSampleSheetStrategy.createPcawgSampleSheetStrategy) DataContainer(org.icgc.dcc.song.importer.model.DataContainer) Factory.buildPersistenceFactory(org.icgc.dcc.song.importer.Factory.buildPersistenceFactory) PcawgSampleSheetConfig(org.icgc.dcc.song.importer.config.PcawgSampleSheetConfig) DONOR_CONVERTER(org.icgc.dcc.song.importer.Factory.DONOR_CONVERTER) lombok.val(lombok.val) Set(java.util.Set) AnalysisConverter(org.icgc.dcc.song.importer.convert.AnalysisConverter) Slf4j(lombok.extern.slf4j.Slf4j) PortalDonorMetadata(org.icgc.dcc.song.importer.model.PortalDonorMetadata) Component(org.springframework.stereotype.Component) List(java.util.List) SAMPLE_SET_CONVERTER(org.icgc.dcc.song.importer.Factory.SAMPLE_SET_CONVERTER) STUDY_CONVERTER(org.icgc.dcc.song.importer.Factory.STUDY_CONVERTER) DATA_CONTAINER_PERSISTENCE_FN(org.icgc.dcc.song.importer.Config.DATA_CONTAINER_PERSISTENCE_FN) SpecimenSampleTuple(org.icgc.dcc.song.importer.convert.SpecimenSampleConverter.SpecimenSampleTuple)

Aggregations

List (java.util.List)1 Set (java.util.Set)1 Collectors.groupingBy (java.util.stream.Collectors.groupingBy)1 RequiredArgsConstructor (lombok.RequiredArgsConstructor)1 Slf4j (lombok.extern.slf4j.Slf4j)1 lombok.val (lombok.val)1 SSLCertificateValidation (org.icgc.dcc.common.core.security.SSLCertificateValidation)1 Collectors.toImmutableSet (org.icgc.dcc.common.core.util.stream.Collectors.toImmutableSet)1 DATA_CONTAINER_PERSISTENCE_FN (org.icgc.dcc.song.importer.Config.DATA_CONTAINER_PERSISTENCE_FN)1 DONOR_CONVERTER (org.icgc.dcc.song.importer.Factory.DONOR_CONVERTER)1 FILE_CONVERTER (org.icgc.dcc.song.importer.Factory.FILE_CONVERTER)1 SAMPLE_SET_CONVERTER (org.icgc.dcc.song.importer.Factory.SAMPLE_SET_CONVERTER)1 SPECIMEN_SAMPLE_CONVERTER (org.icgc.dcc.song.importer.Factory.SPECIMEN_SAMPLE_CONVERTER)1 STUDY_CONVERTER (org.icgc.dcc.song.importer.Factory.STUDY_CONVERTER)1 Factory.buildPersistenceFactory (org.icgc.dcc.song.importer.Factory.buildPersistenceFactory)1 PcawgSampleSheetConfig (org.icgc.dcc.song.importer.config.PcawgSampleSheetConfig)1 AnalysisConverter (org.icgc.dcc.song.importer.convert.AnalysisConverter)1 AnalysisConverter.createAnalysisConverter (org.icgc.dcc.song.importer.convert.AnalysisConverter.createAnalysisConverter)1 SpecimenSampleTuple (org.icgc.dcc.song.importer.convert.SpecimenSampleConverter.SpecimenSampleTuple)1 DataContainer (org.icgc.dcc.song.importer.model.DataContainer)1