From e632d9b83d07c98d1cee23bf78bb8fe83060acde Mon Sep 17 00:00:00 2001 From: aaron Date: Tue, 17 Aug 2010 00:07:26 +0000 Subject: [PATCH] remove some dependencies on out of date methods from the tests git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4047 348d0f76-0448-11de-a6fe-93d51630548a --- .../builders/IndexPerformanceTests.java | 44 ++++++++++--------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/java/test/org/broadinstitute/sting/gatk/refdata/tracks/builders/IndexPerformanceTests.java b/java/test/org/broadinstitute/sting/gatk/refdata/tracks/builders/IndexPerformanceTests.java index 0f1e1f70c..a8745237d 100644 --- a/java/test/org/broadinstitute/sting/gatk/refdata/tracks/builders/IndexPerformanceTests.java +++ b/java/test/org/broadinstitute/sting/gatk/refdata/tracks/builders/IndexPerformanceTests.java @@ -5,6 +5,7 @@ import net.sf.samtools.SAMSequenceDictionary; import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.broad.tribble.Feature; +import org.broad.tribble.bed.BEDCodec; import org.broad.tribble.index.Index; import org.broad.tribble.index.linear.LinearIndex; import org.broad.tribble.iterators.CloseableTribbleIterator; @@ -44,7 +45,7 @@ public class IndexPerformanceTests extends BaseTest { String fileLocation = validationDataLocation + "Index_Performance_Data/"; // bin sizes to try - int[] binSizes = {10, 100, 1000, 5000, 10000, 50000}; + int[] binSizes = {100, 1000, 5000, 16000}; PrintWriter writer; PrintWriter writer2; @@ -56,19 +57,20 @@ public class IndexPerformanceTests extends BaseTest { IndexedFastaSequenceFile seq = new IndexedFastaSequenceFile(new File(hg18Reference)); GenomeLocParser.setupRefContigOrdering(seq); + int recordCount[] = {10,100,1000,10000,100000,500000,1000000}; + int longestFeature[] = {1,50,100,1000,100000}; + + // the input files - inputFiles.put("\"10\"",new File(fileLocation + "tip10.vcf")); - inputFiles.put("\"100\"",new File(fileLocation + "tip100.vcf")); - inputFiles.put("\"1,000\"",new File(fileLocation + "tip1000.vcf")); - inputFiles.put("\"10,000\"",new File(fileLocation + "tip10000.vcf")); - inputFiles.put("\"100,000\"",new File(fileLocation + "tip100000.vcf")); - inputFiles.put("\"1,000,000\"",new File(fileLocation + "tip1000000.vcf")); + for (int rCount : recordCount){ + for (int longest : longestFeature) { + inputFiles.put("./BED/" + "bed_density_" + rCount + "_fLengthMax_" + longest + ".BED",new File("./BED/" + "bed_density_" + rCount + "_fLengthMax_" + longest + ".BED")); + } + } for (String name : inputFiles.keySet()) { - inputTypes.put(name,VCFCodec.class); + inputTypes.put(name, BEDCodec.class); } - inputFiles.put("Big Table",new File("/humgen/gsa-hpprojects/dev/depristo/oneOffProjects/slowAnnotator/big.table.txt")); - inputTypes.put("Big Table", AnnotatorInputTableCodec.class); } @Test @@ -115,10 +117,10 @@ public class IndexPerformanceTests extends BaseTest { * every other 1000 bases of chr1 (of the first 100M), the count of records seen in the last operation, and the index size */ public List performIndexTest(String name, boolean useLinear, int size) { - TribbleRMDTrackBuilder.useLinearIndex = useLinear; - TribbleRMDTrackBuilder.binSize = size; + //TribbleRMDTrackBuilder.useLinearIndex = useLinear; + //TribbleRMDTrackBuilder.binSize = size; - deleteIndex(inputFiles.get(name)); + deleteIndex(new File(inputFiles.get(name) + ((useLinear) ? ".idx" : ".tdx"))); // time creating the index long createTime = System.currentTimeMillis(); Pair pairing = builder.createFeatureReader(inputTypes.get(name),inputFiles.get(name)); @@ -135,7 +137,7 @@ public class IndexPerformanceTests extends BaseTest { for (int x = 1; x < 1000000; x = x + 1000) { //CloseableTribbleIterator iter = pairing.first.query("chr1", x+(int)Math.floor(Math.random()*1000), x+1000); // query CloseableTribbleIterator iter = pairing.first.query("chr1", x, x+1000); // query - for (Feature feat : iter) { + while (iter.hasNext() && iter.next().getStart() < x) { count++; } } @@ -205,8 +207,8 @@ public class IndexPerformanceTests extends BaseTest { private Map getMapOfFeatures(Map features, boolean useLinear) { File bigTable = new File("/humgen/gsa-hpprojects/dev/depristo/oneOffProjects/slowAnnotator/big.table.txt"); - TribbleRMDTrackBuilder.useLinearIndex = useLinear; - TribbleRMDTrackBuilder.binSize = 1000; + //TribbleRMDTrackBuilder.useLinearIndex = useLinear; + //TribbleRMDTrackBuilder.binSize = 1000; deleteIndex(inputFiles.get("Big Table")); // time creating the index @@ -238,8 +240,8 @@ public class IndexPerformanceTests extends BaseTest { //@Test public void testGetTreeIndexLocation() { File bigTable = new File("small.table.txt"); - TribbleRMDTrackBuilder.useLinearIndex = false; - TribbleRMDTrackBuilder.binSize = 1000; + //TribbleRMDTrackBuilder.useLinearIndex = false; + //TribbleRMDTrackBuilder.binSize = 1000; deleteIndex(bigTable); // time creating the index @@ -265,10 +267,10 @@ public class IndexPerformanceTests extends BaseTest { private void deleteIndex(File fl) { - File indexFile = new File(fl + TribbleRMDTrackBuilder.indexExtension); + System.err.println("Trying to delete index " + fl); boolean deleted = true; - if (indexFile.exists()) - deleted = indexFile.delete(); + if (fl.exists()) + deleted = fl.delete(); if (!deleted) Assert.fail("Unable to delete index file"); }