diff --git a/java/src/org/broadinstitute/sting/gatk/dataSources/shards/AdaptiveShard.java b/java/src/org/broadinstitute/sting/gatk/dataSources/shards/AdaptiveShard.java new file mode 100644 index 000000000..90180f02a --- /dev/null +++ b/java/src/org/broadinstitute/sting/gatk/dataSources/shards/AdaptiveShard.java @@ -0,0 +1,58 @@ +package org.broadinstitute.sting.gatk.dataSources.shards; + +import net.sf.samtools.SAMSequenceDictionary; + +/** + * + * User: aaron + * Date: Apr 6, 2009 + * Time: 7:18:19 PM + * + * The Broad Institute + * SOFTWARE COPYRIGHT NOTICE AGREEMENT + * This software and its documentation are copyright 2009 by the + * Broad Institute/Massachusetts Institute of Technology. All rights are reserved. + * + * This software is supplied without any warranty or guaranteed support whatsoever. Neither + * the Broad Institute nor MIT can be responsible for its use, misuse, or functionality. + * + */ + + +/** + * @author aaron + * @version 1.0 + * @date Apr 6, 2009 + *
+ * Class AdaptiveShard + * + * A descriptions should go here. Blame aaron if it's missing. + */ +class AdaptiveShard extends Shard { + + // default the next size to 100,000 + private long nextShardSize = 100000; + + /** + * the constructor, taking a seq dictionary to parse out contigs + * + * @param dic the seq dictionary + */ + AdaptiveShard(SAMSequenceDictionary dic, long startSize) { + super(dic); + this.nextShardSize = startSize; + } + + public void setNextShardSize(long size) { + nextShardSize = size; + } + + /** + * This is how the various shards strategies implements their approach + * + * @return the next shard size + */ + protected long nextShardSize() { + return nextShardSize; + } +} diff --git a/java/src/org/broadinstitute/sting/gatk/dataSources/shards/LinearShard.java b/java/src/org/broadinstitute/sting/gatk/dataSources/shards/LinearShard.java new file mode 100644 index 000000000..8287ea51f --- /dev/null +++ b/java/src/org/broadinstitute/sting/gatk/dataSources/shards/LinearShard.java @@ -0,0 +1,54 @@ +package org.broadinstitute.sting.gatk.dataSources.shards; + +import net.sf.samtools.SAMSequenceDictionary; + +/** + * + * User: aaron + * Date: Apr 6, 2009 + * Time: 8:23:19 PM + * + * The Broad Institute + * SOFTWARE COPYRIGHT NOTICE AGREEMENT + * This software and its documentation are copyright 2009 by the + * Broad Institute/Massachusetts Institute of Technology. All rights are reserved. + * + * This software is supplied without any warranty or guaranteed support whatsoever. Neither + * the Broad Institute nor MIT can be responsible for its use, misuse, or functionality. + * + */ + + +/** + * @author aaron + * @version 1.0 + * @date Apr 6, 2009 + * + * Class LinearShard + * + * A descriptions should go here. Blame aaron if it's missing. + */ +public class LinearShard extends Shard { + + // fixed size + private long nextShardSize = 100000; + + /** + * the constructor, taking a seq dictionary to parse out contigs + * + * @param dic the seq dictionary + */ + LinearShard(SAMSequenceDictionary dic, long startSize) { + super(dic); + this.nextShardSize = startSize; + } + + /** + * This is how the various shards strategies implements their approach + * + * @return the next shard size + */ + protected long nextShardSize() { + return nextShardSize; + } +} diff --git a/java/src/org/broadinstitute/sting/gatk/dataSources/shards/Shard.java b/java/src/org/broadinstitute/sting/gatk/dataSources/shards/Shard.java new file mode 100644 index 000000000..9eeb3241c --- /dev/null +++ b/java/src/org/broadinstitute/sting/gatk/dataSources/shards/Shard.java @@ -0,0 +1,126 @@ +package org.broadinstitute.sting.gatk.dataSources.shards; + +import net.sf.samtools.SAMSequenceDictionary; +import org.broadinstitute.sting.utils.GenomeLoc; + +import java.util.Iterator; +/** + * + * User: aaron + * Date: Apr 6, 2009 + * Time: 11:23:17 AM + * + * The Broad Institute + * SOFTWARE COPYRIGHT NOTICE AGREEMENT + * This software and its documentation are copyright 2009 by the + * Broad Institute/Massachusetts Institute of Technology. All rights are reserved. + * + * This software is supplied without any warranty or guaranteed support whatsoever. Neither + * the Broad Institute nor MIT can be responsible for its use, misuse, or functionality. + * + */ + +/** + * @author aaron + * @version 1.0 + * @date Apr 6, 2009 + * + * Interface Shard + * + * The shard interface, which controls how data is divided + */ +public abstract class Shard implements Iterator