protected StudyConfiguration getStudyConfiguration(Integer studyId) { StudyConfiguration studyConfiguration = selectVariantElements == null ? null : selectVariantElements.getStudyConfigurations().get(studyId); if (studyConfiguration != null) { return studyConfiguration; } else { QueryResult<StudyConfiguration> queryResult = scm.getStudyConfiguration(studyId, RO_CACHED_OPTIONS); if (queryResult.getResult().isEmpty()) { throw new IllegalStateException("No study found for study ID: " + studyId); } return queryResult.first(); } }
selectVariantElements.getStudyConfigurations().get(studyId), sampleIds); List<Integer> includeFiles = selectVariantElements.getFiles().get(studyId); for (Integer fileId : fileIds) {
StudyConfiguration studyConfiguration = selectVariantElements.getStudyConfigurations().get(studyId); Set<String> samples = new HashSet<>(); if (isValidParam(query, VariantQueryParam.SAMPLE)) {
List<String> includeStudy = new ArrayList<>(); for (Integer studyId : selectVariantElements.getStudies()) { includeStudy.add(selectVariantElements.getStudyConfigurations().get(studyId).getStudyName()); .flatMap(e -> e.getValue() .stream() .map(selectVariantElements.getStudyConfigurations().get(e.getKey()).getSampleIds().inverse()::get)) .collect(Collectors.toList()); if (includeSample.isEmpty()) { .flatMap(e -> e.getValue() .stream() .map(selectVariantElements.getStudyConfigurations().get(e.getKey()).getFileIds().inverse()::get)) .collect(Collectors.toList()); if (includeFile.isEmpty()) {
for (StudyConfiguration sc : selectElements.getStudyConfigurations().values()) { for (Integer cohortId : sc.getCalculatedStats()) { scan.addColumn(family, selectElements.getStudyConfigurations().get(studyId), sampleIds); for (Integer fileId : fileIds) { scan.addColumn(family, buildFileColumnKey(studyId, fileId));
samplesConverter.setFormat(getIncludeFormats(query)); for (StudyConfiguration studyConfiguration : selectVariantElements.getStudyConfigurations().values()) { samplesConverter.addStudyConfiguration(studyConfiguration);