private void createReadStreams() { perSampleArtificialReadStreams = new HashMap<String, ArtificialSingleSampleReadStream>(numSamples); perSampleStreamAnalyzers = new HashMap<String, ArtificialSingleSampleReadStreamAnalyzer>(numSamples); for (SAMReadGroupRecord readGroup : header.getReadGroups() ) { String readGroupID = readGroup.getReadGroupId(); String sampleName = readGroup.getSample(); int thisSampleNumContigs = MathUtils.randomIntegerInRange(minContigs, maxContigs); int thisSampleStacksPerContig = MathUtils.randomIntegerInRange(streamStacksPerContig.minStacksPerContig, streamStacksPerContig.maxStacksPerContig); int thisSampleNumUnmappedReads = Utils.getRandomGenerator().nextDouble() < unmappedReadsFraction ? unmappedReadsCount : 0; ArtificialSingleSampleReadStream thisSampleStream = new ArtificialSingleSampleReadStream(header, readGroupID, thisSampleNumContigs, thisSampleStacksPerContig, streamStackDepth.minReadsPerStack, streamStackDepth.maxReadsPerStack, streamDensity.minDistanceBetweenStacks, streamDensity.maxDistanceBetweenStacks, MIN_READ_LENGTH, MAX_READ_LENGTH, thisSampleNumUnmappedReads); perSampleArtificialReadStreams.put(sampleName, thisSampleStream); perSampleStreamAnalyzers.put(sampleName, new PositionallyDownsampledArtificialSingleSampleReadStreamAnalyzer(thisSampleStream, targetCoverage)); } mergedReadStream = new ArtificialMultiSampleReadStream(perSampleArtificialReadStreams.values()); }