From 5fc613f972b0a858d15428e6eb762083d53fb306 Mon Sep 17 00:00:00 2001 From: Mark DePristo Date: Tue, 1 Nov 2011 19:47:10 -0400 Subject: [PATCH] Better default partition types for walkers -- Added PartitionType.READ, and associated ReadScatterFunction. ReadScatterFunction is literally just ContigScatterFunction until someone wants to implement something better -- LocusWalkers (and subclasses RodWalkers and RefWalkers) are by default PartitionType.LOCUS. --- .../sting/gatk/walkers/LocusWalker.java | 2 +- .../sting/gatk/walkers/PartitionType.java | 6 ++ .../sting/gatk/walkers/ReadWalker.java | 2 +- .../gatk/ContigScatterFunction.scala | 1 + .../extensions/gatk/ReadScatterFunction.scala | 56 +++++++++++++++++++ 5 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 public/scala/src/org/broadinstitute/sting/queue/extensions/gatk/ReadScatterFunction.scala diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/LocusWalker.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/LocusWalker.java index 8152f74c2..e94d01d5a 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/LocusWalker.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/LocusWalker.java @@ -17,7 +17,7 @@ import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; */ @By(DataSource.READS) @Requires({DataSource.READS,DataSource.REFERENCE, DataSource.REFERENCE_BASES}) -@PartitionBy(PartitionType.INTERVAL) +@PartitionBy(PartitionType.LOCUS) @ReadFilters({UnmappedReadFilter.class,NotPrimaryAlignmentFilter.class,DuplicateReadFilter.class,FailsVendorQualityCheckFilter.class}) public abstract class LocusWalker extends Walker { // Do we actually want to operate on the context? diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/PartitionType.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/PartitionType.java index 361e222c2..f0d92ef8a 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/PartitionType.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/PartitionType.java @@ -34,6 +34,12 @@ public enum PartitionType { */ NONE, + /** + * The walker inputs can be chunked down to individual + * reads. + */ + READ, + /** * The walker inputs can be chunked down to the * per-locus level. diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/ReadWalker.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/ReadWalker.java index db2038aa3..35f04abfc 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/ReadWalker.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/ReadWalker.java @@ -12,7 +12,7 @@ import org.broadinstitute.sting.gatk.refdata.ReadMetaDataTracker; * To change this template use File | Settings | File Templates. */ @Requires({DataSource.READS, DataSource.REFERENCE_BASES}) -@PartitionBy(PartitionType.CONTIG) +@PartitionBy(PartitionType.READ) public abstract class ReadWalker extends Walker { public boolean requiresOrderedReads() { return false; } diff --git a/public/scala/src/org/broadinstitute/sting/queue/extensions/gatk/ContigScatterFunction.scala b/public/scala/src/org/broadinstitute/sting/queue/extensions/gatk/ContigScatterFunction.scala index ee4cb9c4a..d2b3006a9 100755 --- a/public/scala/src/org/broadinstitute/sting/queue/extensions/gatk/ContigScatterFunction.scala +++ b/public/scala/src/org/broadinstitute/sting/queue/extensions/gatk/ContigScatterFunction.scala @@ -44,3 +44,4 @@ class ContigScatterFunction extends GATKScatterFunction with InProcessFunction { IntervalUtils.scatterContigIntervals(gi.samFileHeader, gi.locs, this.scatterOutputFiles) } } + diff --git a/public/scala/src/org/broadinstitute/sting/queue/extensions/gatk/ReadScatterFunction.scala b/public/scala/src/org/broadinstitute/sting/queue/extensions/gatk/ReadScatterFunction.scala new file mode 100644 index 000000000..f56c4aa02 --- /dev/null +++ b/public/scala/src/org/broadinstitute/sting/queue/extensions/gatk/ReadScatterFunction.scala @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2011, The Broad Institute + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +package org.broadinstitute.sting.queue.extensions.gatk + +/* + * Copyright (c) 2011, The Broad Institute + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * Currently ReadScatterFunction only does ContigScattering, but it + * could in principle do something more aggressive. + */ +class ReadScatterFunction extends ContigScatterFunction { } +