renamed; these files are more strategy than actual shards
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@312 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
e95f427965
commit
6369d23b43
|
|
@ -28,7 +28,7 @@ import net.sf.samtools.SAMSequenceDictionary;
|
||||||
* <p/>
|
* <p/>
|
||||||
* A descriptions should go here. Blame aaron if it's missing.
|
* A descriptions should go here. Blame aaron if it's missing.
|
||||||
*/
|
*/
|
||||||
class AdaptiveShard extends Shard {
|
class AdaptiveShardStrategy extends ShardStrategy {
|
||||||
|
|
||||||
// default the next size to 100,000
|
// default the next size to 100,000
|
||||||
private long nextShardSize = 100000;
|
private long nextShardSize = 100000;
|
||||||
|
|
@ -38,7 +38,7 @@ class AdaptiveShard extends Shard {
|
||||||
*
|
*
|
||||||
* @param dic the seq dictionary
|
* @param dic the seq dictionary
|
||||||
*/
|
*/
|
||||||
AdaptiveShard(SAMSequenceDictionary dic, long startSize) {
|
AdaptiveShardStrategy(SAMSequenceDictionary dic, long startSize) {
|
||||||
super(dic);
|
super(dic);
|
||||||
this.nextShardSize = startSize;
|
this.nextShardSize = startSize;
|
||||||
}
|
}
|
||||||
|
|
@ -28,7 +28,7 @@ import net.sf.samtools.SAMSequenceDictionary;
|
||||||
* <p/>
|
* <p/>
|
||||||
* A descriptions should go here. Blame aaron if it's missing.
|
* A descriptions should go here. Blame aaron if it's missing.
|
||||||
*/
|
*/
|
||||||
public class LinearShard extends Shard {
|
public class LinearShardStrategy extends ShardStrategy {
|
||||||
|
|
||||||
// fixed size
|
// fixed size
|
||||||
private long nextShardSize = 100000;
|
private long nextShardSize = 100000;
|
||||||
|
|
@ -38,7 +38,7 @@ public class LinearShard extends Shard {
|
||||||
*
|
*
|
||||||
* @param dic the seq dictionary
|
* @param dic the seq dictionary
|
||||||
*/
|
*/
|
||||||
LinearShard(SAMSequenceDictionary dic, long startSize) {
|
LinearShardStrategy(SAMSequenceDictionary dic, long startSize) {
|
||||||
super(dic);
|
super(dic);
|
||||||
this.nextShardSize = startSize;
|
this.nextShardSize = startSize;
|
||||||
}
|
}
|
||||||
|
|
@ -29,7 +29,7 @@ import java.util.Iterator;
|
||||||
* <p/>
|
* <p/>
|
||||||
* The shard interface, which controls how data is divided
|
* The shard interface, which controls how data is divided
|
||||||
*/
|
*/
|
||||||
public abstract class Shard implements Iterator<GenomeLoc> {
|
public abstract class ShardStrategy implements Iterator<GenomeLoc> {
|
||||||
|
|
||||||
// this stores the seq dictionary, which is a reference for the
|
// this stores the seq dictionary, which is a reference for the
|
||||||
// lengths and names of contigs, which you need to generate an iterative stratagy
|
// lengths and names of contigs, which you need to generate an iterative stratagy
|
||||||
|
|
@ -53,7 +53,7 @@ public abstract class Shard implements Iterator<GenomeLoc> {
|
||||||
*
|
*
|
||||||
* @param dic the seq dictionary
|
* @param dic the seq dictionary
|
||||||
*/
|
*/
|
||||||
Shard(SAMSequenceDictionary dic) {
|
ShardStrategy(SAMSequenceDictionary dic) {
|
||||||
this.dic = dic;
|
this.dic = dic;
|
||||||
mLoc = new GenomeLoc(dic.getSequence(0).getSequenceName(), 0, 0);
|
mLoc = new GenomeLoc(dic.getSequence(0).getSequenceName(), 0, 0);
|
||||||
if (dic.getSequences().size() > 0) {
|
if (dic.getSequences().size() > 0) {
|
||||||
|
|
@ -28,7 +28,7 @@ import net.sf.samtools.SAMSequenceDictionary;
|
||||||
* <p/>
|
* <p/>
|
||||||
* A descriptions should go here. Blame aaron if it's missing.
|
* A descriptions should go here. Blame aaron if it's missing.
|
||||||
*/
|
*/
|
||||||
public class ShardFactory {
|
public class ShardStrategyFactory {
|
||||||
public enum SHATTER_STRATEGY {
|
public enum SHATTER_STRATEGY {
|
||||||
ADAPTIVE, LINEAR
|
ADAPTIVE, LINEAR
|
||||||
}
|
}
|
||||||
|
|
@ -41,13 +41,13 @@ public class ShardFactory {
|
||||||
* @param startingSize the starting size
|
* @param startingSize the starting size
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
static public Shard shatter(SHATTER_STRATEGY strat, SAMSequenceDictionary dic, long startingSize) {
|
static public ShardStrategy shatter(SHATTER_STRATEGY strat, SAMSequenceDictionary dic, long startingSize) {
|
||||||
Shard d = null;
|
ShardStrategy d = null;
|
||||||
switch (strat) {
|
switch (strat) {
|
||||||
case ADAPTIVE:
|
case ADAPTIVE:
|
||||||
d = new AdaptiveShard(dic, startingSize);
|
d = new AdaptiveShardStrategy(dic, startingSize);
|
||||||
default:
|
default:
|
||||||
d = new LinearShard(dic, startingSize); // default
|
d = new LinearShardStrategy(dic, startingSize); // default
|
||||||
}
|
}
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
@ -59,8 +59,8 @@ public class ShardFactory {
|
||||||
* @param startingSize the starting size
|
* @param startingSize the starting size
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
static public AdaptiveShard getAdaptiveShard(SAMSequenceDictionary dic, long startingSize) {
|
static public AdaptiveShardStrategy getAdaptiveShard(SAMSequenceDictionary dic, long startingSize) {
|
||||||
return new AdaptiveShard(dic, startingSize);
|
return new AdaptiveShardStrategy(dic, startingSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue