Hrumph. Don't just add pointers to the same objects, actually clone the underlying arrays.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3379 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
chartl 2010-05-18 17:13:44 +00:00
parent 886e9c1297
commit eb200e4cce
1 changed files with 18 additions and 8 deletions

View File

@ -86,15 +86,25 @@ public class DepthOfCoverageStats {
public DepthOfCoverageStats(DepthOfCoverageStats cloneMe) {
this.binLeftEndpoints = cloneMe.binLeftEndpoints;
this.granularHistogramBySample = cloneMe.granularHistogramBySample;
this.totalCoverages = cloneMe.totalCoverages;
this.nLoci = cloneMe.nLoci;
this.totalLocusDepth = cloneMe.totalLocusDepth;
this.totalDepthOfCoverage = cloneMe.totalDepthOfCoverage;
this.locusHistogram = cloneMe.locusHistogram;
this.locusCoverageCounts = cloneMe.locusCoverageCounts;
this.tabulateLocusCounts = cloneMe.tabulateLocusCounts;
granularHistogramBySample = new HashMap<String,int[]>();
totalCoverages = new HashMap<String,Long>();
for ( String s : cloneMe.getAllSamples() ) {
granularHistogramBySample.put(s,new int[cloneMe.getHistograms().get(s).length]);
for ( int i = 0; i < granularHistogramBySample.get(s).length; i++ ) {
granularHistogramBySample.get(s)[i] = cloneMe.getHistograms().get(s)[i];
}
totalCoverages.put(s,cloneMe.totalCoverages.get(s));
}
this.includeDeletions = cloneMe.includeDeletions;
if ( cloneMe.tabulateLocusCounts ) {
this.locusCoverageCounts = new int[cloneMe.locusCoverageCounts.length][cloneMe.locusCoverageCounts[0].length];
}
//this.granularHistogramBySample = cloneMe.granularHistogramBySample;
//this.totalCoverages = cloneMe.totalCoverages;
this.nLoci = cloneMe.nLoci;
this.totalDepthOfCoverage = cloneMe.totalDepthOfCoverage;
this.tabulateLocusCounts = cloneMe.tabulateLocusCounts;
}
public void addSample(String sample) {