public StudyConfiguration(int studyId, String studyName, Map<String, Integer> fileIds, Map<String, Integer> sampleIds, Map<String, Integer> cohortIds, Map<Integer, Set<Integer>> cohorts) { this.studyId = studyId; this.studyName = studyName; this.fileIds = HashBiMap.create(fileIds == null ? Collections.emptyMap() : fileIds); this.filePaths = HashBiMap.create(); this.sampleIds = HashBiMap.create(sampleIds == null ? Collections.emptyMap() : sampleIds); this.cohortIds = HashBiMap.create(cohortIds == null ? Collections.emptyMap() : cohortIds); this.cohorts = cohorts == null ? new HashMap<>() : cohorts; this.indexedFiles = new LinkedHashSet<>(); this.headers = new HashMap<>(); this.samplesInFiles = new HashMap<>(); this.calculatedStats = new LinkedHashSet<>(); this.invalidStats = new LinkedHashSet<>(); this.searchIndexedSampleSets = new HashMap<>(); this.searchIndexedSampleSetsStatus = new HashMap<>(); this.batches = new ArrayList<>(); this.aggregation = Aggregation.NONE; this.timeStamp = 0L; this.variantHeader = VariantFileHeader.newBuilder().setVersion("").build(); this.attributes = new ObjectMap(); }
public void copy(StudyConfiguration other) { this.studyId = other.studyId; this.studyName = other.studyName; this.fileIds = HashBiMap.create(other.fileIds == null ? Collections.emptyMap() : other.fileIds); this.filePaths = HashBiMap.create(other.filePaths == null ? Collections.emptyMap() : other.filePaths); this.sampleIds = HashBiMap.create(other.sampleIds == null ? Collections.emptyMap() : other.sampleIds); this.cohortIds = HashBiMap.create(other.cohortIds == null ? Collections.emptyMap() : other.cohortIds); this.cohorts = new HashMap<>(other.cohorts); this.indexedFiles = new LinkedHashSet<>(other.indexedFiles); this.headers = new HashMap<>(other.headers); this.samplesInFiles = new HashMap<>(other.samplesInFiles); this.calculatedStats = new LinkedHashSet<>(other.calculatedStats); this.invalidStats = new LinkedHashSet<>(other.invalidStats); this.searchIndexedSampleSets = other.searchIndexedSampleSets == null ? new HashMap<>() : new HashMap<>(other.searchIndexedSampleSets); this.searchIndexedSampleSetsStatus = other.searchIndexedSampleSetsStatus == null ? new HashMap<>() : new HashMap<>(other.searchIndexedSampleSetsStatus); this.batches = new ArrayList<>(other.batches.size()); for (BatchFileOperation batch : other.batches) { this.batches.add(new BatchFileOperation(batch)); } this.aggregation = other.aggregation; this.timeStamp = other.timeStamp; if (other.variantHeader == null) { this.variantHeader = VariantFileHeader.newBuilder().setVersion("").build(); } else { this.variantHeader = VariantFileHeader.newBuilder(other.variantHeader).setVersion("").build(); } this.attributes = new ObjectMap(other.attributes); }