Search in sources :

Example 1 with LimsSampleReader

use of com.hartwig.hmftools.patientdb.readers.LimsSampleReader in project hmftools by hartwigmedical.

the class LoadClinicalData method readSamplesPerPatient.

@NotNull
private static Map<String, List<SampleData>> readSamplesPerPatient(@NotNull Lims lims, @NotNull List<RunContext> runContexts) {
    LimsSampleReader sampleReader = new LimsSampleReader(lims);
    final Set<String> sequencedPatientIdentifiers = Utils.sequencedPatientIds(runContexts).stream().filter(identifier -> identifier.startsWith("CPCT") || identifier.startsWith("DRUP")).collect(Collectors.toSet());
    Map<String, List<SampleData>> samplesPerPatient = Maps.newHashMap();
    for (String patientIdentifier : sequencedPatientIdentifiers) {
        List<String> sampleIds = getTumorSamplesForPatient(patientIdentifier, runContexts);
        samplesPerPatient.put(patientIdentifier, sampleReader.read(sampleIds));
    }
    return samplesPerPatient;
}
Also used : FormStatusModel(com.hartwig.hmftools.common.ecrf.formstatus.FormStatusModel) FormStatusReader(com.hartwig.hmftools.common.ecrf.formstatus.FormStatusReader) Options(org.apache.commons.cli.Options) EcrfPatient(com.hartwig.hmftools.common.ecrf.datamodel.EcrfPatient) HelpFormatter(org.apache.commons.cli.HelpFormatter) DefaultParser(org.apache.commons.cli.DefaultParser) SQLException(java.sql.SQLException) Lims(com.hartwig.hmftools.common.lims.Lims) Lists(com.google.common.collect.Lists) CurationValidator(com.hartwig.hmftools.patientdb.validators.CurationValidator) PatientReader(com.hartwig.hmftools.patientdb.readers.PatientReader) Map(java.util.Map) XMLStreamException(javax.xml.stream.XMLStreamException) LimsSampleReader(com.hartwig.hmftools.patientdb.readers.LimsSampleReader) RunsFolderReader(com.hartwig.hmftools.patientdb.readers.RunsFolderReader) CommandLine(org.apache.commons.cli.CommandLine) SampleData(com.hartwig.hmftools.patientdb.data.SampleData) TreatmentCurator(com.hartwig.hmftools.patientdb.curators.TreatmentCurator) CommandLineParser(org.apache.commons.cli.CommandLineParser) Patient(com.hartwig.hmftools.patientdb.data.Patient) Set(java.util.Set) IOException(java.io.IOException) LimsFactory(com.hartwig.hmftools.common.lims.LimsFactory) Collectors(java.util.stream.Collectors) Maps(com.google.common.collect.Maps) File(java.io.File) RunContext(com.hartwig.hmftools.common.context.RunContext) DatabaseAccess(com.hartwig.hmftools.patientdb.dao.DatabaseAccess) ValidationFinding(com.hartwig.hmftools.common.ecrf.datamodel.ValidationFinding) PatientValidator(com.hartwig.hmftools.patientdb.validators.PatientValidator) List(java.util.List) Logger(org.apache.logging.log4j.Logger) ParseException(org.apache.commons.cli.ParseException) Optional(java.util.Optional) NotNull(org.jetbrains.annotations.NotNull) LogManager(org.apache.logging.log4j.LogManager) TumorLocationCurator(com.hartwig.hmftools.patientdb.curators.TumorLocationCurator) CpctEcrfModel(com.hartwig.hmftools.common.ecrf.CpctEcrfModel) List(java.util.List) LimsSampleReader(com.hartwig.hmftools.patientdb.readers.LimsSampleReader) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

Lists (com.google.common.collect.Lists)1 Maps (com.google.common.collect.Maps)1 RunContext (com.hartwig.hmftools.common.context.RunContext)1 CpctEcrfModel (com.hartwig.hmftools.common.ecrf.CpctEcrfModel)1 EcrfPatient (com.hartwig.hmftools.common.ecrf.datamodel.EcrfPatient)1 ValidationFinding (com.hartwig.hmftools.common.ecrf.datamodel.ValidationFinding)1 FormStatusModel (com.hartwig.hmftools.common.ecrf.formstatus.FormStatusModel)1 FormStatusReader (com.hartwig.hmftools.common.ecrf.formstatus.FormStatusReader)1 Lims (com.hartwig.hmftools.common.lims.Lims)1 LimsFactory (com.hartwig.hmftools.common.lims.LimsFactory)1 TreatmentCurator (com.hartwig.hmftools.patientdb.curators.TreatmentCurator)1 TumorLocationCurator (com.hartwig.hmftools.patientdb.curators.TumorLocationCurator)1 DatabaseAccess (com.hartwig.hmftools.patientdb.dao.DatabaseAccess)1 Patient (com.hartwig.hmftools.patientdb.data.Patient)1 SampleData (com.hartwig.hmftools.patientdb.data.SampleData)1 LimsSampleReader (com.hartwig.hmftools.patientdb.readers.LimsSampleReader)1 PatientReader (com.hartwig.hmftools.patientdb.readers.PatientReader)1 RunsFolderReader (com.hartwig.hmftools.patientdb.readers.RunsFolderReader)1 CurationValidator (com.hartwig.hmftools.patientdb.validators.CurationValidator)1 PatientValidator (com.hartwig.hmftools.patientdb.validators.PatientValidator)1